You are here

public function WindowTest::testGetWindowNames in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/driver-testsuite/tests/Js/WindowTest.php \Behat\Mink\Tests\Driver\Js\WindowTest::testGetWindowNames()

File

vendor/behat/mink/driver-testsuite/tests/Js/WindowTest.php, line 38

Class

WindowTest

Namespace

Behat\Mink\Tests\Driver\Js

Code

public function testGetWindowNames() {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('/window.html'));
  $session = $this
    ->getSession();
  $page = $session
    ->getPage();
  $windowName = $this
    ->getSession()
    ->getWindowName();
  $this
    ->assertNotNull($windowName);
  $page
    ->clickLink('Popup #1');
  $page
    ->clickLink('Popup #2');
  $windowNames = $this
    ->getSession()
    ->getWindowNames();
  $this
    ->assertNotNull($windowNames[0]);
  $this
    ->assertNotNull($windowNames[1]);
  $this
    ->assertNotNull($windowNames[2]);
}