Skip to content

Commit afd1e9d

Browse files
authored
Merge pull request #101 from uuf6429/feature/test-switching-to-missing-window
Test switching to missing window
2 parents c9909d5 + 5e3fa67 commit afd1e9d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/Js/WindowTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Behat\Mink\Tests\Driver\Js;
44

5+
use Behat\Mink\Exception\DriverException;
56
use Behat\Mink\Tests\Driver\TestCase;
67

78
final class WindowTest extends TestCase
@@ -108,4 +109,14 @@ public function testWindowMaximize(): void
108109

109110
$this->assertLessThanOrEqual(100, $session->evaluateScript($script));
110111
}
112+
113+
public function testSwitchingToMissingWindow(): void
114+
{
115+
$this->getSession()->visit($this->pathTo('/window.html'));
116+
$session = $this->getSession();
117+
118+
$this->expectException(DriverException::class);
119+
120+
$session->switchToWindow('inexistent_window');
121+
}
111122
}

0 commit comments

Comments
 (0)