Package org.jenkinsci.test.acceptance
Class Matchers
- java.lang.Object
-
- org.jenkinsci.test.acceptance.Matchers
-
public class Matchers extends Object
Hamcrest matchers.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description Matchers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Matcher<String>
containsRegexp(String regexp)
static Matcher<String>
containsRegexp(String regexp, int opts)
Matches if a string contains a portion that matches to the regular expression.static Matcher<String>
containsRegexp(Pattern re)
Matches if a string contains a portion that matches to the regular expression.static org.hamcrest.Matcher<String>
containsString(String format, Object... args)
Matches the specified formatted string.static Matcher<File>
existingFile()
static Matcher<User>
fullNameIs(String fullName)
static Matcher<PageObject>
hasAction(String displayName)
For asserting that aPageObject
's top page has an action of the given name.static Matcher<org.openqa.selenium.WebDriver>
hasContent(String content)
Asserts that given text is shown on page.static Matcher<org.openqa.selenium.WebDriver>
hasContent(Pattern pattern)
static Matcher<org.openqa.selenium.WebDriver>
hasElement(org.openqa.selenium.By selector)
Matches that matchesWebDriver
when it has an element that matches to the given selector.static Matcher<Login>
hasInvalidLoginInformation()
static Matcher<Jenkins>
hasLoggedInUser(String user)
static Matcher<org.openqa.selenium.WebDriver>
hasURL(URL url)
static Matcher<User>
isMemberOf(String group)
static Matcher<Login>
loggedInAs(String user)
static Matcher<User>
mailAddressIs(String mail)
static Matcher<PageObject>
pageObjectDoesNotExist()
static Matcher<PageObject>
pageObjectExists()
-
-
-
Field Detail
-
by
public static final ByFactory by
-
-
Method Detail
-
hasContent
public static Matcher<org.openqa.selenium.WebDriver> hasContent(String content)
Asserts that given text is shown on page.
-
hasElement
public static Matcher<org.openqa.selenium.WebDriver> hasElement(org.openqa.selenium.By selector)
Matches that matchesWebDriver
when it has an element that matches to the given selector.
-
hasAction
public static Matcher<PageObject> hasAction(String displayName)
For asserting that aPageObject
's top page has an action of the given name.
-
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 stringargs
- 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 anull
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()
-
-