Class HasElementNTimes
- java.lang.Object
-
- com.github.loyada.jdollarx.custommatchers.HasElementNTimes
-
public class HasElementNTimes extends Object
Internal implementation - not to be instantiated directly. This matcher is optimized for the success use-case. In that case it match for a single element with exact number of elements wanted. In case of failure, it will make another call to get the actual number of elements on the page, in order to provide a detailed error message. So the trade off is: In case of success it's faster, In case of failure it's slower. It makes sense since most of the time we expect success.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HasElementNTimes.NTimesMatcher
Internal implementation - not to be instantiated directly.
-
Constructor Summary
Constructors Constructor Description HasElementNTimes(Path path, int nTimes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hamcrest.Matcher<InBrowser>
times()
matches the exact number givenorg.hamcrest.Matcher<InBrowser>
timesOrLess()
matches the number given, or lessorg.hamcrest.Matcher<InBrowser>
timesOrMore()
matches the number given, or more
-
-
-
Constructor Detail
-
HasElementNTimes
public HasElementNTimes(Path path, int nTimes)
-
-
Method Detail
-
times
public org.hamcrest.Matcher<InBrowser> times()
matches the exact number given- Returns:
- a matcher
-
timesOrMore
public org.hamcrest.Matcher<InBrowser> timesOrMore()
matches the number given, or more- Returns:
- a matcher
-
timesOrLess
public org.hamcrest.Matcher<InBrowser> timesOrLess()
matches the number given, or less- Returns:
- a matcher
-
-