File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
test/sanity/issue4352-zoom-all Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 5
5
< body >
6
6
< div id ='result '> zoom level</ div >
7
7
< script >
8
+ window . name = 'index' ;
8
9
function test ( val ) {
9
10
document . getElementById ( 'result' ) . innerHTML = val ;
10
11
}
Original file line number Diff line number Diff line change 5
5
< body >
6
6
< div id ='result '> zoom level</ div >
7
7
< script >
8
+ window . name = 'popup' ;
8
9
nw . Window . get ( ) . zoomLevel = 2 ;
9
10
setTimeout ( function ( ) {
10
11
document . getElementById ( 'result' ) . innerHTML = window . devicePixelRatio ;
Original file line number Diff line number Diff line change 1
1
import time
2
2
import os
3
+ import sys
4
+ sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
5
+ from nw_util import *
3
6
4
7
from selenium import webdriver
5
8
from selenium .webdriver .chrome .options import Options
10
13
driver .implicitly_wait (5 )
11
14
time .sleep (1 )
12
15
try :
16
+ wait_window_handles (driver , 2 )
17
+ wait_switch_window_name (driver , 'popup' )
13
18
print driver .current_url
14
- driver .switch_to_window (driver .window_handles [- 1 ])
15
19
zoom2 = 'zoom level'
16
20
while zoom2 == 'zoom level' :
17
21
zoom2 = driver .find_element_by_id ('result' ).get_attribute ('innerHTML' )
18
22
time .sleep (1 )
19
23
print "zoom2: " , zoom2
20
- driver . switch_to_window (driver . window_handles [ 0 ] )
24
+ wait_switch_window_name (driver , 'index' )
21
25
driver .find_element_by_id ('get-zoom' ).click ()
22
26
zoom1 = driver .find_element_by_id ('result' ).get_attribute ('innerHTML' )
23
27
print "zoom1: " , zoom1
You can’t perform that action at this time.
0 commit comments