Class Matchers


  • public class Matchers
    extends Object
    Hamcrest matchers.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • Matchers

        public Matchers()
    • Method Detail

      • 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)
      • 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.
      • pageObjectDoesNotExist

        public static Matcher<PageObject> pageObjectDoesNotExist()
      • hasInvalidLoginInformation

        public static Matcher<Login> hasInvalidLoginInformation()
      • existingFile

        public static Matcher<File> existingFile()