function JSWebAssert::statusMessageNotExistsAfterWait

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::statusMessageNotExistsAfterWait()
  2. 11.x core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php \Drupal\FunctionalJavascriptTests\JSWebAssert::statusMessageNotExistsAfterWait()

Asserts that a status message does not exist after wait.

Parameters

string|null $type: The optional message type: status, error, or warning.

int $timeout: Optional timeout in milliseconds, defaults to 10000.

File

core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php, line 618

Class

JSWebAssert
Defines a class with methods for asserting presence of elements during tests.

Namespace

Drupal\FunctionalJavascriptTests

Code

public function statusMessageNotExistsAfterWait(?string $type = NULL, int $timeout = 10000) : void {
    $selector = $this->buildJavascriptStatusMessageSelector(NULL, $type);
    $status_message_element = $this->waitForElement('xpath', $selector, $timeout);
    if ($type) {
        $failure_message = sprintf('A status message of type "%s" appears on this page, but it should not.', $type);
    }
    else {
        $failure_message = 'A status message appears on this page, but it should not.';
    }
    Assert::assertThat($status_message_element, Assert::isNull(), $failure_message);
}

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