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'
@@ -191,13 +207,18 @@ async def test_file_dialog_unhandled_prompt_behavior_input_cancel(
191
207
192
208
193
209
@pytest .mark .asyncio
194
- @pytest .mark .parametrize ('capabilities' , [{}, {
210
+ @pytest .mark .parametrize ('capabilities' , [{
211
+ 'acceptInsecureCerts' : True
212
+ }, {
213
+ 'acceptInsecureCerts' : True ,
195
214
'unhandledPromptBehavior' : 'ignore'
196
215
}, {
216
+ 'acceptInsecureCerts' : True ,
197
217
'unhandledPromptBehavior' : {
198
218
'default' : 'ignore'
199
219
}
200
220
}, {
221
+ 'acceptInsecureCerts' : True ,
201
222
'unhandledPromptBehavior' : {
202
223
'file' : 'ignore' ,
203
224
'default' : 'dismiss'
@@ -251,34 +272,42 @@ async def test_file_dialog_unhandled_prompt_behavior_input_ignore(
251
272
@pytest .mark .asyncio
252
273
@pytest .mark .parametrize ('capabilities' , [
253
274
{
275
+ 'acceptInsecureCerts' : True ,
254
276
'unhandledPromptBehavior' : 'dismiss'
255
277
},
256
278
{
279
+ 'acceptInsecureCerts' : True ,
257
280
'unhandledPromptBehavior' : 'dismiss and notify'
258
281
},
259
282
{
283
+ 'acceptInsecureCerts' : True ,
260
284
'unhandledPromptBehavior' : {
261
285
'default' : 'dismiss'
262
286
}
263
287
},
264
288
{
289
+ 'acceptInsecureCerts' : True ,
265
290
'unhandledPromptBehavior' : {
266
291
'file' : 'dismiss' ,
267
292
'default' : 'ignore'
268
293
}
269
294
},
270
295
{
296
+ 'acceptInsecureCerts' : True ,
271
297
'unhandledPromptBehavior' : 'accept'
272
298
},
273
299
{
300
+ 'acceptInsecureCerts' : True ,
274
301
'unhandledPromptBehavior' : 'accept and notify'
275
302
},
276
303
{
304
+ 'acceptInsecureCerts' : True ,
277
305
'unhandledPromptBehavior' : {
278
306
'default' : 'accept'
279
307
}
280
308
},
281
309
{
310
+ 'acceptInsecureCerts' : True ,
282
311
'unhandledPromptBehavior' : {
283
312
'file' : 'accept' ,
284
313
'default' : 'ignore'
@@ -287,8 +316,8 @@ async def test_file_dialog_unhandled_prompt_behavior_input_ignore(
287
316
],
288
317
indirect = True )
289
318
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 )
319
+ websocket , context_id , url_bad_ssl ):
320
+ await goto_url (websocket , context_id , url_bad_ssl )
292
321
await subscribe (websocket , ["input.fileDialogOpened" ])
293
322
294
323
resp = await execute_command (
@@ -313,21 +342,26 @@ async def test_file_dialog_unhandled_prompt_behavior_show_file_cancel(
313
342
314
343
315
344
@pytest .mark .asyncio
316
- @pytest .mark .parametrize ('capabilities' , [{}, {
345
+ @pytest .mark .parametrize ('capabilities' , [{
346
+ 'acceptInsecureCerts' : True
347
+ }, {
348
+ 'acceptInsecureCerts' : True ,
317
349
'unhandledPromptBehavior' : 'ignore'
318
350
}, {
351
+ 'acceptInsecureCerts' : True ,
319
352
'unhandledPromptBehavior' : {
320
353
'default' : 'ignore'
321
354
}
322
355
}, {
356
+ 'acceptInsecureCerts' : True ,
323
357
'unhandledPromptBehavior' : {
324
358
'file' : 'ignore' ,
325
359
'default' : 'dismiss'
326
360
}
327
361
}],
328
362
indirect = True )
329
363
async def test_file_dialog_unhandled_prompt_behavior_show_file_ignore (
330
- websocket , context_id , url_example , test_headless_mode ):
364
+ websocket , context_id , url_bad_ssl , test_headless_mode ):
331
365
"""
332
366
The test exploits the fact that the file picker dialog can't be opened
333
367
twice. This is used as an indicator that the dialog was shown.
@@ -336,7 +370,7 @@ async def test_file_dialog_unhandled_prompt_behavior_show_file_ignore(
336
370
pytest .xfail ("Headless browser always cancels the file dialog" )
337
371
return
338
372
339
- await goto_url (websocket , context_id , url_example )
373
+ await goto_url (websocket , context_id , url_bad_ssl )
340
374
341
375
resp = await execute_command (
342
376
websocket , {
0 commit comments