diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php index fa2d541c8a8b18f1e0ce24865a3198c4632f48eb..e02e0dfb0f02afe47c26f8cf1c6386692fd941e3 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php @@ -48,10 +48,13 @@ public function testSessionExpiration() { // number of times. $this->drupalGet('<front>'); + $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 94b5d4cec987a8aa5017fc9addcbb20519f4ca63..81d379f915bf82e5182a7e7b73d9f5f2108f38ec 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -366,60 +366,4 @@ 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 533e974512dffff72a67d1bc7a34170cc35ce456..5751368f615c1d906c005da607939652b83b92ba 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -715,6 +715,7 @@ protected function drupalLogin(AccountInterface $account) { } $this->drupalGet('user/login'); + $this->assertSession()->statusCodeEquals(200); $this->submitForm([ 'name' => $account->getUsername(), 'pass' => $account->passRaw, @@ -739,6 +740,7 @@ 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');