function AjaxWaitTest::testUnnecessaryWait

Same name in other branches
  1. 10 core/tests/Drupal/FunctionalJavascriptTests/AjaxWaitTest.php \Drupal\FunctionalJavascriptTests\AjaxWaitTest::testUnnecessaryWait()

Tests that an unnecessary wait triggers an error.

File

core/tests/Drupal/FunctionalJavascriptTests/AjaxWaitTest.php, line 23

Class

AjaxWaitTest
Tests that unnecessary or untracked XHRs will cause a test failure.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function testUnnecessaryWait() : void {
    $this->drupalGet('user');
    $this->expectException(\RuntimeException::class);
    $this->expectExceptionMessage('There are no AJAX requests to wait for.');
    $this->assertSession()
        ->assertWaitOnAjaxRequest(500);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.