public final class PositionAssertions
extends Object
java.lang.Object | |
↳ | android.support.test.espresso.assertion.PositionAssertions |
一组 ViewAssertion
s用于检查屏幕上元素的相对位置。
Public methods |
|
---|---|
static ViewAssertion |
isAbove(Matcher<View> matcher) 返回断言,断言所显示的视图完全位于匹配给定匹配器的视图之上。 |
static ViewAssertion |
isBelow(Matcher<View> matcher) 返回一个 |
static ViewAssertion |
isBottomAlignedWith(Matcher<View> matcher) 返回一个 |
static ViewAssertion |
isLeftAlignedWith(Matcher<View> matcher) 返回一个 |
static ViewAssertion |
isLeftOf(Matcher<View> matcher) 返回一个 |
static ViewAssertion |
isRightAlignedWith(Matcher<View> matcher) 返回一个 |
static ViewAssertion |
isRightOf(Matcher<View> matcher) 返回一个 |
static ViewAssertion |
isTopAlignedWith(Matcher<View> matcher) 返回一个 |
Inherited methods |
|
---|---|
![]() java.lang.Object
|
ViewAssertion isAbove (Matcher<View> 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)
返回一个 ViewAssertion
,声明所显示的视图完全位于匹配给定匹配器的视图之下。
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)
返回一个 ViewAssertion
,它声明所显示的视图完全对齐到视图与给定匹配器匹配的底部。
显示视图的底部'y'坐标必须等于匹配给定匹配器的视图的底部'y'坐标。
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)
返回一个 ViewAssertion
,它声明所显示的视图完全与左侧相匹配,以匹配给定的匹配器。
显示视图的左侧'x'坐标必须等于匹配给定匹配器的视图的左侧'x'坐标。
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)
返回一个 ViewAssertion
,它声明所显示的视图完全位于匹配给定匹配器的视图的左侧。
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)
返回一个 ViewAssertion
,声明所显示的视图与匹配给定匹配器的视图完全对齐。
所显示视图的右侧'x'坐标必须等于匹配给定匹配器的视图的右侧'x'坐标。
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)
返回一个 ViewAssertion
,它声明所显示的视图完全匹配给定匹配器的视图的右侧。
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)
返回一个 ViewAssertion
,声明所显示的视图完全与顶部匹配的给定匹配的视图。
所显示视图的顶部'y'坐标必须等于匹配给定匹配器的视图的顶部'y'坐标。
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. |