diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php index 9388ec8..d104049 100644 --- a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php @@ -51,9 +51,6 @@ protected function setUp() { * Tests opening Offcanvas tray by click blocks and elements in the blocks. */ public function testBlocks() { - // @todo: re-enable once https://www.drupal.org/node/2830485 is resolved. - $this->markTestSkipped('Test skipped due to random failures in DrupalCI, see https://www.drupal.org/node/2830485'); - $web_assert = $this->assertSession(); $blocks = [ [ diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php index d5156ee..422d7f6 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php @@ -64,6 +64,19 @@ protected function tearDown() { } /** + * {@inheritdoc} + */ + protected function drupalGet($path, array $options = array(), array $headers = array()) { + $out = parent::drupalGet($path, $options, $headers); + + // When the page has been loaded wait until jQuery is done with all Ajax + // activity before any further actions are done on the page. + $this->assertSession()->assertWaitOnAjaxRequest(); + + return $out; + } + + /** * Asserts that the element with the given CSS selector is visible. * * @param string $css_selector diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index 1ab59b6..b756e11 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -906,9 +906,13 @@ protected function submitForm(array $edit, $submit, $form_html_id = NULL) { // Ensure that any changes to variables in the other thread are picked up. $this->refreshVariables(); - // Log only for JavascriptTestBase tests because for Goutte we log with - // ::getResponseLogHandler. + // Actions only for JavascriptTestBase. if ($this->htmlOutputEnabled && !($this->getSession()->getDriver() instanceof GoutteDriver)) { + // Wait on AJAX requests to finish which might have been triggered on load. + $this->assertSession()->assertWaitOnAjaxRequest(); + + // Log only for JavascriptTestBase tests because for Goutte we log with + // ::getResponseLogHandler. $out = $this->getSession()->getPage()->getContent(); $html_output = 'POST request to: ' . $action . '
Ending URL: ' . $this->getSession()->getCurrentUrl();