File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed
test/sanity/issue5906-webview-getCookieStoreId Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ < style type ="text/css ">
2
+ # demo {
3
+ display : inline-block;
4
+ height : 200px ;
5
+ width : 320px ;
6
+ }
7
+ </ style >
8
+ < webview id ="demo " partition ="trusted " src ="about:blank "> </ webview >
9
+ < script >
10
+ var win = nw . Window . get ( ) ;
11
+ function out ( id , msg ) {
12
+ var h2 = document . createElement ( "h2" ) ;
13
+ h2 . setAttribute ( "id" , id ) ;
14
+ h2 . innerHTML = msg ;
15
+ document . body . appendChild ( h2 ) ;
16
+ }
17
+ var webview = document . getElementById ( "demo" ) ;
18
+ document . addEventListener ( "DOMContentLoaded" , function ( event ) {
19
+ setTimeout ( ( ) => {
20
+ storeId = webview . getCookieStoreId ( )
21
+ out ( 'result' , storeId )
22
+ } , 1000 )
23
+ } )
24
+ </ script >
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " issue5906-webview-getCookieStoreId" ,
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
+
5
+ sys .path .append (os .path .dirname (os .path .dirname (os .path .abspath (__file__ ))))
6
+ from nw_util import *
7
+
8
+ from selenium import webdriver
9
+ from selenium .webdriver .chrome .options import Options
10
+
11
+ chrome_options = Options ()
12
+ testdir = os .path .dirname (os .path .abspath (__file__ ))
13
+ chrome_options .add_argument ("nwapp=" + testdir )
14
+
15
+ driver = webdriver .Chrome (executable_path = os .environ ['CHROMEDRIVER' ], chrome_options = chrome_options )
16
+ driver .implicitly_wait (5 )
17
+ time .sleep (1 )
18
+ try :
19
+ print driver .current_url
20
+ print 'waiting to load storeId in cookie'
21
+ result = wait_for_element_tag (driver , "h2" )
22
+ print result
23
+ assert (len (result ) > 0 )
24
+ print 'storeId is loaded'
25
+ finally :
26
+ driver .quit ()
You can’t perform that action at this time.
0 commit comments