Mercurial > hg > isophonics-drupal-site
annotate vendor/behat/mink-selenium2-driver/tests/Custom/TimeoutTest.php @ 19:fa3358dc1485 tip
Add ndrum files
author | Chris Cannam |
---|---|
date | Wed, 28 Aug 2019 13:14:47 +0100 |
parents | 129ea1e6d783 |
children |
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@17 | 14 $this->getSession()->start(); |
Chris@17 | 15 |
Chris@14 | 16 $this->getSession()->getDriver()->setTimeouts(array('invalid' => 0)); |
Chris@14 | 17 } |
Chris@14 | 18 |
Chris@14 | 19 public function testShortTimeoutDoesNotWaitForElementToAppear() |
Chris@14 | 20 { |
Chris@14 | 21 $this->getSession()->getDriver()->setTimeouts(array('implicit' => 0)); |
Chris@14 | 22 |
Chris@14 | 23 $this->getSession()->visit($this->pathTo('/js_test.html')); |
Chris@14 | 24 $this->findById('waitable')->click(); |
Chris@14 | 25 |
Chris@14 | 26 $element = $this->getSession()->getPage()->find('css', '#waitable > div'); |
Chris@14 | 27 |
Chris@14 | 28 $this->assertNull($element); |
Chris@14 | 29 } |
Chris@14 | 30 |
Chris@14 | 31 public function testLongTimeoutWaitsForElementToAppear() |
Chris@14 | 32 { |
Chris@14 | 33 $this->getSession()->getDriver()->setTimeouts(array('implicit' => 5000)); |
Chris@14 | 34 |
Chris@14 | 35 $this->getSession()->visit($this->pathTo('/js_test.html')); |
Chris@14 | 36 $this->findById('waitable')->click(); |
Chris@14 | 37 $element = $this->getSession()->getPage()->find('css', '#waitable > div'); |
Chris@14 | 38 |
Chris@14 | 39 $this->assertNotNull($element); |
Chris@14 | 40 } |
Chris@14 | 41 } |