You are here

public function JavascriptEvaluationTest::testWait in Zircon Profile 8.0

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

File

vendor/behat/mink/driver-testsuite/tests/Js/JavascriptEvaluationTest.php, line 20

Class

JavascriptEvaluationTest

Namespace

Behat\Mink\Tests\Driver\Js

Code

public function testWait() {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('/js_test.html'));
  $waitable = $this
    ->findById('waitable');
  $waitable
    ->click();
  $this
    ->getSession()
    ->wait(3000, '$("#waitable").has("div").length > 0');
  $this
    ->assertEquals('arrived', $this
    ->getAssertSession()
    ->elementExists('css', '#waitable > div')
    ->getText());
  $waitable
    ->click();
  $this
    ->getSession()
    ->wait(3000, 'false');
  $this
    ->assertEquals('timeout', $this
    ->getAssertSession()
    ->elementExists('css', '#waitable > div')
    ->getText());
}