Class Matchers

java.lang.Object
org.jenkinsci.test.acceptance.Matchers

public class Matchers extends Object
Hamcrest matchers.
Author:
Kohsuke Kawaguchi
  • Field Details

  • Constructor Details

    • Matchers

      public Matchers()
  • Method Details

    • hasContent

      public static Matcher<org.openqa.selenium.WebDriver> hasContent(String content)
      Asserts that given text is shown on page.
    • hasContent

      public static Matcher<org.openqa.selenium.WebDriver> hasContent(Pattern pattern)
    • hasElement

      public static Matcher<org.openqa.selenium.WebDriver> hasElement(org.openqa.selenium.By selector)
      Matches that matches WebDriver when it has an element that matches to the given selector.
    • hasURL

      public static Matcher<org.openqa.selenium.WebDriver> hasURL(URL url)
    • hasAction

      public static Matcher<PageObject> hasAction(String displayName)
      For asserting that a PageObject's top page has an action of the given name.
    • containsRegexp

      public static Matcher<String> containsRegexp(String regexp)
    • containsRegexp

      public static Matcher<String> containsRegexp(String regexp, int opts)
      Matches if a string contains a portion that matches to the regular expression.
    • containsString

      public static org.hamcrest.Matcher<String> containsString(String format, Object... args)
      Matches the specified formatted string.
      Parameters:
      format - A format string
      args - Arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and may be zero. The maximum number of arguments is limited by the maximum dimension of a Java array as defined by The Java™ Virtual Machine Specification. The behaviour on a null argument depends on the conversion.
      Returns:
      the matcher
    • containsRegexp

      public static Matcher<String> containsRegexp(Pattern re)
      Matches if a string contains a portion that matches to the regular expression.
    • pageObjectExists

      public static Matcher<PageObject> pageObjectExists()
    • pageObjectDoesNotExist

      public static Matcher<PageObject> pageObjectDoesNotExist()
    • hasLoggedInUser

      public static Matcher<Jenkins> hasLoggedInUser(String user)
    • loggedInAs

      public static Matcher<Login> loggedInAs(String user)
    • hasInvalidLoginInformation

      public static Matcher<Login> hasInvalidLoginInformation()
    • isMemberOf

      public static Matcher<User> isMemberOf(String group)
    • fullNameIs

      public static Matcher<User> fullNameIs(String fullName)
    • mailAddressIs

      public static Matcher<User> mailAddressIs(String mail)
    • existingFile

      public static Matcher<File> existingFile()