21
21
22
22
23
23
@pytest .mark .asyncio
24
+ @pytest .mark .parametrize ('capabilities' , [{
25
+ 'acceptInsecureCerts' : True
26
+ }],
27
+ indirect = True )
24
28
@pytest .mark .parametrize ('multiple' , [True , False ])
25
- async def test_file_dialog_show_file_event (websocket , context_id , url_example ,
29
+ async def test_file_dialog_show_file_event (websocket , context_id , url_bad_ssl ,
26
30
multiple ):
27
- await goto_url (websocket , context_id , url_example )
31
+ await goto_url (websocket , context_id , url_bad_ssl )
28
32
29
33
await subscribe (websocket , ["input.fileDialogOpened" ])
30
34
@@ -88,6 +92,10 @@ async def test_file_dialog_show_directory_event(websocket, context_id,
88
92
89
93
90
94
@pytest .mark .asyncio
95
+ @pytest .mark .parametrize ('capabilities' , [{
96
+ 'acceptInsecureCerts' : True
97
+ }],
98
+ indirect = True )
91
99
@pytest .mark .parametrize ('multiple' , [True , False ])
92
100
async def test_file_dialog_input_click_event (websocket , context_id , html ,
93
101
read_messages , multiple ,
@@ -118,34 +126,42 @@ async def test_file_dialog_input_click_event(websocket, context_id, html,
118
126
@pytest .mark .asyncio
119
127
@pytest .mark .parametrize ('capabilities' , [
120
128
{
129
+ 'acceptInsecureCerts' : True ,
121
130
'unhandledPromptBehavior' : 'dismiss'
122
131
},
123
132
{
133
+ 'acceptInsecureCerts' : True ,
124
134
'unhandledPromptBehavior' : 'dismiss and notify'
125
135
},
126
136
{
137
+ 'acceptInsecureCerts' : True ,
127
138
'unhandledPromptBehavior' : {
128
139
'default' : 'dismiss'
129
140
}
130
141
},
131
142
{
143
+ 'acceptInsecureCerts' : True ,
132
144
'unhandledPromptBehavior' : {
133
145
'file' : 'dismiss' ,
134
146
'default' : 'ignore'
135
147
}
136
148
},
137
149
{
150
+ 'acceptInsecureCerts' : True ,
138
151
'unhandledPromptBehavior' : 'accept'
139
152
},
140
153
{
154
+ 'acceptInsecureCerts' : True ,
141
155
'unhandledPromptBehavior' : 'accept and notify'
142
156
},
143
157
{
158
+ 'acceptInsecureCerts' : True ,
144
159
'unhandledPromptBehavior' : {
145
160
'default' : 'accept'
146
161
}
147
162
},
148
163
{
164
+ 'acceptInsecureCerts' : True ,
149
165
'unhandledPromptBehavior' : {
150
166
'file' : 'accept' ,
151
167
'default' : 'ignore'
@@ -192,12 +208,15 @@ async def test_file_dialog_unhandled_prompt_behavior_input_cancel(
192
208
193
209
@pytest .mark .asyncio
194
210
@pytest .mark .parametrize ('capabilities' , [{}, {
211
+ 'acceptInsecureCerts' : True ,
195
212
'unhandledPromptBehavior' : 'ignore'
196
213
}, {
214
+ 'acceptInsecureCerts' : True ,
197
215
'unhandledPromptBehavior' : {
198
216
'default' : 'ignore'
199
217
}
200
218
}, {
219
+ 'acceptInsecureCerts' : True ,
201
220
'unhandledPromptBehavior' : {
202
221
'file' : 'ignore' ,
203
222
'default' : 'dismiss'
@@ -251,34 +270,42 @@ async def test_file_dialog_unhandled_prompt_behavior_input_ignore(
251
270
@pytest .mark .asyncio
252
271
@pytest .mark .parametrize ('capabilities' , [
253
272
{
273
+ 'acceptInsecureCerts' : True ,
254
274
'unhandledPromptBehavior' : 'dismiss'
255
275
},
256
276
{
277
+ 'acceptInsecureCerts' : True ,
257
278
'unhandledPromptBehavior' : 'dismiss and notify'
258
279
},
259
280
{
281
+ 'acceptInsecureCerts' : True ,
260
282
'unhandledPromptBehavior' : {
261
283
'default' : 'dismiss'
262
284
}
263
285
},
264
286
{
287
+ 'acceptInsecureCerts' : True ,
265
288
'unhandledPromptBehavior' : {
266
289
'file' : 'dismiss' ,
267
290
'default' : 'ignore'
268
291
}
269
292
},
270
293
{
294
+ 'acceptInsecureCerts' : True ,
271
295
'unhandledPromptBehavior' : 'accept'
272
296
},
273
297
{
298
+ 'acceptInsecureCerts' : True ,
274
299
'unhandledPromptBehavior' : 'accept and notify'
275
300
},
276
301
{
302
+ 'acceptInsecureCerts' : True ,
277
303
'unhandledPromptBehavior' : {
278
304
'default' : 'accept'
279
305
}
280
306
},
281
307
{
308
+ 'acceptInsecureCerts' : True ,
282
309
'unhandledPromptBehavior' : {
283
310
'file' : 'accept' ,
284
311
'default' : 'ignore'
@@ -287,8 +314,8 @@ async def test_file_dialog_unhandled_prompt_behavior_input_ignore(
287
314
],
288
315
indirect = True )
289
316
async def test_file_dialog_unhandled_prompt_behavior_show_file_cancel (
290
- websocket , context_id , url_example ):
291
- await goto_url (websocket , context_id , url_example )
317
+ websocket , context_id , url_bad_ssl ):
318
+ await goto_url (websocket , context_id , url_bad_ssl )
292
319
await subscribe (websocket , ["input.fileDialogOpened" ])
293
320
294
321
resp = await execute_command (
@@ -313,21 +340,26 @@ async def test_file_dialog_unhandled_prompt_behavior_show_file_cancel(
313
340
314
341
315
342
@pytest .mark .asyncio
316
- @pytest .mark .parametrize ('capabilities' , [{}, {
343
+ @pytest .mark .parametrize ('capabilities' , [{
344
+ 'acceptInsecureCerts' : True
345
+ }, {
346
+ 'acceptInsecureCerts' : True ,
317
347
'unhandledPromptBehavior' : 'ignore'
318
348
}, {
349
+ 'acceptInsecureCerts' : True ,
319
350
'unhandledPromptBehavior' : {
320
351
'default' : 'ignore'
321
352
}
322
353
}, {
354
+ 'acceptInsecureCerts' : True ,
323
355
'unhandledPromptBehavior' : {
324
356
'file' : 'ignore' ,
325
357
'default' : 'dismiss'
326
358
}
327
359
}],
328
360
indirect = True )
329
361
async def test_file_dialog_unhandled_prompt_behavior_show_file_ignore (
330
- websocket , context_id , url_example , test_headless_mode ):
362
+ websocket , context_id , url_bad_ssl , test_headless_mode ):
331
363
"""
332
364
The test exploits the fact that the file picker dialog can't be opened
333
365
twice. This is used as an indicator that the dialog was shown.
@@ -336,7 +368,7 @@ async def test_file_dialog_unhandled_prompt_behavior_show_file_ignore(
336
368
pytest .xfail ("Headless browser always cancels the file dialog" )
337
369
return
338
370
339
- await goto_url (websocket , context_id , url_example )
371
+ await goto_url (websocket , context_id , url_bad_ssl )
340
372
341
373
resp = await execute_command (
342
374
websocket , {
0 commit comments