@@ -54,36 +54,39 @@ def write_file(filename, content):
54
54
driver .implicitly_wait (5 )
55
55
time .sleep (1 )
56
56
try :
57
- print driver .current_url
58
- driver .switch_to_frame (driver .find_element_by_id ('test-frame' ))
59
- title = driver .execute_script ('return document.title' )
60
- print title
61
- result = driver .find_element_by_id ('result' ).get_attribute ('innerHTML' )
62
- print result
63
- assert ('success' in result )
64
- driver .close ()
65
- finally :
66
- driver .quit ()
57
+ try :
58
+ print driver .current_url
59
+ driver .switch_to_frame (driver .find_element_by_id ('test-frame' ))
60
+ title = driver .execute_script ('return document.title' )
61
+ print title
62
+ result = driver .find_element_by_id ('result' ).get_attribute ('innerHTML' )
63
+ print result
64
+ assert ('success' in result )
65
+ driver .close ()
66
+ finally :
67
+ driver .quit ()
67
68
68
- # test without trust anchors
69
- pkg_without_trust_anchors = '''
69
+ # test without trust anchors
70
+ pkg_without_trust_anchors = '''
70
71
{
71
- "name": "test_additional_trust_anchors",
72
- "main": "index.html"
72
+ "name": "test_additional_trust_anchors",
73
+ "main": "index.html"
73
74
}
74
75
'''
75
- write_file ('package.json' , pkg_without_trust_anchors )
76
+ write_file ('package.json' , pkg_without_trust_anchors )
77
+
78
+ driver = webdriver .Chrome (executable_path = os .environ ['CHROMEDRIVER' ], chrome_options = chrome_options , service_log_path = "log" , service_args = ["--verbose" ])
79
+ driver .implicitly_wait (5 )
80
+ time .sleep (1 )
81
+ try :
82
+ print driver .current_url
83
+ driver .switch_to_frame (driver .find_element_by_id ('test-frame' ))
84
+ title = driver .execute_script ('return document.title' )
85
+ print title
86
+ assert (not 'test.html' in title )
87
+ driver .close ()
88
+ finally :
89
+ driver .quit ()
76
90
77
- driver = webdriver .Chrome (executable_path = os .environ ['CHROMEDRIVER' ], chrome_options = chrome_options , service_log_path = "log" , service_args = ["--verbose" ])
78
- driver .implicitly_wait (5 )
79
- time .sleep (1 )
80
- try :
81
- print driver .current_url
82
- driver .switch_to_frame (driver .find_element_by_id ('test-frame' ))
83
- title = driver .execute_script ('return document.title' )
84
- print title
85
- assert (not 'test.html' in title )
86
- driver .close ()
87
91
finally :
88
92
server .terminate ()
89
- driver .quit ()
0 commit comments