Skip to content

Commit 1fef7fa

Browse files
wanghongjuanrogerwang
authored andcommitted
[test] Add test for issue#6113
- Add test for issue nwjs#6113 - This test is failed on failed version 0.24.3, pass on fixed version 0.27.4
1 parent eec260d commit 1fef7fa

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<title>issue6113-mac-create-crash</title>
7+
</head>
8+
<body>
9+
<h3 id="result">success</h3>
10+
<script>
11+
chrome.windows.create({ url: "https://google.com", type:"popup" });
12+
</script>
13+
</body>
14+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "issue6113-mac-create-crash",
3+
"main": "index.html"
4+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import time
2+
import os
3+
import platform
4+
import sys
5+
6+
if platform.system() != 'Darwin':
7+
print 'Skipped for non Mac platform'
8+
sys.exit(0)
9+
10+
from selenium import webdriver
11+
from selenium.webdriver.chrome.options import Options
12+
13+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
14+
from nw_util import *
15+
16+
chrome_options = Options()
17+
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
18+
19+
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
20+
driver.implicitly_wait(2)
21+
try:
22+
wait_window_handles(driver, 2)
23+
handles = driver.window_handles
24+
print handles
25+
driver.switch_to.window(handles[1])
26+
output = driver.current_url
27+
print output
28+
print 'waiting for crash'
29+
time.sleep(5)
30+
assert driver.title == "Google"
31+
assert("https://www.google.com/" in output)
32+
print 'There is no crash'
33+
finally:
34+
driver.quit()

0 commit comments

Comments
 (0)