3 namespace Behat\Mink\Tests\Driver\Custom;
5 use Behat\Mink\Tests\Driver\TestCase;
7 class TimeoutTest extends TestCase
10 * @expectedException \Behat\Mink\Exception\DriverException
12 public function testInvalidTimeoutSettingThrowsException()
14 $this->getSession()->getDriver()->setTimeouts(array('invalid' => 0));
17 public function testShortTimeoutDoesNotWaitForElementToAppear()
19 $this->getSession()->getDriver()->setTimeouts(array('implicit' => 0));
21 $this->getSession()->visit($this->pathTo('/js_test.html'));
22 $this->findById('waitable')->click();
24 $element = $this->getSession()->getPage()->find('css', '#waitable > div');
26 $this->assertNull($element);
29 public function testLongTimeoutWaitsForElementToAppear()
31 $this->getSession()->getDriver()->setTimeouts(array('implicit' => 5000));
33 $this->getSession()->visit($this->pathTo('/js_test.html'));
34 $this->findById('waitable')->click();
35 $element = $this->getSession()->getPage()->find('css', '#waitable > div');
37 $this->assertNotNull($element);