Skip to content

Commit

Permalink
Test switching to missing window
Browse files Browse the repository at this point in the history
  • Loading branch information
uuf6429 committed Jan 5, 2025
1 parent 387f66f commit 5e3fa67
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Js/WindowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');
}
}

0 comments on commit 5e3fa67

Please sign in to comment.