Skip to content

Commit e3629b2

Browse files
committed
[test] fix case issue5355-cookie-lost-remote-page
1 parent 0fbc9d4 commit e3629b2

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

test/sanity/issue5355-cookie-lost-remote-page/index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<title>cookie-lost-remote-page</title>
77
</head>
88
<body>
9+
<button id="open-cdt" onclick="nw.Window.get().showDevTools()">open cdt</button>
10+
<button id="close-cdt" onclick="nw.Window.get().closeDevTools()">close cdt</button>
911
<button id="get-cookie" onclick="getcookie()">Get Cookie</button>
1012
<script>
1113
function getcookie() {
@@ -16,4 +18,4 @@
1618
}
1719
</script>
1820
</body>
19-
</html>
21+
</html>

test/sanity/issue5355-cookie-lost-remote-page/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ const http = require('http');
33
let id = 1;
44

55
nw.Window.open(`http://localhost:${nw.App.manifest.port}/`, (w)=>{
6-
w.showDevTools();
7-
w.closeDevTools();
6+
//w.showDevTools();
7+
//w.closeDevTools();
88
});
99

1010
// Create an HTTP server

test/sanity/issue5355-cookie-lost-remote-page/test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
{
1919
"name": "cookie-lost-remote-page",
2020
"main": "main.js",
21+
"node-remote": "http://localhost/*",
2122
"port": "%s"
2223
}
2324
''' % port
@@ -32,6 +33,10 @@
3233
wait_window_handles(driver, 1)
3334
switch_to_app(driver)
3435
print driver.current_url
36+
driver.find_element_by_id('open-cdt').click()
37+
time.sleep(1)
38+
driver.find_element_by_id('close-cdt').click()
39+
time.sleep(1)
3540
driver.find_element_by_id('get-cookie').click()
3641
result = driver.find_element_by_id('result').get_attribute('innerHTML')
3742
print result

test/sanity/nw_util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def wait_for_element_id(driver, elem_id, timeout=10):
1818
break
1919
except selenium.common.exceptions.NoSuchElementException:
2020
pass
21+
except selenium.common.exceptions.WebDriverException:
22+
pass
2123
time.sleep(1)
2224
timeout = timeout - 1
2325
if timeout <= 0:

0 commit comments

Comments
 (0)