ViewAsserts
open classViewAsserts
| kotlin.Any | |
| ↳ | android.test.ViewAsserts |
Some useful assertions about views.
Summary
| Public methods | |
|---|---|
| open static Unit |
assertBaselineAligned(first: View!, second: View!)Assert that two views are aligned on their baseline, that is that their baselines are on the same y location. |
| open static Unit |
assertBottomAligned(first: View!, second: View!)Assert that two views are bottom aligned, that is that their bottom edges are on the same y location. |
| open static Unit |
assertBottomAligned(first: View!, second: View!, margin: Int)Assert that two views are bottom aligned, that is that their bottom edges are on the same y location, with respect to the specified margin. |
| open static Unit |
assertGroupContains(parent: ViewGroup!, child: View!)Assert that the specified group contains a specific child once and only once. |
| open static Unit |
assertGroupIntegrity(parent: ViewGroup!)Assert the specified group's integrity. |
| open static Unit |
assertGroupNotContains(parent: ViewGroup!, child: View!)Assert that the specified group does not contain a specific child. |
| open static Unit |
assertHasScreenCoordinates(origin: View!, view: View!, x: Int, y: Int)Assert that a view has a particular x and y position on the visible screen. |
| open static Unit |
assertHorizontalCenterAligned(reference: View!, test: View!)Assert that the |
| open static Unit |
assertLeftAligned(first: View!, second: View!)Assert that two views are left aligned, that is that their left edges are on the same x location. |
| open static Unit |
assertLeftAligned(first: View!, second: View!, margin: Int)Assert that two views are left aligned, that is that their left edges are on the same x location, with respect to the specified margin. |
| open static Unit |
assertOffScreenAbove(origin: View!, view: View!)Assert that view is above the visible screen. |
| open static Unit |
assertOffScreenBelow(origin: View!, view: View!)Assert that view is below the visible screen. |
| open static Unit |
assertOnScreen(origin: View!, view: View!)Assert that view is on the screen. |
| open static Unit |
assertRightAligned(first: View!, second: View!)Assert that two views are right aligned, that is that their right edges are on the same x location. |
| open static Unit |
assertRightAligned(first: View!, second: View!, margin: Int)Assert that two views are right aligned, that is that their right edges are on the same x location, with respect to the specified margin. |
| open static Unit |
assertTopAligned(first: View!, second: View!)Assert that two views are top aligned, that is that their top edges are on the same y location. |
| open static Unit |
assertTopAligned(first: View!, second: View!, margin: Int)Assert that two views are top aligned, that is that their top edges are on the same y location, with respect to the specified margin. |
| open static Unit |
assertVerticalCenterAligned(reference: View!, test: View!)Assert that the |
Public methods
assertBaselineAligned
open static funassertBaselineAligned(
first: View!,
second: View!
): Unit
Deprecated: Deprecated in Java.
Assert that two views are aligned on their baseline, that is that their baselines are on the same y location.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
assertBottomAligned
open static funassertBottomAligned(
first: View!,
second: View!
): Unit
Deprecated: Deprecated in Java.
Assert that two views are bottom aligned, that is that their bottom edges are on the same y location.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
assertBottomAligned
open static funassertBottomAligned(
first: View!,
second: View!,
margin: Int
): Unit
Deprecated: Deprecated in Java.
Assert that two views are bottom aligned, that is that their bottom edges are on the same y location, with respect to the specified margin.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
margin |
Int: The margin between the first view and the second view |
assertGroupContains
open static funassertGroupContains(
parent: ViewGroup!,
child: View!
): Unit
Deprecated: Deprecated in Java.
Assert that the specified group contains a specific child once and only once.
| Parameters | |
|---|---|
parent |
ViewGroup!: The group |
child |
View!: The child that should belong to group |
assertGroupIntegrity
open static funassertGroupIntegrity(parent: ViewGroup!): Unit
Deprecated: Deprecated in Java.
Assert the specified group's integrity. The children count should be >= 0 and each child should be non-null.
| Parameters | |
|---|---|
parent |
ViewGroup!: The group whose integrity to check |
assertGroupNotContains
open static funassertGroupNotContains(
parent: ViewGroup!,
child: View!
): Unit
Deprecated: Deprecated in Java.
Assert that the specified group does not contain a specific child.
| Parameters | |
|---|---|
parent |
ViewGroup!: The group |
child |
View!: The child that should not belong to group |
assertHasScreenCoordinates
open static funassertHasScreenCoordinates(
origin: View!,
view: View!,
x: Int,
y: Int
): Unit
Deprecated: Deprecated in Java.
Assert that a view has a particular x and y position on the visible screen.
| Parameters | |
|---|---|
origin |
View!: The root view of the screen. |
view |
View!: The view. |
x |
Int: The expected x coordinate. |
y |
Int: The expected y coordinate. |
assertHorizontalCenterAligned
open static funassertHorizontalCenterAligned(
reference: View!,
test: View!
): Unit
Deprecated: Deprecated in Java.
Assert that the test view is horizontally center aligned with respect to the reference view.
| Parameters | |
|---|---|
reference |
View!: The reference view |
test |
View!: The view that should be center aligned with the reference view |
assertLeftAligned
open static funassertLeftAligned(
first: View!,
second: View!
): Unit
Deprecated: Deprecated in Java.
Assert that two views are left aligned, that is that their left edges are on the same x location.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
assertLeftAligned
open static funassertLeftAligned(
first: View!,
second: View!,
margin: Int
): Unit
Deprecated: Deprecated in Java.
Assert that two views are left aligned, that is that their left edges are on the same x location, with respect to the specified margin.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
margin |
Int: The margin between the first view and the second view |
assertOffScreenAbove
open static funassertOffScreenAbove(
origin: View!,
view: View!
): Unit
Deprecated: Deprecated in Java.
Assert that view is above the visible screen.
| Parameters | |
|---|---|
origin |
View!: Te root view of the screen. |
view |
View!: The view |
assertOffScreenBelow
open static funassertOffScreenBelow(
origin: View!,
view: View!
): Unit
Deprecated: Deprecated in Java.
Assert that view is below the visible screen.
| Parameters | |
|---|---|
origin |
View!: The root view of the screen. |
view |
View!: The view |
assertOnScreen
open static funassertOnScreen(
origin: View!,
view: View!
): Unit
Deprecated: Deprecated in Java.
Assert that view is on the screen.
| Parameters | |
|---|---|
origin |
View!: The root view of the screen. |
view |
View!: The view. |
assertRightAligned
open static funassertRightAligned(
first: View!,
second: View!
): Unit
Deprecated: Deprecated in Java.
Assert that two views are right aligned, that is that their right edges are on the same x location.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
assertRightAligned
open static funassertRightAligned(
first: View!,
second: View!,
margin: Int
): Unit
Deprecated: Deprecated in Java.
Assert that two views are right aligned, that is that their right edges are on the same x location, with respect to the specified margin.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
margin |
Int: The margin between the first view and the second view |
assertTopAligned
open static funassertTopAligned(
first: View!,
second: View!
): Unit
Deprecated: Deprecated in Java.
Assert that two views are top aligned, that is that their top edges are on the same y location.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
assertTopAligned
open static funassertTopAligned(
first: View!,
second: View!,
margin: Int
): Unit
Deprecated: Deprecated in Java.
Assert that two views are top aligned, that is that their top edges are on the same y location, with respect to the specified margin.
| Parameters | |
|---|---|
first |
View!: The first view |
second |
View!: The second view |
margin |
Int: The margin between the first view and the second view |
assertVerticalCenterAligned
open static funassertVerticalCenterAligned(
reference: View!,
test: View!
): Unit
Deprecated: Deprecated in Java.
Assert that the test view is vertically center aligned with respect to the reference view.
| Parameters | |
|---|---|
reference |
View!: The reference view |
test |
View!: The view that should be center aligned with the reference view |