buildJavascriptStatusMessageSelector example



  /** * Asserts that a status message exists after wait. * * @param string|null $type * The optional message type: status, error, or warning. * @param int $timeout * Optional timeout in milliseconds, defaults to 10000. */
  public function statusMessageExistsAfterWait(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" does not appear on this page, but it should.', $type);
    }
    else {
      $failure_message = 'A status message does not appear on this page, but it should.';
    }
    // There is no Assert::isNotNull() method, so we make our own constraint.     $constraint = new LogicalNot(new IsNull());
    Assert::assertThat($status_message_element$constraint$failure_message);
  }

  
Home | Imprint | This part of the site doesn't use cookies.