-
public interface BaseAssertionsBase interface for asserting views
Provides basic assertions that can be performed on any view
-
-
Method Summary
Modifier and Type Method Description UnitisDisplayed()Checks if the view is displayed UnitisNotDisplayed()Checks if the view is not displayed UnitisCompletelyDisplayed()Checks if the view is completely displayed UnitisNotCompletelyDisplayed()Checks if the view is not completely displayed UnitisVisible()Checks if the view has VISIBLE visibility UnitisInvisible()Checks if the view has INVISIBLE visibility UnitisGone()Checks if the view has GONE visibility UnitisSelected()Checks if the view is selected UnitisNotSelected()Checks if the view is not selected UnitisFocused()Checks if the view is focused UnitisNotFocused()Checks if the view is not focused UnitisFocusable()Checks if the view is focusable UnitisNotFocusable()Checks if the view is not focusable UnitisClickable()Checks if the view is clickable UnitisNotClickable()Checks if the view is not clickable UnitisEnabled()Checks if the view is enabled UnitisDisabled()Checks if the view is disabled UnithasTag(String tag)Checks if the view has given tag UnithasAnyTag(String tags)Checks if the view has at least one of the given tags UnitdoesNotExist()Checks if the matched view does not exist UnithasDescendant(Function1<ViewBuilder, Unit> function)Checks if the view has given descendant UnithasNotDescendant(Function1<ViewBuilder, Unit> function)Checks if the view has not given descendant UnithasSibling(Function1<ViewBuilder, Unit> function)Checks if the view has given sibling UnithasNotSibling(Function1<ViewBuilder, Unit> function)Checks if the view has not given sibling Unitmatches(Function1<ViewBuilder, Unit> function)Check if the view matches given matcher UnitnotMatches(Function1<ViewBuilder, Unit> function)Check if the view does not match given matcher Unitassert(Function0<ViewAssertion> function)Check the view with the given custom assertion UnitinRoot(Function1<RootBuilder, Unit> function)Check if the view is in given root UnithasBackgroundColor(@ColorRes() Integer resId)Checks if the view has given background color UnithasBackgroundColor(String colorCode)Checks if the view has given background color UnitisCompletelyAbove(Function1<ViewBuilder, Unit> function)Checks if the view displayed is completely above of the view matching the given matcher. UnitisCompletelyBelow(Function1<ViewBuilder, Unit> function)Checks if the view displayed is completely below of the view matching the given matcher. UnitisCompletelyLeftOf(Function1<ViewBuilder, Unit> function)Checks if the view displayed is completely right of the view matching the given matcher. UnitisCompletelyRightOf(Function1<ViewBuilder, Unit> function)Checks if the view displayed is completely right of the view matching the given matcher. UnitisActivated()Checks if the view is activated UnitisDirty()Checks if the view is dirty UnitisHovered()Checks if the view is hovered UnitisForceDarkAllowed()Checks if the view is force dark allowed UnitisHapticFeedbackEnabled()Checks if the view is haptic feedback enabled UnitisAutoHandwritingEnabled()Checks if the view is auto handwriting enabled abstract ViewInteractionDelegategetView()abstract Matcher<Root>getRoot()abstract UnitsetRoot(Matcher<Root> root)-
-
Method Detail
-
isDisplayed
Unit isDisplayed()
Checks if the view is displayed
-
isNotDisplayed
Unit isNotDisplayed()
Checks if the view is not displayed
-
isCompletelyDisplayed
Unit isCompletelyDisplayed()
Checks if the view is completely displayed
-
isNotCompletelyDisplayed
Unit isNotCompletelyDisplayed()
Checks if the view is not completely displayed
-
isInvisible
Unit isInvisible()
Checks if the view has INVISIBLE visibility
-
isSelected
Unit isSelected()
Checks if the view is selected
-
isNotSelected
Unit isNotSelected()
Checks if the view is not selected
-
isNotFocused
Unit isNotFocused()
Checks if the view is not focused
-
isFocusable
Unit isFocusable()
Checks if the view is focusable
-
isNotFocusable
Unit isNotFocusable()
Checks if the view is not focusable
-
isClickable
Unit isClickable()
Checks if the view is clickable
-
isNotClickable
Unit isNotClickable()
Checks if the view is not clickable
-
isDisabled
Unit isDisabled()
Checks if the view is disabled
-
hasTag
Unit hasTag(String tag)
Checks if the view has given tag
- Parameters:
tag- Tag that view must have
-
hasAnyTag
Unit hasAnyTag(String tags)
Checks if the view has at least one of the given tags
- Parameters:
tags- Tags with at least one of them should be present in view
-
doesNotExist
Unit doesNotExist()
Checks if the matched view does not exist
-
hasDescendant
Unit hasDescendant(Function1<ViewBuilder, Unit> function)
Checks if the view has given descendant
- Parameters:
function- ViewBuilder that will result in descendant matcher
-
hasNotDescendant
Unit hasNotDescendant(Function1<ViewBuilder, Unit> function)
Checks if the view has not given descendant
- Parameters:
function- ViewBuilder that will result in descendant matcher
-
hasSibling
Unit hasSibling(Function1<ViewBuilder, Unit> function)
Checks if the view has given sibling
- Parameters:
function- ViewBuilder that will result in sibling matcher
-
hasNotSibling
Unit hasNotSibling(Function1<ViewBuilder, Unit> function)
Checks if the view has not given sibling
- Parameters:
function- ViewBuilder that will result in sibling matcher
-
matches
Unit matches(Function1<ViewBuilder, Unit> function)
Check if the view matches given matcher
- Parameters:
function- ViewBuilder that will result in matcher
-
notMatches
Unit notMatches(Function1<ViewBuilder, Unit> function)
Check if the view does not match given matcher
- Parameters:
function- ViewBuilder that will result in matcher
-
assert
Unit assert(Function0<ViewAssertion> function)
Check the view with the given custom assertion
- Parameters:
function- Lambda that must return ViewAssertion
-
inRoot
Unit inRoot(Function1<RootBuilder, Unit> function)
Check if the view is in given root
- Parameters:
function- RootBuilder that will result in root matcher
-
hasBackgroundColor
Unit hasBackgroundColor(@ColorRes() Integer resId)
Checks if the view has given background color
- Parameters:
resId- Color resource to be matched
-
hasBackgroundColor
Unit hasBackgroundColor(String colorCode)
Checks if the view has given background color
- Parameters:
colorCode- Color string code to be matched
-
isCompletelyAbove
Unit isCompletelyAbove(Function1<ViewBuilder, Unit> function)
Checks if the view displayed is completely above of the view matching the given matcher.
- Parameters:
function- ViewBuilder that will result in matcher
-
isCompletelyBelow
Unit isCompletelyBelow(Function1<ViewBuilder, Unit> function)
Checks if the view displayed is completely below of the view matching the given matcher.
- Parameters:
function- ViewBuilder that will result in matcher
-
isCompletelyLeftOf
Unit isCompletelyLeftOf(Function1<ViewBuilder, Unit> function)
Checks if the view displayed is completely right of the view matching the given matcher.
- Parameters:
function- ViewBuilder that will result in matcher
-
isCompletelyRightOf
Unit isCompletelyRightOf(Function1<ViewBuilder, Unit> function)
Checks if the view displayed is completely right of the view matching the given matcher.
- Parameters:
function- ViewBuilder that will result in matcher
-
isActivated
Unit isActivated()
Checks if the view is activated
-
isForceDarkAllowed
Unit isForceDarkAllowed()
Checks if the view is force dark allowed
-
isHapticFeedbackEnabled
Unit isHapticFeedbackEnabled()
Checks if the view is haptic feedback enabled
-
isAutoHandwritingEnabled
Unit isAutoHandwritingEnabled()
Checks if the view is auto handwriting enabled
-
getView
abstract ViewInteractionDelegate getView()
-
-
-
-