public class CustomMatchers extends Object
| Constructor and Description |
|---|
CustomMatchers() |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<Path> |
hasText(String text)
Successful if element has the text equal to the given parameter in the browser/document.
|
static org.hamcrest.Matcher<Path> |
isAbsent()
Successful if the browser has no elements that correspond to the given path.
|
static org.hamcrest.Matcher<Path> |
isDisplayed()
Successful if given element is present and displayed in the browser.
|
static org.hamcrest.Matcher<Path> |
isEnabled()
Successful if given element is present and enabled in the browser.
|
static org.hamcrest.Matcher<Path> |
isNotDisplayed()
Successful if given element is present and displayed in the browser.
|
static org.hamcrest.Matcher<Path> |
isPresent()
Successful if the the element is present in the browser.
|
static IsPresentNTimes |
isPresent(int nTimes)
Successful if the the element appears the expected number of times in the browser.
|
static org.hamcrest.Matcher<Path> |
isSelected()
Successful if given element is present and selected in the browser.
|
public static IsPresentNTimes isPresent(int nTimes)
assertThat( path, ispresent(5).timesOrMore());
assertThat( path, ispresent(5).times());
assertThat( path, ispresent(5).timesOrLess());
nTimes - - the reference number of times to be matched against. See examples.public static org.hamcrest.Matcher<Path> isPresent()
assertThat( path, ispresent()); public static org.hamcrest.Matcher<Path> hasText(String text)
assertThat( path, hasText("John"));
text - the text to equal to (case insensitive)public static org.hamcrest.Matcher<Path> isDisplayed()
assertThat( path, isDisplayed()); public static org.hamcrest.Matcher<Path> isNotDisplayed()
assertThat( path, isNotDisplayed()); public static org.hamcrest.Matcher<Path> isSelected()
assertThat( path, isSelected()); public static org.hamcrest.Matcher<Path> isEnabled()
assertThat( path, isEnabled()); public static org.hamcrest.Matcher<Path> isAbsent()
assertThat( path, isAbsent()); Copyright © 2018. All rights reserved.