Class NeptuneFeatureMatcher<T>
- java.lang.Object
-
- ru.tinkoff.qa.neptune.core.api.steps.SelfDescribed
-
- ru.tinkoff.qa.neptune.core.api.hamcrest.NeptuneFeatureMatcher<T>
-
- Type Parameters:
T
- is a type of checked objects
- All Implemented Interfaces:
org.hamcrest.Matcher<T>
,org.hamcrest.SelfDescribing
- Direct Known Subclasses:
AbstractSetOfObjectsMatcher
,AlertHasTextMatcher
,AllCriteriaMatcher
,AnyMatcher
,AtThePageMatcher
,HasAttributeMatcher
,HasBody
,HasChildElementMatcher
,HasChildElementsMatcher
,HasContentMatcher
,HasCssValueMatcher
,HasHostMatcher
,HasLocationMatcher
,HasOptionsMatcher
,HasPathMatcher
,HasPortMatcher
,HasPreviousResponse
,HasProtocolMatcher
,HasQueryStringMatcher
,HasReference
,HasReferenceMatcher
,HasSchemeMatcher
,HasSizeMatcher
,HasStatusCode
,HasTableRowMatcher
,HasTextMatcher
,HasURI
,HasUserInfoMatcher
,HasValueMatcher
,HasVersion
,HttpTrafficHasVersionMatcher
,IsElementEnabledMatcher
,IsElementVisibleMatcher
,IsWindowPresentMatcher
,MapEntryMatcher
,MappedDiagnosticFeatureMatcher
,NotMatcher
,OfClassMatcher
,OnlyOneMatcher
,PojoGetterReturnsMatcher
,RequestHasMethod
,RequestHasUrl
,ResponseHasStatusCode
,StringContainsWithSeparator
,ThrowableIsCausedByMatcher
,ThrowableMessageMatcher
,WindowHasPositionMatcher
,WindowHasSizeMatcher
,WindowHasTitleMatcher
public abstract class NeptuneFeatureMatcher<T> extends SelfDescribed implements org.hamcrest.Matcher<T>
For matchers that check specific objects which are used/supported by Neptune. This is alternative toTypeSafeDiagnosingMatcher
andFeatureMatcher
-
-
Field Summary
Fields Modifier and Type Field Description protected Class<? extends T>[]
expectedTypes
protected boolean
isNullSafe
protected List<org.hamcrest.Description>
mismatchDescriptions
-
Constructor Summary
Constructors Modifier Constructor Description protected
NeptuneFeatureMatcher(boolean isNullSafe)
protected
NeptuneFeatureMatcher(boolean isNullSafe, Class<? extends T>... expectedTypes)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
_dont_implement_Matcher___instead_extend_BaseMatcher_()
protected void
appendMismatchDescription(org.hamcrest.Description description)
protected void
appendMismatchDescription(org.hamcrest.Matcher<?> matcher, Object o)
protected void
appendMismatchDescription(MismatchDescriber describer)
protected boolean
checkFeature(Object actual)
static String
concatMatcherDescriptions(String delimiter, org.hamcrest.Matcher<?>... matchers)
Concatenates descriptions of matchers into one using a delimiter string.static String
concatMatcherDescriptions(org.hamcrest.Matcher<?>... matchers)
Concatenates descriptions of matchers into one using SPACE as delimiter string.void
describeMismatch(Object item, org.hamcrest.Description mismatchDescription)
void
describeTo(org.hamcrest.Description description)
protected abstract boolean
featureMatches(T toMatch)
boolean
matches(Object actual)
protected boolean
prerequisiteChecking(Object actual)
-
Methods inherited from class ru.tinkoff.qa.neptune.core.api.steps.SelfDescribed
toString
-
-
-
-
Constructor Detail
-
NeptuneFeatureMatcher
@SafeVarargs protected NeptuneFeatureMatcher(boolean isNullSafe, Class<? extends T>... expectedTypes)
-
NeptuneFeatureMatcher
protected NeptuneFeatureMatcher(boolean isNullSafe)
-
-
Method Detail
-
concatMatcherDescriptions
public static String concatMatcherDescriptions(String delimiter, org.hamcrest.Matcher<?>... matchers)
Concatenates descriptions of matchers into one using a delimiter string.- Parameters:
delimiter
- is a delimiter stringmatchers
- are matchers whose string descriptions should be concatenated- Returns:
- a concatenated string
-
concatMatcherDescriptions
public static String concatMatcherDescriptions(org.hamcrest.Matcher<?>... matchers)
Concatenates descriptions of matchers into one using SPACE as delimiter string.- Parameters:
matchers
- are matchers whose string descriptions should be concatenated- Returns:
- a concatenated string
-
prerequisiteChecking
protected boolean prerequisiteChecking(Object actual)
-
matches
public boolean matches(Object actual)
- Specified by:
matches
in interfaceorg.hamcrest.Matcher<T>
-
checkFeature
protected boolean checkFeature(Object actual)
-
featureMatches
protected abstract boolean featureMatches(T toMatch)
-
appendMismatchDescription
protected void appendMismatchDescription(MismatchDescriber describer)
-
appendMismatchDescription
protected void appendMismatchDescription(org.hamcrest.Description description)
-
appendMismatchDescription
protected final void appendMismatchDescription(org.hamcrest.Matcher<?> matcher, Object o)
-
describeTo
public final void describeTo(org.hamcrest.Description description)
- Specified by:
describeTo
in interfaceorg.hamcrest.SelfDescribing
-
describeMismatch
public final void describeMismatch(Object item, org.hamcrest.Description mismatchDescription)
- Specified by:
describeMismatch
in interfaceorg.hamcrest.Matcher<T>
-
_dont_implement_Matcher___instead_extend_BaseMatcher_
public void _dont_implement_Matcher___instead_extend_BaseMatcher_()
- Specified by:
_dont_implement_Matcher___instead_extend_BaseMatcher_
in interfaceorg.hamcrest.Matcher<T>
-
-