@@ -350,15 +350,10 @@ public function testSubmitForm(callable $clientFactory): void
350
350
]);
351
351
352
352
$ crawler = $ client ->submit ($ form );
353
+ $ this ->assertInstanceOf (DomCrawlerCrawler::class, $ crawler );
353
354
if ($ client instanceof Client) {
354
- try {
355
- $ crawler = $ client ->waitFor ('#result ' );
356
- } catch (TimeoutException ) {
357
- $ this ->markTestSkipped ('Test skipped if no result after 30 seconds to prevent inconsistent fail on CI ' );
358
- }
359
355
$ this ->assertInstanceOf (Crawler::class, $ crawler );
360
356
}
361
- $ this ->assertInstanceOf (DomCrawlerCrawler::class, $ crawler );
362
357
$ this ->assertSame (self ::$ baseUri .'/form-handle.php ' , $ crawler ->getUri ());
363
358
$ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text (null , true ));
364
359
@@ -368,13 +363,6 @@ public function testSubmitForm(callable $clientFactory): void
368
363
]);
369
364
370
365
$ crawler = $ client ->submit ($ form );
371
- if ($ client instanceof Client) {
372
- try {
373
- $ crawler = $ client ->waitFor ('#result ' );
374
- } catch (TimeoutException ) {
375
- $ this ->markTestSkipped ('Test skipped if no result after 30 seconds to prevent inconsistent fail on CI ' );
376
- }
377
- }
378
366
$ this ->assertSame (self ::$ baseUri .'/form-handle.php?i1=Michel&i2=&i3=&i4=i4a ' , $ crawler ->getUri ());
379
367
380
368
try {
@@ -395,7 +383,7 @@ public function testSubmitForm(callable $clientFactory): void
395
383
/**
396
384
* @dataProvider clientFactoryProvider
397
385
*/
398
- public function testSubmitFormWithValues (callable $ clientFactory ): void
386
+ public function testSubmitFormWithValues (callable $ clientFactory, string $ type ): void
399
387
{
400
388
/** @var AbstractBrowser $client */
401
389
$ client = $ clientFactory ();
@@ -405,15 +393,10 @@ public function testSubmitFormWithValues(callable $clientFactory): void
405
393
$ crawler = $ client ->submit ($ form , [
406
394
'i1 ' => 'Reclus ' ,
407
395
]);
408
- if ($ client instanceof Client) {
409
- try {
410
- $ crawler = $ client ->waitFor ('#result ' );
411
- } catch (TimeoutException ) {
412
- $ this ->markTestSkipped ('Test skipped if no result after 30 seconds to prevent inconsistent fail on CI ' );
413
- }
396
+ $ this ->assertInstanceOf (DomCrawlerCrawler::class, $ crawler );
397
+ if (Client::class === $ type ) {
414
398
$ this ->assertInstanceOf (Crawler::class, $ crawler );
415
399
}
416
- $ this ->assertInstanceOf (DomCrawlerCrawler::class, $ crawler );
417
400
$ this ->assertSame (self ::$ baseUri .'/form-handle.php ' , $ crawler ->getUri ());
418
401
$ this ->assertSame ('I1: Reclus ' , $ crawler ->filter ('#result ' )->text (null , true ));
419
402
}
0 commit comments