forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test for issue nwjs#6113 - This test is failed on failed version 0.24.3, pass on fixed version 0.27.4
- Loading branch information
1 parent
65cc2f4
commit 13e52be
Showing
3 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>issue6113-mac-create-crash</title> | ||
</head> | ||
<body> | ||
<h3 id="result">success</h3> | ||
<script> | ||
chrome.windows.create({ url: "https://google.com", type:"popup" }); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "issue6113-mac-create-crash", | ||
"main": "index.html" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import time | ||
import os | ||
import platform | ||
import sys | ||
|
||
if platform.system() != 'Darwin': | ||
print 'Skipped for non Mac platform' | ||
sys.exit(0) | ||
|
||
from selenium import webdriver | ||
from selenium.webdriver.chrome.options import Options | ||
|
||
chrome_options = Options() | ||
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__))) | ||
|
||
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options) | ||
driver.implicitly_wait(2) | ||
try: | ||
handles = driver.window_handles | ||
print handles | ||
driver.switch_to.window(handles[1]) | ||
output = driver.current_url | ||
print output | ||
print 'waiting for crash' | ||
time.sleep(5) | ||
assert driver.title == "Google" | ||
assert("https://www.google.com/" in output) | ||
print 'There is no crash' | ||
finally: | ||
driver.quit() |