function JavascriptErrorsTest::clearErrorLog

Same name in other branches
  1. 11.x core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsTest.php \Drupal\FunctionalJavascriptTests\JavascriptErrorsTest::clearErrorLog()

Clear the JavaScript error log to prevent this test failing for real.

@postCondition

File

core/tests/Drupal/FunctionalJavascriptTests/JavascriptErrorsTest.php, line 66

Class

JavascriptErrorsTest
Tests that Drupal.throwError will cause a test failure.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function clearErrorLog() {
    $this->getSession()
        ->executeScript("sessionStorage.removeItem('js_testing_log_test.errors')");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.