File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
test/sanity/issue4007-reload-lost-app-window Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 9
9
< body >
10
10
< h1 > Reload the app</ h1 >
11
11
< button id ="reloadapp " onclick ="reloadApp() "> Reload</ button >
12
+ < button id ="opendevtools " onclick ="openDevTools() "> Reload</ button >
12
13
< script >
13
14
function reloadApp ( ) {
14
15
chrome . runtime . reload ( ) ;
15
16
}
16
17
18
+ function openDevTools ( ) {
19
+ nw . Window . get ( ) . showDevTools ( ) ;
20
+ }
21
+
17
22
try {
18
23
nw . Window . get ( )
19
24
document . write ( '<h1 id="result">success</h1>' ) ;
@@ -22,4 +27,4 @@ <h1>Reload the app</h1>
22
27
}
23
28
</ script >
24
29
</ body >
25
- </ html >
30
+ </ html >
Original file line number Diff line number Diff line change 27
27
try :
28
28
switch_to_devtools (driver , devtools_window = driver .window_handles [0 ])
29
29
except :
30
+ if len (driver .window_handles ) < 2 :
31
+ driver .find_element_by_id ('opendevtools' ).click ()
32
+ wait_window_handles (driver , lambda handles : len (handles ) == 2 )
30
33
switch_to_devtools (driver , devtools_window = driver .window_handles [1 ])
31
34
print 'click Console panel'
32
35
devtools_click_tab (driver , 'console' )
You can’t perform that action at this time.
0 commit comments