public final class PositionAssertions
extends Object
java.lang.Object | |
↳ | android.support.test.espresso.assertion.PositionAssertions |
A collection of ViewAssertion
s for checking relative position of elements on the screen.
Public methods |
|
---|---|
static ViewAssertion |
isAbove(Matcher<View> matcher) Returns an Assertion that asserts that view displayed is completely above the view matching the given matcher. |
static ViewAssertion |
isBelow(Matcher<View> matcher) Returns a |
static ViewAssertion |
isBottomAlignedWith(Matcher<View> matcher) Returns a |
static ViewAssertion |
isLeftAlignedWith(Matcher<View> matcher) Returns a |
static ViewAssertion |
isLeftOf(Matcher<View> matcher) Returns a |
static ViewAssertion |
isRightAlignedWith(Matcher<View> matcher) Returns a |
static ViewAssertion |
isRightOf(Matcher<View> matcher) Returns a |
static ViewAssertion |
isTopAlignedWith(Matcher<View> matcher) Returns a |
Inherited methods |
|
---|---|
![]() java.lang.Object
|
ViewAssertion isAbove (Matcher<View> matcher)
Returns an Assertion that asserts that view displayed is completely above the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if there is more than 1 pixel of vertical overlap. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isBelow (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely below the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if there is more than 1 pixel of vertical overlap. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isBottomAlignedWith (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely aligned to bottom with the view matching the given matcher.
The bottom 'y' coordinate of the view displayed must equal the bottom 'y' coordinate of the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if the views are not aligned bottom. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isLeftAlignedWith (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely aligned to the left as the view matching the given matcher.
The left 'x' coordinate of the view displayed must equal the left 'x' coordinate of the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if the views are not aligned to the left. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isLeftOf (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely left of the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if there is more than 1 pixel of horizontal overlap. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isRightAlignedWith (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely aligned to the right as the view matching the given matcher.
The right 'x' coordinate of the view displayed must equal the right 'x' coordinate of the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if the views are not aligned to the right. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isRightOf (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely right of the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if there is more than 1 pixel of horizontal overlap. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |
ViewAssertion isTopAlignedWith (Matcher<View> matcher)
Returns a ViewAssertion
that asserts that view displayed is completely aligned to top with the view matching the given matcher.
The top 'y' coordinate of the view displayed must equal the top 'y' coordinate of the view matching the given matcher.
Parameters | |
---|---|
matcher |
Matcher
|
Returns | |
---|---|
ViewAssertion |
Throws | |
---|---|
|
if the views are not aligned top. |
AmbiguousViewMatcherException |
if more than one view matches the given matcher. |
NoMatchingViewException |
if no views match the given matcher. |