Skip to content

Commit

Permalink
[test] Add test for issue#6113
Browse files Browse the repository at this point in the history
- 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
wanghongjuan committed Jan 18, 2018
1 parent 65cc2f4 commit 13e52be
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/sanity/issue6113-mac-create-crash/index.html
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>
4 changes: 4 additions & 0 deletions test/sanity/issue6113-mac-create-crash/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "issue6113-mac-create-crash",
"main": "index.html"
}
30 changes: 30 additions & 0 deletions test/sanity/issue6113-mac-create-crash/test.py
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()

0 comments on commit 13e52be

Please sign in to comment.