diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php index c6ea4ec7dbad3a0d2bc22982fde9c487646e2540..ce0f185ecb3f72bcc524acd21747943910472cf1 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceTestBase.php @@ -123,7 +123,6 @@ public function doTestCreateMediaType($media_type_id, $source_id, array $provide // Save the form to create the type. $page->pressButton('Save'); - $assert_session->statusCodeEquals(200); $assert_session->pageTextContains('The media type ' . $media_type_id . ' has been added.'); $this->drupalGet('admin/structure/media'); $assert_session->pageTextContains($media_type_id); diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php index 38a6227440aae5ce65aaf8573b4a27e324a11dd0..981da61d59abe21dcc6c71776fdb5adc48d265d2 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaUiJavascriptTest.php @@ -54,7 +54,6 @@ public function testMediaTypes() { $assert_session = $this->assertSession(); $this->drupalGet('admin/structure/media'); - $assert_session->statusCodeEquals(200); $assert_session->pageTextContains('No media types available. Add media type.'); $assert_session->linkExists('Add media type'); @@ -69,10 +68,8 @@ public function testMediaTypes() { $this->assertJsCondition("jQuery('.form-item-source-configuration-test-config-value').length > 0;"); $page->fillField('description', $description); $page->pressButton('Save'); - $assert_session->statusCodeEquals(200); $assert_session->pageTextContains('The media type ' . $name . ' has been added.'); $this->drupalGet('admin/structure/media'); - $assert_session->statusCodeEquals(200); $assert_session->pageTextContains($name); $assert_session->pageTextContains($description); @@ -142,7 +139,7 @@ public function testMediaTypes() { $page->uncheckField('options[status]'); $page->checkField('options[queue_thumbnail_downloads]'); $page->pressButton('Save'); - $assert_session->statusCodeEquals(200); + $assert_session->pageTextContains("The media type $new_name has been updated."); // Test if edit worked and if new field values have been saved as expected. $this->drupalGet('admin/structure/media/manage/' . $this->testMediaType->id()); diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Core/Session/SessionTest.php index e02e0dfb0f02afe47c26f8cf1c6386692fd941e3..fa2d541c8a8b18f1e0ce24865a3198c4632f48eb 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/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php index d5156eeb5cb6d469b59478f846b3a5644111df23..8aa46c7ec1a3a47c82b5634cbe9ad0ef9c6aea36 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -7,7 +7,7 @@ use Zumba\Mink\Driver\PhantomJSDriver; /** - * Runs a browser test using PhantomJS. + * Runs a browser test using a driver that supports Javascript. * * Base class for testing browser interaction implemented in JavaScript. */ @@ -142,7 +142,7 @@ protected function createScreenshot($filename, $set_background_color = TRUE) { * {@inheritdoc} */ public function assertSession($name = NULL) { - return new JSWebAssert($this->getSession($name), $this->baseUrl); + return new WebDriverWebAssert($this->getSession($name), $this->baseUrl); } /** diff --git a/core/tests/Drupal/FunctionalJavascriptTests/LegacyJavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/LegacyJavascriptTestBase.php new file mode 100644 index 0000000000000000000000000000000000000000..7cef5b8c6c37436e8c66bf2d981765bd7779bc43 --- /dev/null +++ b/core/tests/Drupal/FunctionalJavascriptTests/LegacyJavascriptTestBase.php @@ -0,0 +1,20 @@ +getSession($name), $this->baseUrl); + } + +} diff --git a/core/tests/Drupal/FunctionalJavascriptTests/WebDriverWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverWebAssert.php new file mode 100644 index 0000000000000000000000000000000000000000..16b1281d4d8be0062bae40374e1683ad4043a07b --- /dev/null +++ b/core/tests/Drupal/FunctionalJavascriptTests/WebDriverWebAssert.php @@ -0,0 +1,58 @@ +drupalGet('user/login'); - $this->assertSession()->statusCodeEquals(200); $this->submitForm([ 'name' => $account->getUsername(), 'pass' => $account->passRaw, @@ -761,7 +760,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');