Mercurial > hg > isophonics-drupal-site
annotate vendor/behat/mink-selenium2-driver/tests/Custom/TimeoutTest.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children | 129ea1e6d783 |
rev | line source |
---|---|
Chris@14 | 1 <?php |
Chris@14 | 2 |
Chris@14 | 3 namespace Behat\Mink\Tests\Driver\Custom; |
Chris@14 | 4 |
Chris@14 | 5 use Behat\Mink\Tests\Driver\TestCase; |
Chris@14 | 6 |
Chris@14 | 7 class TimeoutTest extends TestCase |
Chris@14 | 8 { |
Chris@14 | 9 /** |
Chris@14 | 10 * @expectedException \Behat\Mink\Exception\DriverException |
Chris@14 | 11 */ |
Chris@14 | 12 public function testInvalidTimeoutSettingThrowsException() |
Chris@14 | 13 { |
Chris@14 | 14 $this->getSession()->getDriver()->setTimeouts(array('invalid' => 0)); |
Chris@14 | 15 } |
Chris@14 | 16 |
Chris@14 | 17 public function testShortTimeoutDoesNotWaitForElementToAppear() |
Chris@14 | 18 { |
Chris@14 | 19 $this->getSession()->getDriver()->setTimeouts(array('implicit' => 0)); |
Chris@14 | 20 |
Chris@14 | 21 $this->getSession()->visit($this->pathTo('/js_test.html')); |
Chris@14 | 22 $this->findById('waitable')->click(); |
Chris@14 | 23 |
Chris@14 | 24 $element = $this->getSession()->getPage()->find('css', '#waitable > div'); |
Chris@14 | 25 |
Chris@14 | 26 $this->assertNull($element); |
Chris@14 | 27 } |
Chris@14 | 28 |
Chris@14 | 29 public function testLongTimeoutWaitsForElementToAppear() |
Chris@14 | 30 { |
Chris@14 | 31 $this->getSession()->getDriver()->setTimeouts(array('implicit' => 5000)); |
Chris@14 | 32 |
Chris@14 | 33 $this->getSession()->visit($this->pathTo('/js_test.html')); |
Chris@14 | 34 $this->findById('waitable')->click(); |
Chris@14 | 35 $element = $this->getSession()->getPage()->find('css', '#waitable > div'); |
Chris@14 | 36 |
Chris@14 | 37 $this->assertNotNull($element); |
Chris@14 | 38 } |
Chris@14 | 39 } |