Skip to content

Commit bef6f1d

Browse files
committedJan 10, 2025·
Revert "test: add waitFor() calls in submit form tests to ensure crawler state (symfony#656)"
This reverts commit 1fb612b.
1 parent 1fb612b commit bef6f1d

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed
 

‎tests/ClientTest.php

+4-21
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,10 @@ public function testSubmitForm(callable $clientFactory): void
350350
]);
351351

352352
$crawler = $client->submit($form);
353+
$this->assertInstanceOf(DomCrawlerCrawler::class, $crawler);
353354
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-
}
359355
$this->assertInstanceOf(Crawler::class, $crawler);
360356
}
361-
$this->assertInstanceOf(DomCrawlerCrawler::class, $crawler);
362357
$this->assertSame(self::$baseUri.'/form-handle.php', $crawler->getUri());
363358
$this->assertSame('I1: Reclus', $crawler->filter('#result')->text(null, true));
364359

@@ -368,13 +363,6 @@ public function testSubmitForm(callable $clientFactory): void
368363
]);
369364

370365
$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-
}
378366
$this->assertSame(self::$baseUri.'/form-handle.php?i1=Michel&i2=&i3=&i4=i4a', $crawler->getUri());
379367

380368
try {
@@ -395,7 +383,7 @@ public function testSubmitForm(callable $clientFactory): void
395383
/**
396384
* @dataProvider clientFactoryProvider
397385
*/
398-
public function testSubmitFormWithValues(callable $clientFactory): void
386+
public function testSubmitFormWithValues(callable $clientFactory, string $type): void
399387
{
400388
/** @var AbstractBrowser $client */
401389
$client = $clientFactory();
@@ -405,15 +393,10 @@ public function testSubmitFormWithValues(callable $clientFactory): void
405393
$crawler = $client->submit($form, [
406394
'i1' => 'Reclus',
407395
]);
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) {
414398
$this->assertInstanceOf(Crawler::class, $crawler);
415399
}
416-
$this->assertInstanceOf(DomCrawlerCrawler::class, $crawler);
417400
$this->assertSame(self::$baseUri.'/form-handle.php', $crawler->getUri());
418401
$this->assertSame('I1: Reclus', $crawler->filter('#result')->text(null, true));
419402
}

0 commit comments

Comments
 (0)
Please sign in to comment.