@@ -184,6 +184,7 @@ test("can upload a file with createFileUploadHandler", async ({ page }) => {
184
184
await app . goto ( "/file-upload-handler" ) ;
185
185
await app . uploadFile ( "#file" , path . resolve ( __dirname , "assets/toupload.txt" ) ) ;
186
186
await app . clickSubmitButton ( "/file-upload-handler" ) ;
187
+ await page . waitForSelector ( "#message" ) ;
187
188
188
189
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">SUCCESS<" ) ;
189
190
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -200,6 +201,7 @@ test("can catch MaxPartSizeExceededError when file is too big with createFileUpl
200
201
path . resolve ( __dirname , "assets/touploadtoobig.txt" )
201
202
) ;
202
203
await app . clickSubmitButton ( "/file-upload-handler" ) ;
204
+ await page . waitForSelector ( "#message" ) ;
203
205
204
206
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">FILE_TOO_LARGE<" ) ;
205
207
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -210,6 +212,7 @@ test("can upload a file with createMemoryUploadHandler", async ({ page }) => {
210
212
await app . goto ( "/memory-upload-handler" ) ;
211
213
await app . uploadFile ( "#file" , path . resolve ( __dirname , "assets/toupload.txt" ) ) ;
212
214
await app . clickSubmitButton ( "/memory-upload-handler" ) ;
215
+ await page . waitForSelector ( "#message" ) ;
213
216
214
217
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">SUCCESS<" ) ;
215
218
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -220,6 +223,7 @@ test("can upload a file with a passthrough handler", async ({ page }) => {
220
223
await app . goto ( "/passthrough-upload-handler" ) ;
221
224
await app . uploadFile ( "#file" , path . resolve ( __dirname , "assets/toupload.txt" ) ) ;
222
225
await app . clickSubmitButton ( "/passthrough-upload-handler" ) ;
226
+ await page . waitForSelector ( "#message" ) ;
223
227
224
228
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">SUCCESS<" ) ;
225
229
} ) ;
@@ -234,6 +238,7 @@ test("can catch MaxPartSizeExceededError when file is too big with createMemoryU
234
238
path . resolve ( __dirname , "assets/touploadtoobig.txt" )
235
239
) ;
236
240
await app . clickSubmitButton ( "/memory-upload-handler" ) ;
241
+ await page . waitForSelector ( "#message" ) ;
237
242
238
243
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">FILE_TOO_LARGE<" ) ;
239
244
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -249,8 +254,8 @@ test.describe("without javascript", () => {
249
254
"#file" ,
250
255
path . resolve ( __dirname , "assets/toupload.txt" )
251
256
) ;
252
-
253
- await Promise . all ( [ page . click ( "#submit" ) , page . waitForNavigation ( ) ] ) ;
257
+ await page . click ( "#submit" ) ;
258
+ await page . waitForSelector ( "#message" ) ;
254
259
255
260
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">SUCCESS<" ) ;
256
261
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -265,8 +270,8 @@ test.describe("without javascript", () => {
265
270
"#file" ,
266
271
path . resolve ( __dirname , "assets/touploadtoobig.txt" )
267
272
) ;
268
-
269
- await Promise . all ( [ page . click ( "#submit" ) , page . waitForNavigation ( ) ] ) ;
273
+ await page . click ( "#submit" ) ;
274
+ await page . waitForSelector ( "#message" ) ;
270
275
271
276
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">FILE_TOO_LARGE<" ) ;
272
277
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -279,8 +284,8 @@ test.describe("without javascript", () => {
279
284
"#file" ,
280
285
path . resolve ( __dirname , "assets/toupload.txt" )
281
286
) ;
282
-
283
- await Promise . all ( [ page . click ( "#submit" ) , page . waitForNavigation ( ) ] ) ;
287
+ await page . click ( "#submit" ) ;
288
+ await page . waitForSelector ( "#message" ) ;
284
289
285
290
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">SUCCESS<" ) ;
286
291
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
@@ -293,8 +298,8 @@ test.describe("without javascript", () => {
293
298
"#file" ,
294
299
path . resolve ( __dirname , "assets/toupload.txt" )
295
300
) ;
296
-
297
- await Promise . all ( [ page . click ( "#submit" ) , page . waitForNavigation ( ) ] ) ;
301
+ await page . click ( "#submit" ) ;
302
+ await page . waitForSelector ( "#message" ) ;
298
303
299
304
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">SUCCESS<" ) ;
300
305
} ) ;
@@ -308,8 +313,8 @@ test.describe("without javascript", () => {
308
313
"#file" ,
309
314
path . resolve ( __dirname , "assets/touploadtoobig.txt" )
310
315
) ;
311
-
312
- await Promise . all ( [ page . click ( "#submit" ) , page . waitForNavigation ( ) ] ) ;
316
+ await page . click ( "#submit" ) ;
317
+ await page . waitForSelector ( "#message" ) ;
313
318
314
319
expect ( await app . getHtml ( "#message" ) ) . toMatch ( ">FILE_TOO_LARGE<" ) ;
315
320
expect ( await app . getHtml ( "#size" ) ) . toMatch ( ">13<" ) ;
0 commit comments