Skip to content

Commit ae97f65

Browse files
committed
[test] fix issue4007-reload-lost-app-window for nw20
1 parent 69e7ac3 commit ae97f65

File tree

1 file changed

+10
-9
lines changed
  • test/sanity/issue4007-reload-lost-app-window

1 file changed

+10
-9
lines changed

test/sanity/issue4007-reload-lost-app-window/test.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
chrome_options = Options()
1010
chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__)))
1111

12-
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options)
12+
capabilities = {"pageLoadStrategy": "none"}
13+
14+
driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options, service_log_path="log", service_args=["--verbose"], desired_capabilities = capabilities)
1315
time.sleep(1)
1416
try:
1517
print driver.current_url
@@ -22,15 +24,14 @@
2224
wait_window_handles(driver, lambda handles: len(handles) != 0 and handles[0] != old_handle)
2325
# devtools will be opened as the first window handle
2426
print driver.window_handles
25-
print 'switch to devtools'
2627
switch_to_devtools(driver, devtools_window=driver.window_handles[0])
27-
print 'close devtools'
28-
driver.close()
29-
wait_window_handles(driver, 1)
30-
print driver.window_handles
31-
print 'switch to main window'
32-
driver.switch_to_window(driver.window_handles[0])
33-
result = driver.find_element_by_id('result').get_attribute('innerHTML')
28+
print 'click Console panel'
29+
devtools_click_tab(driver, 'console')
30+
print 'send_keys "document.getElementById(\'result\').innerHTML<enter>"'
31+
time.sleep(1)
32+
devtools_type_in_console(driver, 'document.getElementById(\'result\').innerHTML\n')
33+
time.sleep(1)
34+
result = driver.find_element_by_css_selector('.console-user-command-result .console-message-text .object-value-string').get_attribute('textContent')
3435
print result
3536
assert("success" in result)
3637
finally:

0 commit comments

Comments
 (0)