diff --git a/tests/Js/WindowTest.php b/tests/Js/WindowTest.php index 2a526ba..fc6b697 100644 --- a/tests/Js/WindowTest.php +++ b/tests/Js/WindowTest.php @@ -2,6 +2,7 @@ namespace Behat\Mink\Tests\Driver\Js; +use Behat\Mink\Exception\DriverException; use Behat\Mink\Tests\Driver\TestCase; final class WindowTest extends TestCase @@ -108,4 +109,14 @@ public function testWindowMaximize(): void $this->assertLessThanOrEqual(100, $session->evaluateScript($script)); } + + public function testSwitchingToMissingWindow(): void + { + $this->getSession()->visit($this->pathTo('/window.html')); + $session = $this->getSession(); + + $this->expectException(DriverException::class); + + $session->switchToWindow('inexistent_window'); + } }