diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php index e02e0df..fa2d541 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php @@ -48,13 +48,10 @@ public function testSessionExpiration() { // number of times. $this->drupalGet(''); - $session_assert = $this->assertSession(); - $page = $this->getSession()->getPage(); for ($i = 0; $i < 25; $i++) { $page->clickLink('Link to front page'); - $session_assert->statusCodeEquals(200); } } diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php index 81d379f..94b5d4c 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -366,4 +366,60 @@ function t(r, lx, ly) { return $this->session->evaluateScript($full_javascript_visibility_test); } + /** + * The use of statusCodeEquals() is not available. + * + * @param int $code + * The status code. + * + * @throws \Behat\Mink\Exception\UnsupportedDriverActionException + * Throws an exception on use. + */ + public function statusCodeEquals($code) { + throw new UnsupportedDriverActionException('The use of statusCodeEquals() is not available in a functional JavaScript test.'); + } + + /** + * The use of statusCodeNotEquals() is not available. + * + * @param int $code + * The status code. + * + * @throws \Behat\Mink\Exception\UnsupportedDriverActionException + * Throws an exception on use. + */ + public function statusCodeNotEquals($code) { + throw new UnsupportedDriverActionException('The use of statusCodeNotEquals() is not available in a functional JavaScript test.'); + } + + /** + * The use of responseHeaderEquals() is not available. + * + * @param string $name + * The name of the header. + * @param string $value + * The value to check the header against. + * + * @throws \Behat\Mink\Exception\UnsupportedDriverActionException + * Throws an exception on use. + */ + public function responseHeaderEquals($name, $value) { + throw new UnsupportedDriverActionException('The use of responseHeaderEquals() is not available in a functional JavaScript test.'); + } + + /** + * The use of responseHeaderNotEquals() is not available. + * + * @param string $name + * The name of the header. + * @param string $value + * The value to check the header against. + * + * @throws \Behat\Mink\Exception\UnsupportedDriverActionException + * Throws an exception on use. + */ + public function responseHeaderNotEquals($name, $value) { + throw new UnsupportedDriverActionException('The use of responseHeaderNotEquals() is not available in a functional JavaScript test.'); + } + } diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index 754f9d9..77753c9 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -714,7 +714,6 @@ protected function drupalLogin(AccountInterface $account) { } $this->drupalGet('user/login'); - $this->assertSession()->statusCodeEquals(200); $this->submitForm([ 'name' => $account->getUsername(), 'pass' => $account->passRaw, @@ -739,7 +738,6 @@ protected function drupalLogout() { // screen. $assert_session = $this->assertSession(); $this->drupalGet('user/logout', ['query' => ['destination' => 'user']]); - $assert_session->statusCodeEquals(200); $assert_session->fieldExists('name'); $assert_session->fieldExists('pass');