diff --git a/tests/Custom/TimeoutTest.php b/tests/Custom/TimeoutTest.php index 0bcbec6..5b381c2 100644 --- a/tests/Custom/TimeoutTest.php +++ b/tests/Custom/TimeoutTest.php @@ -4,6 +4,7 @@ use Behat\Mink\Exception\DriverException; use Behat\Mink\Tests\Driver\TestCase; +use Mink\WebdriverClassicDriver\Tests\WebdriverClassicConfig; use Mink\WebdriverClassicDriver\WebdriverClassicDriver; use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; @@ -89,19 +90,19 @@ public function testShortPageLoadTimeoutThrowsException(): void */ public function testDeprecatedShortPageLoadTimeoutThrowsException(string $type): void { - $this->markTestSkipped('Temporary; checking build failures'); - - $session = $this->getSession(); - $driver = $session->getDriver(); - \assert($driver instanceof WebdriverClassicDriver); - - $driver->setTimeouts([$type => 500]); - - $this->expectDeprecation('Using "' . $type . '" timeout type is deprecated, please use "page" instead'); - $this->expectException(DriverException::class); - $this->expectExceptionMessage('Page failed to load: '); - - $session->visit($this->pathTo('/page_load.php?sleep=2')); + $driver = WebdriverClassicConfig::getInstance()->createDriver(); + $driver->start(); + + try { + $this->expectDeprecation('Using "' . $type . '" timeout type is deprecated, please use "page" instead'); + $driver->setTimeouts([$type => 500]); + + $this->expectException(DriverException::class); + $this->expectExceptionMessage('Page failed to load: '); + $driver->visit($this->pathTo('/page_load.php?sleep=2')); + } finally { + $driver->stop(); + } } public static function deprecatedPageLoadDataProvider(): iterable