Skip to content

Commit 18af22b

Browse files
wanghongjuanrogerwang
authored andcommitted
[test] Add test for issue6324
- Add test for issue nwjs#6324 - This test is failed on v0.27.1, passed on v0.29.3
1 parent 26e6341 commit 18af22b

File tree

6 files changed

+77
-0
lines changed

6 files changed

+77
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Hello World!</title>
5+
</head>
6+
<body>
7+
<h1>Hello World!</h1>
8+
<iframe src=""></iframe>
9+
</body>
10+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "6324",
3+
"main": "index.html"
4+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import time
2+
import os
3+
4+
from selenium import webdriver
5+
from selenium.webdriver.chrome.options import Options
6+
chrome_options = Options()
7+
test_dir = os.path.dirname(os.path.abspath(__file__))
8+
chrome_options.add_argument("nwapp=" + test_dir)
9+
chrome_options.add_nw_argument("--load-extension=" + os.path.join(test_dir, 'test_ext/'))
10+
11+
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
12+
driver.implicitly_wait(5)
13+
try:
14+
print driver.current_url
15+
result = driver.find_element_by_tag_name('h1').get_attribute('innerHTML')
16+
print result
17+
assert('Hello World' in result)
18+
res = driver.find_element_by_tag_name('iframe')
19+
assert(res is not None)
20+
finally:
21+
driver.quit()

test/sanity/issue6324-extension_all_frame_true_exit/test_ext/bg.js

Whitespace-only changes.

test/sanity/issue6324-extension_all_frame_true_exit/test_ext/cs.js

Whitespace-only changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"manifest_version": 2,
3+
"browser_action": {
4+
"default_title": "TEST_EXT"
5+
},
6+
"content_scripts": [
7+
{
8+
"js": [
9+
"cs.js"
10+
],
11+
"matches": [
12+
"<all_urls>"
13+
],
14+
"all_frames": true,
15+
"match_about_blank": true,
16+
"run_at": "document_start",
17+
"permissions": [
18+
"tabs"
19+
]
20+
}
21+
],
22+
"permissions": [
23+
"browsingData",
24+
"webNavigation",
25+
"webRequest",
26+
"webRequestBlocking",
27+
"notifications",
28+
"chrome-extension://*", "file:///*", "http://*/*", "https://*/*",
29+
"<all_urls>",
30+
"proxy",
31+
"tabs"
32+
],
33+
"background": {
34+
"scripts": [
35+
"bg.js"
36+
]
37+
},
38+
"description": "TEST EXT",
39+
"name": "TEST EXT",
40+
"version": "0.0.1",
41+
"author": "Stefano"
42+
}

0 commit comments

Comments
 (0)