comparison vendor/behat/mink-selenium2-driver/tests/Custom/WindowNameTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
4 4
5 use Behat\Mink\Tests\Driver\TestCase; 5 use Behat\Mink\Tests\Driver\TestCase;
6 6
7 class WindowNameTest extends TestCase 7 class WindowNameTest extends TestCase
8 { 8 {
9 const WINDOW_NAME_REGEXP = '/(?:[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}|^\d++$)/i'; 9 public function testWindowNames()
10
11 public function testPatternGetWindowNames()
12 { 10 {
13 $session = $this->getSession(); 11 $session = $this->getSession();
12 $session->start();
14 13
15 $windowNames = $session->getWindowNames(); 14 $windowNames = $session->getWindowNames();
16 $this->assertArrayHasKey(0, $windowNames); 15 $this->assertArrayHasKey(0, $windowNames);
17 16
18 foreach ($windowNames as $name) { 17 $windowName = $session->getWindowName();
19 $this->assertRegExp(self::WINDOW_NAME_REGEXP, $name);
20 }
21 }
22 18
23 public function testGetWindowName() 19 $this->assertInternalType('string', $windowName);
24 { 20 $this->assertContains($windowName, $windowNames, 'The current window name is one of the available window names.');
25 $session = $this->getSession();
26
27 $this->assertRegExp(self::WINDOW_NAME_REGEXP, $session->getWindowName());
28 } 21 }
29 } 22 }