You are here

public function JavascriptEvaluationTest::testExecuteScript 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::testExecuteScript()

@dataProvider provideExecutedScript

File

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

Class

JavascriptEvaluationTest

Namespace

Behat\Mink\Tests\Driver\Js

Code

public function testExecuteScript($script) {
  $this
    ->getSession()
    ->visit($this
    ->pathTo('/index.html'));
  $this
    ->getSession()
    ->executeScript($script);
  sleep(1);
  $heading = $this
    ->getAssertSession()
    ->elementExists('css', 'h1');
  $this
    ->assertEquals('Hello world', $heading
    ->getText());
}