File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
test/sanity/issue7609-mixed-context Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
+ < title > child.html</ title >
7
+ </ head >
8
+ < body >
9
+ < script > document . write ( '<h1 id="result">typeof module = ' + typeof module + '</h1>' ) </ script >
10
+ </ body >
11
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="utf-8 ">
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge ">
6
+ < title > issue5163</ title >
7
+ </ head >
8
+ < body >
9
+ < button id ="spawnRender " type ="button " onclick ="spawnRender() "> Create New Instance Window</ button >
10
+ < script >
11
+ function spawnRender ( ) {
12
+ nw . Window . open ( 'child.html' , { new_instance : true , mixed_context : true } ) ;
13
+ }
14
+ </ script >
15
+ </ body >
16
+ </ html >
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " issue5163-new-instance" ,
3
+ "main" : " index.html"
4
+ }
Original file line number Diff line number Diff line change
1
+ import time
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 *
6
+
7
+ from selenium import webdriver
8
+ from selenium .webdriver .chrome .options import Options
9
+ chrome_options = Options ()
10
+ chrome_options .add_argument ("nwapp=" + os .path .dirname (os .path .abspath (__file__ )))
11
+
12
+ driver = webdriver .Chrome (executable_path = os .environ ['CHROMEDRIVER' ], chrome_options = chrome_options )
13
+ try :
14
+ print driver .current_url
15
+ driver .find_element_by_id ('spawnRender' ).click ()
16
+ print 'wait for window open'
17
+ wait_window_handles (driver , 2 )
18
+ print driver .window_handles
19
+ print 'switch to 1st window'
20
+ driver .switch_to_window (driver .window_handles [- 1 ])
21
+ result1 = driver .find_element_by_id ('result' ).get_attribute ('innerHTML' )
22
+ print result1
23
+ assert ('object' in result1 )
24
+ finally :
25
+ driver .quit ()
You can’t perform that action at this time.
0 commit comments