diff -u b/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php --- b/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -643,6 +643,8 @@ // Replace original page output with new output from redirected page(s). if ($new = $this->checkForMetaRefresh()) { $out = $new; + // We are finished with all meta refresh redirects, so reset the counter. + $this->metaRefreshCount = 0; } // Log only for JavascriptTestBase tests because for Goutte we log with @@ -818,16 +820,16 @@ // Ensure that any changes to variables in the other thread are picked up. $this->refreshVariables(); + // Check if there are any meta refresh redirects (like Batch API pages). + if ($this->checkForMetaRefresh()) { + // We are finished with all meta refresh redirects, so reset the counter. + $this->metaRefreshCount = 0; + } + // Log only for JavascriptTestBase tests because for Goutte we log with // ::getResponseLogHandler. if ($this->htmlOutputEnabled && !($this->getSession()->getDriver() instanceof GoutteDriver)) { $out = $this->getSession()->getPage()->getContent(); - - // Replace original page output with new output from redirected page(s). - if ($new = $this->checkForMetaRefresh()) { - $out = $new; - } - $html_output = 'POST request to: ' . $action . '