Refactor testing APIs to the final proposal.
Bug: 161116353
Test: N/A
Relnote: "Several testing APIs were renamed to be more intuitive. All
findXYZ APIs were renamed to onNodeXYZ. All doXYZ APIs were renamed to
performXYZ."
Change-Id: I7f164b42b04196f023c4a2153d66825487998de4
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertExistsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertExistsTest.kt
index 9902d3a..dd2f27a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertExistsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertExistsTest.kt
@@ -61,28 +61,28 @@
}
}
- findByText("Hello")
+ onNodeWithText("Hello")
.assertExists()
expectAssertionError(true) {
- findByText("Hello")
+ onNodeWithText("Hello")
.assertDoesNotExist()
}
- val cachedResult = findByText("Hello")
+ val cachedResult = onNodeWithText("Hello")
// Hide
- findByTag("MyButton")
- .doClick()
+ onNodeWithTag("MyButton")
+ .performClick()
- findByText("Hello")
+ onNodeWithText("Hello")
.assertDoesNotExist()
cachedResult
.assertDoesNotExist()
expectAssertionError(true) {
- findByText("Hello")
+ onNodeWithText("Hello")
.assertExists()
}
@@ -91,14 +91,14 @@
}
// Show
- findByTag("MyButton")
- .doClick()
+ onNodeWithTag("MyButton")
+ .performClick()
- findByText("Hello")
+ onNodeWithText("Hello")
.assertExists()
expectAssertionError(true) {
- findByText("Hello")
+ onNodeWithText("Hello")
.assertDoesNotExist()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
index 9eb6a66..8bde3ad 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
@@ -41,7 +41,7 @@
BoundaryNode { testTag = "test"; hidden = false }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsNotHidden()
}
@@ -51,7 +51,7 @@
BoundaryNode { testTag = "test"; hidden = true }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsNotHidden()
}
@@ -61,7 +61,7 @@
BoundaryNode { testTag = "test"; hidden = true }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsHidden()
}
@@ -71,7 +71,7 @@
BoundaryNode { testTag = "test"; hidden = false }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsHidden()
}
@@ -81,7 +81,7 @@
BoundaryNode { testTag = "test"; toggleableState = ToggleableState.On }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsOn()
}
@@ -91,7 +91,7 @@
BoundaryNode { testTag = "test"; toggleableState = ToggleableState.Off }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsOn()
}
@@ -101,7 +101,7 @@
BoundaryNode { testTag = "test" }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsOn()
}
@@ -111,7 +111,7 @@
BoundaryNode { testTag = "test"; toggleableState = ToggleableState.On }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsOff()
}
@@ -121,7 +121,7 @@
BoundaryNode { testTag = "test"; toggleableState = ToggleableState.Off }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsOff()
}
@@ -131,7 +131,7 @@
BoundaryNode { testTag = "test"; }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsOff()
}
@@ -141,7 +141,7 @@
BoundaryNode { testTag = "test"; selected = false }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsSelected()
}
@@ -151,7 +151,7 @@
BoundaryNode { testTag = "test"; selected = true }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsSelected()
}
@@ -161,7 +161,7 @@
BoundaryNode { testTag = "test"; }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsSelected()
}
@@ -171,7 +171,7 @@
BoundaryNode { testTag = "test"; selected = true }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsUnselected()
}
@@ -181,7 +181,7 @@
BoundaryNode { testTag = "test"; selected = false }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsUnselected()
}
@@ -191,7 +191,7 @@
BoundaryNode { testTag = "test"; }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsUnselected()
}
@@ -201,7 +201,7 @@
BoundaryNode { testTag = "test"; inMutuallyExclusiveGroup = false }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsInMutuallyExclusiveGroup()
}
@@ -211,7 +211,7 @@
BoundaryNode { testTag = "test"; }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsInMutuallyExclusiveGroup()
}
@@ -221,7 +221,7 @@
BoundaryNode { testTag = "test"; inMutuallyExclusiveGroup = true }
}
- findByTag("test")
+ onNodeWithTag("test")
.assertIsInMutuallyExclusiveGroup()
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/BitmapCapturingTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/BitmapCapturingTest.kt
index e5a0e3d..e51c8d3 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/BitmapCapturingTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/BitmapCapturingTest.kt
@@ -79,7 +79,7 @@
composeCheckerboard()
var calledCount = 0
- findByTag(tag11)
+ onNodeWithTag(tag11)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(100, 50)) {
calledCount++
@@ -87,17 +87,17 @@
}
assertThat(calledCount).isEqualTo(100 * 50)
- findByTag(tag12)
+ onNodeWithTag(tag12)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(100, 50)) {
color12
}
- findByTag(tag21)
+ onNodeWithTag(tag21)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(100, 50)) {
color21
}
- findByTag(tag22)
+ onNodeWithTag(tag22)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(100, 50)) {
color22
@@ -108,7 +108,7 @@
fun captureRootContainer_checkSizeAndColors() {
composeCheckerboard()
- findByTag(rootTag)
+ onNodeWithTag(rootTag)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(200, 100)) {
if (it.y >= 100 || it.x >= 200) {
@@ -122,7 +122,7 @@
fun assertWrongColor_expectException() {
composeCheckerboard()
- findByTag(tag11)
+ onNodeWithTag(tag11)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(100, 50)) {
color22 // Assuming wrong color
@@ -133,7 +133,7 @@
fun assertWrongSize_expectException() {
composeCheckerboard()
- findByTag(tag11)
+ onNodeWithTag(tag11)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(10, 10)) {
color21
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
index 920fa85..301adaf 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
@@ -48,14 +48,14 @@
}
}
- findByLabel("Nothing")
+ onNodeWithLabel("Nothing")
.assertExists()
- .callSemanticsAction(MyActions.SetString) { it("Hello") }
+ .performSemanticsAction(MyActions.SetString) { it("Hello") }
- findByLabel("Nothing")
+ onNodeWithLabel("Nothing")
.assertDoesNotExist()
- findByLabel("Hello")
+ onNodeWithLabel("Hello")
.assertExists()
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/CustomActivityTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/CustomActivityTest.kt
index e789401..15cae35 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/CustomActivityTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/CustomActivityTest.kt
@@ -59,6 +59,6 @@
@Test
fun launchCustomActivity() {
- findByText("Hello").assertExists()
+ onNodeWithText("Hello").assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
index e43d92d..60afce4 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
@@ -59,7 +59,7 @@
"Has 1 sibling\n" +
"Selector used: (TestTag = 'MyButton')"
) {
- findByTag("MyButton")
+ onNodeWithTag("MyButton")
.assertHasClickAction()
}
}
@@ -75,7 +75,7 @@
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"(TestTag = 'MyButton3')"
) {
- findByTag("MyButton3")
+ onNodeWithTag("MyButton3")
.assertExists()
}
}
@@ -91,8 +91,8 @@
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"(TestTag = 'MyButton3')"
) {
- findByTag("MyButton3")
- .doClick()
+ onNodeWithTag("MyButton3")
+ .performClick()
}
}
@@ -107,8 +107,8 @@
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"((TestTag = 'MyButton3') && (OnClick is defined))"
) {
- find(hasTestTag("MyButton3") and hasClickAction())
- .doClick()
+ onNode(hasTestTag("MyButton3") and hasClickAction())
+ .performClick()
}
}
@@ -125,8 +125,8 @@
"Nodes found:\n" +
"1) Node #X at (X, X, X, X)px, Tag: 'MyButton'"
) {
- findByText("Toggle")
- .doClick()
+ onNodeWithText("Toggle")
+ .performClick()
}
}
@@ -137,11 +137,11 @@
}
expectErrorMessageStartsWith("" +
- "Failed to call OnClick action as it is not defined on the node.\n" +
+ "Failed to perform OnClick action as it is not defined on the node.\n" +
"Semantics of the node:"
) {
- findByTag("MyButton")
- .callSemanticsAction(SemanticsActions.OnClick)
+ onNodeWithTag("MyButton")
+ .performSemanticsAction(SemanticsActions.OnClick)
}
}
@@ -152,12 +152,12 @@
}
expectErrorMessageStartsWith("" +
- "Failed to call OnClick action.\n" +
+ "Failed to perform OnClick action.\n" +
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"(TestTag = 'MyButton3')"
) {
- findByTag("MyButton3")
- .callSemanticsAction(SemanticsActions.OnClick)
+ onNodeWithTag("MyButton3")
+ .performSemanticsAction(SemanticsActions.OnClick)
}
}
@@ -174,7 +174,7 @@
"Node found:\n" +
"Node #X at (X, X, X, X)px, Tag: 'MyButton'"
) {
- findByTag("MyButton")
+ onNodeWithTag("MyButton")
.assertDoesNotExist()
}
}
@@ -192,7 +192,7 @@
"Nodes found:\n" +
"1) Node #X at (X, X, X, X)px"
) {
- findAllByText("Toggle")
+ onAllNodesWithText("Toggle")
.assertCountEquals(3)
}
}
@@ -208,7 +208,7 @@
"Reason: Expected '3' nodes but could not find any node that satisfies: " +
"(Text = 'Toggle2' (ignoreCase: false))"
) {
- findAllByText("Toggle2")
+ onAllNodesWithText("Toggle2")
.assertCountEquals(3)
}
}
@@ -219,11 +219,11 @@
ComposeTextToHideCase()
}
- val node = findByText("Hello")
+ val node = onNodeWithText("Hello")
.assertExists()
- findByTag("MyButton")
- .doClick()
+ onNodeWithTag("MyButton")
+ .performClick()
expectErrorMessage("" +
"Failed to perform a gesture.\n" +
@@ -233,7 +233,7 @@
"Has 1 sibling\n" +
"Original selector: Text = 'Hello' (ignoreCase: false)"
) {
- node.doClick()
+ node.performClick()
}
}
@@ -243,12 +243,12 @@
ComposeTextToHideCase()
}
- val node = findByText("Hello")
+ val node = onNodeWithText("Hello")
.assertExists()
// Hide text
- findByTag("MyButton")
- .doClick()
+ onNodeWithTag("MyButton")
+ .performClick()
expectErrorMessage("" +
"Failed: assertExists.\n" +
@@ -268,12 +268,12 @@
ComposeTextToHideCase()
}
- val node = findByText("Hello")
+ val node = onNodeWithText("Hello")
.assertExists()
// Hide text
- findByTag("MyButton")
- .doClick()
+ onNodeWithTag("MyButton")
+ .performClick()
expectErrorMessage("" +
"Failed to assert the following: (OnClick is defined)\n" +
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt
index 821f6f3..494ac91 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindAllTest.kt
@@ -47,7 +47,7 @@
}
}
- findAll(isOn())
+ onAllNodes(isOn())
.assertCountEquals(2)
.apply {
get(0).assertIsOn()
@@ -76,14 +76,14 @@
}
}
- findAll(isToggleable())
+ onAllNodes(isToggleable())
.assertCountEquals(2)
.apply {
get(0)
- .doClick()
+ .performClick()
.assertIsOn()
get(1)
- .doClick()
+ .performClick()
.assertIsOn()
}
}
@@ -101,7 +101,7 @@
}
}
- findAll(isOff())
+ onAllNodes(isOff())
.assertCountEquals(0)
}
@@ -127,9 +127,9 @@
}
}
- findAll(isToggleable()).apply {
+ onAllNodes(isToggleable()).apply {
get(0)
- .doClick()
+ .performClick()
.assertIsOn()
get(1)
.assertIsOff()
@@ -168,15 +168,15 @@
}
}
- findAll(isToggleable())
+ onAllNodes(isToggleable())
.assertCountEquals(2).apply {
get(0)
.assertIsOff()
- .doClick()
+ .performClick()
.assertIsOn()
}
- findAll(isToggleable())
+ onAllNodes(isToggleable())
.assertCountEquals(3).apply {
get(2)
.assertIsOff()
@@ -209,12 +209,12 @@
}
}
- findAll(isToggleable())
+ onAllNodes(isToggleable())
.assertCountEquals(2)
.apply {
get(0)
.assertIsOff()
- .doClick()
+ .performClick()
.assertIsOn()
get(1)
.assertDoesNotExist()
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindInPopupTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindInPopupTest.kt
index 326cbcc..655a4702 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindInPopupTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindInPopupTest.kt
@@ -45,7 +45,7 @@
Box(Modifier.testTag(popupTag))
}
}
- findByTag(contentTag).assertExists()
- findByTag(popupTag).assertExists()
+ onNodeWithTag(contentTag).assertExists()
+ onNodeWithTag(popupTag).assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
index 4a2ceb7..94af34e 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
@@ -45,7 +45,7 @@
BoundaryNode { testTag = "not_myTestTag" }
}
- findAll(hasTestTag("myTestTag")).assertCountEquals(0)
+ onAllNodes(hasTestTag("myTestTag")).assertCountEquals(0)
}
@Test
@@ -55,9 +55,9 @@
BoundaryNode { testTag = "myTestTag2" }
}
- findAll(hasTestTag("myTestTag"))
+ onAllNodes(hasTestTag("myTestTag"))
.assertCountEquals(1)
- .first()
+ .onFirst()
.assert(hasTestTag("myTestTag"))
}
@@ -68,7 +68,7 @@
BoundaryNode { testTag = "myTestTag" }
}
- findAll(hasTestTag("myTestTag"))
+ onAllNodes(hasTestTag("myTestTag"))
.assertCountEquals(2)
.apply {
get(0).assert(hasTestTag("myTestTag"))
@@ -82,7 +82,7 @@
BoundaryNode { accessibilityLabel = "Hello World" }
}
- findByText("Hello World")
+ onNodeWithText("Hello World")
}
@Test(expected = AssertionError::class)
@@ -92,7 +92,7 @@
}
// Need to assert exists or it won't fail
- findByText("World").assertExists()
+ onNodeWithText("World").assertExists()
}
@Test
@@ -101,7 +101,7 @@
BoundaryNode { text = AnnotatedString("Hello World") }
}
- findBySubstring("World")
+ onNodeWithSubstring("World")
}
@Test
@@ -110,7 +110,7 @@
BoundaryNode { text = AnnotatedString("Hello World") }
}
- findBySubstring("world", ignoreCase = true)
+ onNodeWithSubstring("world", ignoreCase = true)
}
@Test
@@ -121,7 +121,7 @@
expectError<AssertionError> {
// Need to assert exists or it won't fetch nodes
- findBySubstring("world").assertExists()
+ onNodeWithSubstring("world").assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTest.kt
index d2eef00..9a0085d 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/IsDisplayedTest.kt
@@ -113,7 +113,7 @@
}
}
- findByTag("item0")
+ onNodeWithTag("item0")
.assertIsDisplayed()
}
@@ -125,7 +125,7 @@
}
}
- findByTag("item4")
+ onNodeWithTag("item4")
.assertIsNotDisplayed()
}
@@ -140,14 +140,14 @@
}
}
- findByTag("item0")
+ onNodeWithTag("item0")
.assertIsDisplayed()
runOnIdleCompose {
place = false
}
- findByTag("item0")
+ onNodeWithTag("item0")
.assertIsNotDisplayed()
}
@@ -164,14 +164,14 @@
}
}
- findByTag("item0")
+ onNodeWithTag("item0")
.assertIsDisplayed()
runOnIdleCompose {
place = false
}
- findByTag("item0")
+ onNodeWithTag("item0")
.assertIsNotDisplayed()
}
@@ -183,7 +183,7 @@
}
}
- findByTag("item9")
+ onNodeWithTag("item9")
.assertIsNotDisplayed()
}
@@ -208,14 +208,14 @@
}
onComposeView().check(matches(isDisplayed()))
- findByTag("item0").assertIsDisplayed()
+ onNodeWithTag("item0").assertIsDisplayed()
runOnIdleCompose {
androidComposeView.visibility = View.GONE
}
onComposeView().check(matches(not(isDisplayed())))
- findByTag("item0").assertIsNotDisplayed()
+ onNodeWithTag("item0").assertIsNotDisplayed()
}
@Test
@@ -240,13 +240,13 @@
}
onComposeView().check(matches(isDisplayed()))
- findByTag("item0").assertIsDisplayed()
+ onNodeWithTag("item0").assertIsDisplayed()
runOnIdleCompose {
composeContainer.visibility = View.GONE
}
onComposeView().check(matches(not(isDisplayed())))
- findByTag("item0").assertIsNotDisplayed()
+ onNodeWithTag("item0").assertIsNotDisplayed()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/LateSetContentTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/LateSetContentTest.kt
index aa37c23..52f0e3f 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/LateSetContentTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/LateSetContentTest.kt
@@ -34,7 +34,7 @@
@Test
fun test() {
- findByTag("Node").assertExists()
+ onNodeWithTag("Node").assertExists()
}
class Activity : ComponentActivity() {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesClickTest.kt
index d40a5ed..ab19cad 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesClickTest.kt
@@ -43,7 +43,7 @@
lateinit var activity1: Activity1
composeTestRule.activityRule.scenario.onActivity { activity1 = it }
activity1.startNewActivity()
- findByTag("activity2").doGesture { sendClick() }
+ onNodeWithTag("activity2").performGesture { click() }
val activity2 = getCurrentActivity() as Activity2
assertThat(activity1.recorder.events).isEmpty()
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesFindTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesFindTest.kt
index 2ba48e4..47d2453 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesFindTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleActivitiesFindTest.kt
@@ -35,8 +35,8 @@
@Test
fun test() {
composeTestRule.activityRule.scenario.onActivity { it.startNewActivity() }
- findByTag("activity1").assertDoesNotExist()
- findByTag("activity2").assertExists()
+ onNodeWithTag("activity1").assertDoesNotExist()
+ onNodeWithTag("activity2").assertExists()
}
class Activity1 : TaggedActivity("activity1")
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleComposeRootsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleComposeRootsTest.kt
index a3f79e6..c20e9f8d 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleComposeRootsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/MultipleComposeRootsTest.kt
@@ -142,21 +142,21 @@
Espresso.onView(withText("Compose 1")).check(matches(isDisplayed()))
Espresso.onView(withText("Compose 2")).check(matches(isDisplayed()))
- findByTag("checkbox1")
- .doClick()
+ onNodeWithTag("checkbox1")
+ .performClick()
.assertIsOn()
- findByTag("checkbox2")
+ onNodeWithTag("checkbox2")
.assertIsOff()
Espresso.onView(withText("Compose 1 - On")).check(matches(isDisplayed()))
Espresso.onView(withText("Compose 2 - Off")).check(matches(isDisplayed()))
- findByTag("checkbox2")
- .doClick()
+ onNodeWithTag("checkbox2")
+ .performClick()
.assertIsOn()
- findByTag("checkbox1")
+ onNodeWithTag("checkbox1")
.assertIsOff()
Espresso.onView(withText("Compose 1 - Off")).check(matches(isDisplayed()))
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
index a997989..fead412 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
@@ -53,7 +53,7 @@
"Failed: assertExists.\n" +
"Reason: Expected exactly '1' node but could not find any node that satisfies:"
) {
- findByText("Oops").printToString()
+ onNodeWithText("Oops").printToString()
}
}
@@ -63,7 +63,7 @@
ComposeSimpleCase()
}
- val result = findByText("Hello")
+ val result = onNodeWithText("Hello")
.printToString(maxDepth = 0)
assertThat(obfuscateNodesInfo(result)).isEqualTo("" +
@@ -78,8 +78,8 @@
ComposeSimpleCase()
}
- val result = findRoot()
- .children()
+ val result = onRoot()
+ .onChildren()
.printToString()
assertThat(obfuscateNodesInfo(result)).isEqualTo("" +
@@ -104,7 +104,7 @@
}
}
- val result = findRoot()
+ val result = onRoot()
.printToString()
assertThat(obfuscateNodesInfo(result)).isEqualTo("" +
@@ -138,8 +138,8 @@
}
}
- val result = findRoot()
- .children()
+ val result = onRoot()
+ .onChildren()
.printToString(maxDepth = 1)
assertThat(obfuscateNodesInfo(result)).isEqualTo("" +
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
index d59a833..2d198e6 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
@@ -56,8 +56,8 @@
Assert.assertTrue(!wasScrollToCalled)
}
- findByTag(tag)
- .doScrollTo()
+ onNodeWithTag(tag)
+ .performScrollTo()
runOnIdleCompose {
Assert.assertTrue(wasScrollToCalled)
@@ -104,8 +104,8 @@
Truth.assertThat(currentScrollPositionX).isEqualTo(0.0f)
}
- findByTag(tag)
- .doScrollTo() // scroll to third element
+ onNodeWithTag(tag)
+ .performScrollTo() // scroll to third element
runOnIdleCompose {
val expected = elementHeight * 2
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/SynchronizationMethodsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/SynchronizationMethodsTest.kt
index 9c4369f..ad4e374 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/SynchronizationMethodsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/SynchronizationMethodsTest.kt
@@ -77,7 +77,7 @@
withAndroidOwnerRegistry {
runOnIdleCompose {
expectError<IllegalStateException> {
- findByTag("dummy").assertExists()
+ onNodeWithTag("dummy").assertExists()
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
index 967c45b..e507eeca 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
@@ -70,15 +70,15 @@
}
}
- findByTag(fieldTag)
- .doSendText("Hello!")
+ onNodeWithTag(fieldTag)
+ .performTextInput("Hello!")
runOnIdleCompose {
assertThat(lastSeenText).isEqualTo("Hello!")
}
- findByTag(fieldTag)
- .doClearText(alreadyHasFocus = true)
+ onNodeWithTag(fieldTag)
+ .performTextClearance(alreadyHasFocus = true)
runOnIdleCompose {
assertThat(lastSeenText).isEqualTo("")
@@ -94,11 +94,11 @@
}
}
- findByTag(fieldTag)
- .doSendText("Hello ")
+ onNodeWithTag(fieldTag)
+ .performTextInput("Hello ")
- findByTag(fieldTag)
- .doSendText("world!", alreadyHasFocus = true)
+ onNodeWithTag(fieldTag)
+ .performTextInput("world!", alreadyHasFocus = true)
runOnIdleCompose {
assertThat(lastSeenText).isEqualTo("Hello world!")
@@ -114,14 +114,14 @@
}
}
- findByTag(fieldTag)
- .doSendText("Hello")
+ onNodeWithTag(fieldTag)
+ .performTextInput("Hello")
// This helps. So there must be some timing issue.
// Thread.sleep(3000)
- findByTag(fieldTag)
- .doSendText(" world!", alreadyHasFocus = true)
+ onNodeWithTag(fieldTag)
+ .performTextInput(" world!", alreadyHasFocus = true)
runOnIdleCompose {
assertThat(lastSeenText).isEqualTo("Hello world!")
@@ -135,8 +135,8 @@
}
expectError<IllegalStateException> {
- findByTag(fieldTag)
- .doSendText("Hello!", alreadyHasFocus = true)
+ onNodeWithTag(fieldTag)
+ .performTextInput("Hello!", alreadyHasFocus = true)
}
}
@@ -149,15 +149,15 @@
}
}
- findByTag(fieldTag)
- .doSendText("Hello")
+ onNodeWithTag(fieldTag)
+ .performTextInput("Hello")
runOnIdleCompose {
assertThat(lastSeenText).isEqualTo("Hello")
}
- findByTag(fieldTag)
- .doReplaceText("world", alreadyHasFocus = true)
+ onNodeWithTag(fieldTag)
+ .performTextReplacement("world", alreadyHasFocus = true)
runOnIdleCompose {
assertThat(lastSeenText).isEqualTo("world")
@@ -173,8 +173,8 @@
}
assertThat(actionPerformed).isEqualTo(ImeAction.Unspecified)
- findByTag(fieldTag)
- .doSendImeAction()
+ onNodeWithTag(fieldTag)
+ .performImeAction()
runOnIdleCompose {
assertThat(actionPerformed).isEqualTo(ImeAction.Search)
@@ -191,11 +191,11 @@
assertThat(actionPerformed).isEqualTo(ImeAction.Unspecified)
expectErrorMessageStartsWith("" +
- "Failed to send IME action as current node does not specify any.\n" +
+ "Failed to perform IME action as current node does not specify any.\n" +
"Semantics of the node:"
) {
- findByTag(fieldTag)
- .doSendImeAction()
+ onNodeWithTag(fieldTag)
+ .performImeAction()
}
}
@@ -206,12 +206,12 @@
}
expectErrorMessageStartsWith("" +
- "Failed to send IME action.\n" +
+ "Failed to perform IME action.\n" +
"Failed to assert the following: (SupportsInputMethods = 'true')\n" +
"Semantics of the node:"
) {
- findByTag("node")
- .doSendImeAction()
+ onNodeWithTag("node")
+ .performImeAction()
}
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/TimeOutTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/TimeOutTest.kt
index 2fe01a7..011e46a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/TimeOutTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/TimeOutTest.kt
@@ -117,13 +117,13 @@
}
}
- findByText("Hello 0").assertExists()
+ onNodeWithText("Hello 0").assertExists()
count.value++ // Start infinite re-compositions
IdlingPolicies.setMasterPolicyTimeout(300, TimeUnit.MILLISECONDS)
expectError<ComposeNotIdleException>(expectedMessage = expectedErrorDueToRecompositions) {
- findByText("Hello").assertExists()
+ onNodeWithText("Hello").assertExists()
}
}
@@ -167,7 +167,7 @@
}
// No timeout should happen this time
- findByText("Hello").assertExists()
+ onNodeWithText("Hello").assertExists()
}
private object InfiniteResource : IdlingResource {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAllTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAllTest.kt
index 09a6ed4..518222e 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAllTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAllTest.kt
@@ -19,9 +19,9 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assertAll
import androidx.ui.test.assertCountEquals
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
@@ -47,8 +47,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAll(hasTestTag("Child1") or hasTestTag("Child2"))
}
@@ -66,8 +66,8 @@
"Found '1' node not matching:\n" +
"Node #X"
) {
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAll(hasTestTag("Child1"))
}
}
@@ -87,8 +87,8 @@
"Found '2' nodes not matching:\n" +
"1) "
) {
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAll(hasTestTag("Child1"))
}
}
@@ -99,8 +99,8 @@
BoundaryNode(testTag = "Parent")
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertCountEquals(0)
.assertAll(hasTestTag("Child"))
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAnyTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAnyTest.kt
index 7cede74..0f94a36 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAnyTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/AssertAnyTest.kt
@@ -18,9 +18,9 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assertAny
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
@@ -46,12 +46,12 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAny(hasTestTag("Child1"))
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAny(hasTestTag("Child1") or hasTestTag("Child2"))
}
@@ -68,8 +68,8 @@
"Failed to assertAny(TestTag = 'Child3')\n" +
"None of the following nodes match:\n" +
"1) ") {
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAny(hasTestTag("Child3"))
}
}
@@ -84,8 +84,8 @@
"Failed to assertAny(TestTag = 'Child')\n" +
"Assert needs to receive at least 1 node but 0 nodes were found for selector: " +
"'(TestTag = 'Parent').children'") {
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertAny(hasTestTag("Child"))
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/BoundsAssertionsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/BoundsAssertionsTest.kt
index c4234df..26ca383 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/BoundsAssertionsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/assertions/BoundsAssertionsTest.kt
@@ -37,7 +37,7 @@
import androidx.ui.test.assertWidthIsAtLeast
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.util.expectError
import androidx.ui.unit.dp
import org.junit.Rule
@@ -102,7 +102,7 @@
fun assertEquals() {
composeBox()
- findByTag(tag)
+ onNodeWithTag(tag)
.assertWidthIsEqualTo(80.dp)
.assertHeightIsEqualTo(100.dp)
}
@@ -111,7 +111,7 @@
fun assertAtLeast() {
composeBox()
- findByTag(tag)
+ onNodeWithTag(tag)
.assertWidthIsAtLeast(80.dp)
.assertWidthIsAtLeast(79.dp)
.assertHeightIsAtLeast(100.dp)
@@ -123,12 +123,12 @@
composeBox()
expectError<AssertionError> {
- findByTag(tag)
+ onNodeWithTag(tag)
.assertWidthIsEqualTo(70.dp)
}
expectError<AssertionError> {
- findByTag(tag)
+ onNodeWithTag(tag)
.assertHeightIsEqualTo(90.dp)
}
}
@@ -138,12 +138,12 @@
composeBox()
expectError<AssertionError> {
- findByTag(tag)
+ onNodeWithTag(tag)
.assertWidthIsAtLeast(81.dp)
}
expectError<AssertionError> {
- findByTag(tag)
+ onNodeWithTag(tag)
.assertHeightIsAtLeast(101.dp)
}
}
@@ -152,7 +152,7 @@
fun assertPosition() {
composeBox()
- findByTag(tag)
+ onNodeWithTag(tag)
.assertPositionInRootIsEqualTo(expectedLeft = 50.dp, expectedTop = 100.dp)
.assertLeftPositionInRootIsEqualTo(50.dp)
.assertTopPositionInRootIsEqualTo(100.dp)
@@ -163,12 +163,12 @@
composeBox()
expectError<AssertionError> {
- findByTag(tag)
+ onNodeWithTag(tag)
.assertPositionInRootIsEqualTo(expectedLeft = 51.dp, expectedTop = 101.dp)
}
expectError<AssertionError> {
- findByTag(tag)
+ onNodeWithTag(tag)
.assertPositionInRootIsEqualTo(expectedLeft = 49.dp, expectedTop = 99.dp)
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/PositionsTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/PositionsTest.kt
index e4a018c..9d2b331 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/PositionsTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/PositionsTest.kt
@@ -29,8 +29,8 @@
import androidx.ui.test.centerX
import androidx.ui.test.centerY
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.height
import androidx.ui.test.left
import androidx.ui.test.right
@@ -55,7 +55,7 @@
fun testCornersEdgesAndCenter() {
composeTestRule.setContent { ClickableTestBox(width = 3f, height = 100f) }
- findByTag(defaultTag).doGesture {
+ onNodeWithTag(defaultTag).performGesture {
assertThat(width).isEqualTo(3)
assertThat(height).isEqualTo(100)
@@ -83,7 +83,7 @@
fun testRelativeOffset() {
composeTestRule.setContent { ClickableTestBox() }
- findByTag(defaultTag).doGesture {
+ onNodeWithTag(defaultTag).performGesture {
assertThat(percentOffset(.1f, .1f)).isEqualTo(Offset(10f, 10f))
assertThat(percentOffset(-.2f, 0f)).isEqualTo(Offset(-20f, 0f))
assertThat(percentOffset(.25f, -.5f)).isEqualTo(Offset(25f, -50f))
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt
index b4e1492..bdbea41 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendClickTest.kt
@@ -28,10 +28,10 @@
import androidx.ui.layout.Column
import androidx.ui.test.ActivityWithActionBar
import androidx.ui.test.android.AndroidComposeTestRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendClick
+import androidx.ui.test.click
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.RecordingFilter
import com.google.common.truth.Truth.assertThat
@@ -126,11 +126,11 @@
}
private fun click(tag: String) {
- findByTag(tag).doGesture {
+ onNodeWithTag(tag).performGesture {
if (config.position != null) {
- sendClick(config.position)
+ click(config.position)
} else {
- sendClick()
+ click()
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt
index 2c194a6..fcd5823 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendDoubleClickTest.kt
@@ -23,9 +23,9 @@
import androidx.ui.test.InputDispatcher.Companion.eventPeriod
import androidx.ui.test.InputDispatcher.InputDispatcherTestRule
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
-import androidx.ui.test.sendDoubleClick
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.doubleClick
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.ClickableTestBox.defaultSize
import androidx.ui.test.util.ClickableTestBox.defaultTag
@@ -89,15 +89,15 @@
}
// When we inject a double click
- findByTag(defaultTag).doGesture {
+ onNodeWithTag(defaultTag).performGesture {
if (config.position != null && config.delay != null) {
- sendDoubleClick(config.position, config.delay)
+ doubleClick(config.position, config.delay)
} else if (config.position != null) {
- sendDoubleClick(config.position)
+ doubleClick(config.position)
} else if (config.delay != null) {
- sendDoubleClick(delay = config.delay)
+ doubleClick(delay = config.delay)
} else {
- sendDoubleClick()
+ doubleClick()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
index 5cbd19e..2f92087 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendLongClickTest.kt
@@ -25,9 +25,9 @@
import androidx.ui.layout.fillMaxSize
import androidx.ui.layout.wrapContentSize
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
-import androidx.ui.test.sendLongClick
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.longClick
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.ClickableTestBox.defaultSize
import androidx.ui.test.util.ClickableTestBox.defaultTag
@@ -44,7 +44,7 @@
import org.junit.runners.Parameterized
/**
- * Tests [sendLongClick] with arguments. Verifies that the click is in the middle
+ * Tests [longClick] with arguments. Verifies that the click is in the middle
* of the component, that the gesture has a duration of 600 milliseconds and that all input
* events were on the same location.
*/
@@ -93,15 +93,15 @@
}
// When we inject a long click
- findByTag(defaultTag).doGesture {
+ onNodeWithTag(defaultTag).performGesture {
if (config.position != null && config.duration != null) {
- sendLongClick(config.position, config.duration)
+ longClick(config.position, config.duration)
} else if (config.position != null) {
- sendLongClick(config.position)
+ longClick(config.position)
} else if (config.duration != null) {
- sendLongClick(duration = config.duration)
+ longClick(duration = config.duration)
} else {
- sendLongClick()
+ longClick()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendPinchTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendPinchTest.kt
index e28dac9..257102a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendPinchTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendPinchTest.kt
@@ -23,10 +23,10 @@
import androidx.ui.layout.fillMaxSize
import androidx.ui.test.InputDispatcher.Companion.eventPeriod
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendPinch
+import androidx.ui.test.pinch
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.MultiPointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -65,8 +65,8 @@
val end1 = Offset(92f, 50f)
val duration = 400.milliseconds
- findByTag(TAG).doGesture {
- sendPinch(start0, end0, start1, end1, duration)
+ onNodeWithTag(TAG).performGesture {
+ pinch(start0, end0, start1, end1, duration)
}
runOnIdleCompose {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt
index b81d6d6..6d67ef1 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeTest.kt
@@ -26,14 +26,14 @@
import androidx.ui.layout.wrapContentSize
import androidx.ui.test.bottomRight
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendSwipe
-import androidx.ui.test.sendSwipeDown
-import androidx.ui.test.sendSwipeLeft
-import androidx.ui.test.sendSwipeRight
-import androidx.ui.test.sendSwipeUp
+import androidx.ui.test.swipe
+import androidx.ui.test.swipeDown
+import androidx.ui.test.swipeLeft
+import androidx.ui.test.swipeRight
+import androidx.ui.test.swipeUp
import androidx.ui.test.topLeft
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.SinglePointerInputRecorder
@@ -72,7 +72,7 @@
@Test
fun swipeUp() {
composeTestRule.setContent { Ui(Alignment.TopStart) }
- findByTag(tag).doGesture { sendSwipeUp() }
+ onNodeWithTag(tag).performGesture { swipeUp() }
runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
@@ -85,7 +85,7 @@
@Test
fun swipeDown() {
composeTestRule.setContent { Ui(Alignment.TopEnd) }
- findByTag(tag).doGesture { sendSwipeDown() }
+ onNodeWithTag(tag).performGesture { swipeDown() }
runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
@@ -98,7 +98,7 @@
@Test
fun swipeLeft() {
composeTestRule.setContent { Ui(Alignment.BottomEnd) }
- findByTag(tag).doGesture { sendSwipeLeft() }
+ onNodeWithTag(tag).performGesture { swipeLeft() }
runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
@@ -111,7 +111,7 @@
@Test
fun swipeRight() {
composeTestRule.setContent { Ui(Alignment.BottomStart) }
- findByTag(tag).doGesture { sendSwipeRight() }
+ onNodeWithTag(tag).performGesture { swipeRight() }
runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
@@ -124,7 +124,7 @@
@Test
fun swipeShort() {
composeTestRule.setContent { Ui(Alignment.Center) }
- findByTag(tag).doGesture { sendSwipe(topLeft, bottomRight, 1.milliseconds) }
+ onNodeWithTag(tag).performGesture { swipe(topLeft, bottomRight, 1.milliseconds) }
runOnIdleCompose {
recorder.run {
assertTimestampsAreIncreasing()
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt
index 2739718..9fad642 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/gesturescope/SendSwipeVelocityTest.kt
@@ -25,10 +25,10 @@
import androidx.ui.layout.wrapContentSize
import androidx.ui.test.InputDispatcher.InputDispatcherTestRule
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendSwipeWithVelocity
+import androidx.ui.test.swipeWithVelocity
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.SinglePointerInputRecorder
import androidx.ui.test.util.assertOnlyLastEventIsUp
@@ -136,8 +136,8 @@
}
}
- findByTag(tag).doGesture {
- sendSwipeWithVelocity(start, end, velocity, duration)
+ onNodeWithTag(tag).performGesture {
+ swipeWithVelocity(start, end, velocity, duration)
}
runOnIdleCompose {
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/Common.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/Common.kt
index 6c0c86c..243b09a 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/Common.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/Common.kt
@@ -17,12 +17,12 @@
package androidx.ui.test.partialgesturescope
import androidx.ui.test.PartialGestureScope
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.util.ClickableTestBox.defaultTag
object Common {
fun partialGesture(block: PartialGestureScope.() -> Unit) {
- findByTag(defaultTag).doPartialGesture(block)
+ onNodeWithTag(defaultTag).performPartialGesture(block)
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt
index 388bd24..404f59d 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendCancelTest.kt
@@ -23,9 +23,9 @@
import androidx.ui.test.inputdispatcher.verifyNoGestureInProgress
import androidx.ui.test.partialgesturescope.Common.partialGesture
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendCancel
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendUp
+import androidx.ui.test.cancel
+import androidx.ui.test.down
+import androidx.ui.test.up
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.MultiPointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -37,7 +37,7 @@
import org.junit.rules.TestRule
/**
- * Tests if [sendCancel] works
+ * Tests if [cancel] works
*/
@MediumTest
class SendCancelTest {
@@ -65,8 +65,8 @@
@Test
fun onePointer() {
// When we inject a down event followed by a cancel event
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(downPosition1) }
+ partialGesture { cancel() }
runOnIdleCompose {
recorder.run {
@@ -83,9 +83,9 @@
@Test
fun twoPointers() {
// When we inject two down events followed by a cancel event
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendDown(2, downPosition2) }
- partialGesture { sendCancel() }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { down(2, downPosition2) }
+ partialGesture { cancel() }
runOnIdleCompose {
recorder.run {
@@ -102,25 +102,25 @@
@Test
fun cancelWithoutDown() {
expectError<IllegalStateException> {
- partialGesture { sendCancel() }
+ partialGesture { cancel() }
}
}
@Test
fun cancelAfterUp() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendUp() }
+ partialGesture { down(downPosition1) }
+ partialGesture { up() }
expectError<IllegalStateException> {
- partialGesture { sendCancel() }
+ partialGesture { cancel() }
}
}
@Test
fun cancelAfterCancel() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
- partialGesture { sendCancel() }
+ partialGesture { cancel() }
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt
index 9e2d7a0..1a06cd5 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendDownTest.kt
@@ -23,7 +23,7 @@
import androidx.ui.test.createComposeRule
import androidx.ui.test.partialgesturescope.Common.partialGesture
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendDown
+import androidx.ui.test.down
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.MultiPointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -36,7 +36,7 @@
import org.junit.rules.TestRule
/**
- * Tests if [sendDown] works
+ * Tests if [down] works
*/
@MediumTest
class SendDownTest {
@@ -64,7 +64,7 @@
@Test
fun onePointer() {
// When we put a pointer down
- partialGesture { sendDown(position1) }
+ partialGesture { down(position1) }
runOnIdleCompose {
recorder.run {
@@ -80,9 +80,9 @@
@Test
fun twoPointers() {
// When we put two pointers down
- partialGesture { sendDown(1, position1) }
+ partialGesture { down(1, position1) }
sleep(20) // (with some time in between)
- partialGesture { sendDown(2, position2) }
+ partialGesture { down(2, position2) }
runOnIdleCompose {
recorder.run {
@@ -109,10 +109,10 @@
@Test
fun duplicatePointers() {
// When we inject two down events with the same pointer id
- partialGesture { sendDown(1, position1) }
+ partialGesture { down(1, position1) }
// Then the second throws an exception
expectError<IllegalArgumentException> {
- partialGesture { sendDown(1, position1) }
+ partialGesture { down(1, position1) }
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt
index 8fcfe89..73b9ed4 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveByTest.kt
@@ -24,11 +24,11 @@
import androidx.ui.test.movePointerBy
import androidx.ui.test.partialgesturescope.Common.partialGesture
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendCancel
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendMove
-import androidx.ui.test.sendMoveBy
-import androidx.ui.test.sendUp
+import androidx.ui.test.cancel
+import androidx.ui.test.down
+import androidx.ui.test.move
+import androidx.ui.test.moveBy
+import androidx.ui.test.up
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.MultiPointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -42,7 +42,7 @@
import org.junit.rules.TestRule
/**
- * Tests if [sendMoveBy] and [movePointerBy] work
+ * Tests if [moveBy] and [movePointerBy] work
*/
@MediumTest
class SendMoveByTest {
@@ -72,9 +72,9 @@
@Test
fun onePointer() {
// When we inject a down event followed by a move event
- partialGesture { sendDown(downPosition1) }
+ partialGesture { down(downPosition1) }
sleep(20) // (with some time in between)
- partialGesture { sendMoveBy(delta1) }
+ partialGesture { moveBy(delta1) }
runOnIdleCompose {
recorder.run {
@@ -95,10 +95,10 @@
@Test
fun twoPointers() {
// When we inject two down events followed by two move events
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendDown(2, downPosition2) }
- partialGesture { sendMoveBy(1, delta1) }
- partialGesture { sendMoveBy(2, delta2) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { down(2, downPosition2) }
+ partialGesture { moveBy(1, delta1) }
+ partialGesture { moveBy(2, delta2) }
runOnIdleCompose {
recorder.run {
@@ -126,12 +126,12 @@
@Test
fun twoPointers_oneMoveEvent() {
// When we inject two down events followed by one move events
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendDown(2, downPosition2) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { down(2, downPosition2) }
sleep(20) // (with some time in between)
partialGesture { movePointerBy(1, delta1) }
partialGesture { movePointerBy(2, delta2) }
- partialGesture { sendMove() }
+ partialGesture { move() }
runOnIdleCompose {
recorder.run {
@@ -154,33 +154,33 @@
@Test
fun moveByWithoutDown() {
expectError<IllegalStateException> {
- partialGesture { sendMoveBy(delta1) }
+ partialGesture { moveBy(delta1) }
}
}
@Test
fun moveByWrongPointerId() {
- partialGesture { sendDown(1, downPosition1) }
+ partialGesture { down(1, downPosition1) }
expectError<IllegalArgumentException> {
- partialGesture { sendMoveBy(2, delta1) }
+ partialGesture { moveBy(2, delta1) }
}
}
@Test
fun moveByAfterUp() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendUp() }
+ partialGesture { down(downPosition1) }
+ partialGesture { up() }
expectError<IllegalStateException> {
- partialGesture { sendMoveBy(delta1) }
+ partialGesture { moveBy(delta1) }
}
}
@Test
fun moveByAfterCancel() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
- partialGesture { sendMoveBy(delta1) }
+ partialGesture { moveBy(delta1) }
}
}
@@ -193,7 +193,7 @@
@Test
fun movePointerByWrongPointerId() {
- partialGesture { sendDown(1, downPosition1) }
+ partialGesture { down(1, downPosition1) }
expectError<IllegalArgumentException> {
partialGesture { movePointerBy(2, delta1) }
}
@@ -201,8 +201,8 @@
@Test
fun movePointerByAfterUp() {
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendUp(1) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { up(1) }
expectError<IllegalStateException> {
partialGesture { movePointerBy(1, delta1) }
}
@@ -210,8 +210,8 @@
@Test
fun movePointerByAfterCancel() {
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
partialGesture { movePointerBy(1, delta1) }
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveTest.kt
index bd7e890..f73435e 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveTest.kt
@@ -21,10 +21,10 @@
import androidx.ui.test.InputDispatcher.InputDispatcherTestRule
import androidx.ui.test.createComposeRule
import androidx.ui.test.partialgesturescope.Common.partialGesture
-import androidx.ui.test.sendCancel
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendMove
-import androidx.ui.test.sendUp
+import androidx.ui.test.cancel
+import androidx.ui.test.down
+import androidx.ui.test.move
+import androidx.ui.test.up
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.expectError
import org.junit.Before
@@ -33,7 +33,7 @@
import org.junit.rules.TestRule
/**
- * Tests the error states of [sendMove] that are not tested in [SendMoveToTest] and [SendMoveByTest]
+ * Tests the error states of [move] that are not tested in [SendMoveToTest] and [SendMoveByTest]
*/
@MediumTest
class SendMoveTest() {
@@ -58,25 +58,25 @@
@Test
fun moveWithoutDown() {
expectError<IllegalStateException> {
- partialGesture { sendMove() }
+ partialGesture { move() }
}
}
@Test
fun moveAfterUp() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendUp() }
+ partialGesture { down(downPosition1) }
+ partialGesture { up() }
expectError<IllegalStateException> {
- partialGesture { sendMove() }
+ partialGesture { move() }
}
}
@Test
fun moveAfterCancel() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
- partialGesture { sendMove() }
+ partialGesture { move() }
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt
index 599bfa3..3978213 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendMoveToTest.kt
@@ -24,11 +24,11 @@
import androidx.ui.test.movePointerTo
import androidx.ui.test.partialgesturescope.Common.partialGesture
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendCancel
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendMove
-import androidx.ui.test.sendMoveTo
-import androidx.ui.test.sendUp
+import androidx.ui.test.cancel
+import androidx.ui.test.down
+import androidx.ui.test.move
+import androidx.ui.test.moveTo
+import androidx.ui.test.up
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.MultiPointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -42,7 +42,7 @@
import org.junit.rules.TestRule
/**
- * Tests if [sendMoveTo] and [movePointerTo] work
+ * Tests if [moveTo] and [movePointerTo] work
*/
@MediumTest
class SendMoveToTest() {
@@ -72,9 +72,9 @@
@Test
fun onePointer() {
// When we inject a down event followed by a move event
- partialGesture { sendDown(downPosition1) }
+ partialGesture { down(downPosition1) }
sleep(20) // (with some time in between)
- partialGesture { sendMoveTo(moveToPosition1) }
+ partialGesture { moveTo(moveToPosition1) }
runOnIdleCompose {
recorder.run {
@@ -95,10 +95,10 @@
@Test
fun twoPointers_separateMoveEvents() {
// When we inject two down events followed by two move events
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendDown(2, downPosition2) }
- partialGesture { sendMoveTo(1, moveToPosition1) }
- partialGesture { sendMoveTo(2, moveToPosition2) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { down(2, downPosition2) }
+ partialGesture { moveTo(1, moveToPosition1) }
+ partialGesture { moveTo(2, moveToPosition2) }
runOnIdleCompose {
recorder.run {
@@ -126,12 +126,12 @@
@Test
fun twoPointers_oneMoveEvent() {
// When we inject two down events followed by one move events
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendDown(2, downPosition2) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { down(2, downPosition2) }
sleep(20) // (with some time in between)
partialGesture { movePointerTo(1, moveToPosition1) }
partialGesture { movePointerTo(2, moveToPosition2) }
- partialGesture { sendMove() }
+ partialGesture { move() }
runOnIdleCompose {
recorder.run {
@@ -154,33 +154,33 @@
@Test
fun moveToWithoutDown() {
expectError<IllegalStateException> {
- partialGesture { sendMoveTo(moveToPosition1) }
+ partialGesture { moveTo(moveToPosition1) }
}
}
@Test
fun moveToWrongPointerId() {
- partialGesture { sendDown(1, downPosition1) }
+ partialGesture { down(1, downPosition1) }
expectError<IllegalArgumentException> {
- partialGesture { sendMoveTo(2, moveToPosition1) }
+ partialGesture { moveTo(2, moveToPosition1) }
}
}
@Test
fun moveToAfterUp() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendUp() }
+ partialGesture { down(downPosition1) }
+ partialGesture { up() }
expectError<IllegalStateException> {
- partialGesture { sendMoveTo(moveToPosition1) }
+ partialGesture { moveTo(moveToPosition1) }
}
}
@Test
fun moveToAfterCancel() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
- partialGesture { sendMoveTo(moveToPosition1) }
+ partialGesture { moveTo(moveToPosition1) }
}
}
@@ -193,7 +193,7 @@
@Test
fun movePointerToWrongPointerId() {
- partialGesture { sendDown(1, downPosition1) }
+ partialGesture { down(1, downPosition1) }
expectError<IllegalArgumentException> {
partialGesture { movePointerTo(2, moveToPosition1) }
}
@@ -201,8 +201,8 @@
@Test
fun movePointerToAfterUp() {
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendUp(1) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { up(1) }
expectError<IllegalStateException> {
partialGesture { movePointerTo(1, moveToPosition1) }
}
@@ -210,8 +210,8 @@
@Test
fun movePointerToAfterCancel() {
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
partialGesture { movePointerTo(1, moveToPosition1) }
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt
index fc6da04..9a9c3f5 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/partialgesturescope/SendUpTest.kt
@@ -24,9 +24,9 @@
import androidx.ui.test.inputdispatcher.verifyNoGestureInProgress
import androidx.ui.test.partialgesturescope.Common.partialGesture
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendCancel
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendUp
+import androidx.ui.test.cancel
+import androidx.ui.test.down
+import androidx.ui.test.up
import androidx.ui.test.util.ClickableTestBox
import androidx.ui.test.util.MultiPointerInputRecorder
import androidx.ui.test.util.assertTimestampsAreIncreasing
@@ -39,7 +39,7 @@
import org.junit.rules.TestRule
/**
- * Tests if [sendUp] works
+ * Tests if [up] works
*/
@MediumTest
class SendUpTest {
@@ -67,9 +67,9 @@
@Test
fun onePointer() {
// When we inject a down event followed by an up event
- partialGesture { sendDown(downPosition1) }
+ partialGesture { down(downPosition1) }
sleep(20) // (with some time in between)
- partialGesture { sendUp() }
+ partialGesture { up() }
runOnIdleCompose {
recorder.run {
@@ -92,10 +92,10 @@
@Test
fun twoPointers() {
// When we inject two down events followed by two up events
- partialGesture { sendDown(1, downPosition1) }
- partialGesture { sendDown(2, downPosition2) }
- partialGesture { sendUp(1) }
- partialGesture { sendUp(2) }
+ partialGesture { down(1, downPosition1) }
+ partialGesture { down(2, downPosition2) }
+ partialGesture { up(1) }
+ partialGesture { up(2) }
runOnIdleCompose {
recorder.run {
@@ -123,33 +123,33 @@
@Test
fun upWithoutDown() {
expectError<IllegalStateException> {
- partialGesture { sendUp() }
+ partialGesture { up() }
}
}
@Test
fun upWrongPointerId() {
- partialGesture { sendDown(1, downPosition1) }
+ partialGesture { down(1, downPosition1) }
expectError<IllegalArgumentException> {
- partialGesture { sendUp(2) }
+ partialGesture { up(2) }
}
}
@Test
fun upAfterUp() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendUp() }
+ partialGesture { down(downPosition1) }
+ partialGesture { up() }
expectError<IllegalStateException> {
- partialGesture { sendUp() }
+ partialGesture { up() }
}
}
@Test
fun upAfterCancel() {
- partialGesture { sendDown(downPosition1) }
- partialGesture { sendCancel() }
+ partialGesture { down(downPosition1) }
+ partialGesture { cancel() }
expectError<IllegalStateException> {
- partialGesture { sendUp() }
+ partialGesture { up() }
}
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyAncestorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyAncestorTest.kt
index bff8537..c612c5d 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyAncestorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyAncestorTest.kt
@@ -20,9 +20,9 @@
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.hasAnyAncestorThat
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.hasAnyAncestor
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -47,7 +47,7 @@
}
}
- find(hasAnyAncestorThat(hasTestTag("Parent")))
+ onNode(hasAnyAncestor(hasTestTag("Parent")))
.assert(hasTestTag("Child"))
}
@@ -63,7 +63,7 @@
}
}
- findAll(hasAnyAncestorThat(hasTestTag("Parent")))
+ onAllNodes(hasAnyAncestor(hasTestTag("Parent")))
.assertCountEquals(2)
}
@@ -78,7 +78,7 @@
}
}
- find(hasAnyAncestorThat(hasTestTag("Grandparent"))
+ onNode(hasAnyAncestor(hasTestTag("Grandparent"))
and !hasTestTag("Parent"))
.assert(hasTestTag("Child"))
}
@@ -94,7 +94,7 @@
}
}
- findAll(hasAnyAncestorThat(hasTestTag("Parent") or hasTestTag("Grandparent")))
+ onAllNodes(hasAnyAncestor(hasTestTag("Parent") or hasTestTag("Grandparent")))
.assertCountEquals(2)
}
@@ -104,7 +104,7 @@
BoundaryNode(testTag = "Node")
}
- find(hasAnyAncestorThat(hasTestTag("Node")))
+ onNode(hasAnyAncestor(hasTestTag("Node")))
.assertDoesNotExist()
}
@@ -116,7 +116,7 @@
}
}
- find(hasAnyAncestorThat(hasTestTag("Child")))
+ onNode(hasAnyAncestor(hasTestTag("Child")))
.assertDoesNotExist()
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyChildTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyChildTest.kt
index eac72bf..ade55ac 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyChildTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyChildTest.kt
@@ -20,9 +20,9 @@
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.hasAnyChildThat
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.hasAnyChild
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -47,7 +47,7 @@
}
}
- find(hasAnyChildThat(hasTestTag("Child")))
+ onNode(hasAnyChild(hasTestTag("Child")))
.assert(hasTestTag("Parent"))
}
@@ -69,11 +69,11 @@
}
}
- findAll(hasAnyChildThat(hasTestTag("Child1")))
+ onAllNodes(hasAnyChild(hasTestTag("Child1")))
.assertCountEquals(2)
- findAll(hasAnyChildThat(hasTestTag("Child2")))
+ onAllNodes(hasAnyChild(hasTestTag("Child2")))
.assertCountEquals(3)
- findAll(hasAnyChildThat(hasTestTag("Child3")))
+ onAllNodes(hasAnyChild(hasTestTag("Child3")))
.assertCountEquals(1)
}
@@ -83,7 +83,7 @@
BoundaryNode(testTag = "Child")
}
- find(hasAnyChildThat(hasTestTag("Child")))
+ onNode(hasAnyChild(hasTestTag("Child")))
.assertExists() // The root node
}
@@ -97,7 +97,7 @@
}
}
- find(hasAnyChildThat(hasTestTag("Child"))
+ onNode(hasAnyChild(hasTestTag("Child"))
and hasTestTag("Parent"))
.assertDoesNotExist()
}
@@ -112,7 +112,7 @@
}
}
- find(hasAnyChildThat(hasAnyChildThat(hasTestTag("Child"))))
+ onNode(hasAnyChild(hasAnyChild(hasTestTag("Child"))))
.assert(hasTestTag("Parent"))
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyDescendantTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyDescendantTest.kt
index 0fa8b93..d39bd5f 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyDescendantTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnyDescendantTest.kt
@@ -20,9 +20,9 @@
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.hasAnyDescendantThat
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.hasAnyDescendant
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -47,7 +47,7 @@
}
}
- find(hasAnyDescendantThat(hasTestTag("Child")) and hasTestTag("Parent"))
+ onNode(hasAnyDescendant(hasTestTag("Child")) and hasTestTag("Parent"))
.assert(hasTestTag("Parent"))
}
@@ -62,7 +62,7 @@
}
}
- find(hasAnyDescendantThat(hasTestTag("Child")) and !hasTestTag("Parent")
+ onNode(hasAnyDescendant(hasTestTag("Child")) and !hasTestTag("Parent")
and hasTestTag("Grandparent"))
.assert(hasTestTag("Grandparent"))
}
@@ -73,7 +73,7 @@
BoundaryNode(testTag = "Node")
}
- find(hasAnyDescendantThat(hasTestTag("Node")))
+ onNode(hasAnyDescendant(hasTestTag("Node")))
.assertExists() // Root node
}
@@ -89,7 +89,7 @@
}
}
- findAll(hasAnyDescendantThat(hasTestTag("Child")))
+ onAllNodes(hasAnyDescendant(hasTestTag("Child")))
.assertCountEquals(3) // Parent, Parent2 and root
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnySiblingTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnySiblingTest.kt
index c1b4a80..ab87d0f 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnySiblingTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasAnySiblingTest.kt
@@ -20,10 +20,10 @@
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.hasAnySiblingThat
-import androidx.ui.test.hasParentThat
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.hasAnySibling
+import androidx.ui.test.hasParent
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -49,7 +49,7 @@
}
}
- find(hasAnySiblingThat(hasTestTag("Sibling")))
+ onNode(hasAnySibling(hasTestTag("Sibling")))
.assert(hasTestTag("Me"))
}
@@ -64,7 +64,7 @@
}
}
- findAll(hasAnySiblingThat(hasTestTag("Sibling")))
+ onAllNodes(hasAnySibling(hasTestTag("Sibling")))
.assertCountEquals(2)
}
@@ -78,7 +78,7 @@
}
}
- findAll(hasAnySiblingThat(hasTestTag("Sibling")))
+ onAllNodes(hasAnySibling(hasTestTag("Sibling")))
.assertCountEquals(2)
}
@@ -96,7 +96,7 @@
}
}
- findAll(hasAnySiblingThat(hasTestTag("Sibling")))
+ onAllNodes(hasAnySibling(hasTestTag("Sibling")))
.assertCountEquals(2)
}
@@ -108,7 +108,7 @@
}
}
- find(hasAnySiblingThat(hasTestTag("Me")))
+ onNode(hasAnySibling(hasTestTag("Me")))
.assertDoesNotExist()
}
@@ -121,7 +121,7 @@
}
}
- find(hasAnySiblingThat(hasTestTag("Sibling2")))
+ onNode(hasAnySibling(hasTestTag("Sibling2")))
.assertDoesNotExist()
}
@@ -137,7 +137,7 @@
}
}
- find(hasAnySiblingThat(hasTestTag("Sibling")) and hasTestTag("Me"))
+ onNode(hasAnySibling(hasTestTag("Sibling")) and hasTestTag("Me"))
.assertDoesNotExist()
}
@@ -154,7 +154,7 @@
}
}
- find(hasParentThat(hasAnySiblingThat(hasTestTag("ParentSibling"))))
+ onNode(hasParent(hasAnySibling(hasTestTag("ParentSibling"))))
.assert(hasTestTag("Me"))
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasParentTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasParentTest.kt
index d371c54..ec9982ad 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasParentTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/predicates/HasParentTest.kt
@@ -20,9 +20,9 @@
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.hasParentThat
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.hasParent
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -47,7 +47,7 @@
}
}
- find(hasParentThat(hasTestTag("Parent")))
+ onNode(hasParent(hasTestTag("Parent")))
.assert(hasTestTag("Child"))
}
@@ -61,7 +61,7 @@
}
}
- findAll(hasParentThat(hasTestTag("Parent")))
+ onAllNodes(hasParent(hasTestTag("Parent")))
.assertCountEquals(2)
}
@@ -79,7 +79,7 @@
}
}
- findAll(hasParentThat(hasTestTag("Parent")))
+ onAllNodes(hasParent(hasTestTag("Parent")))
.assertCountEquals(4)
}
@@ -93,7 +93,7 @@
}
}
- find(hasParentThat(hasTestTag("Parent"))
+ onNode(hasParent(hasTestTag("Parent"))
and hasTestTag("Child"))
.assertDoesNotExist()
}
@@ -108,7 +108,7 @@
}
}
- find(hasParentThat(hasParentThat(hasTestTag("Parent"))))
+ onNode(hasParent(hasParent(hasTestTag("Parent"))))
.assert(hasTestTag("Child"))
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt
index f76ab14..023c898 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AddIndexSelectorTest.kt
@@ -18,11 +18,11 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
-import androidx.ui.test.childAt
-import androidx.ui.test.children
+import androidx.ui.test.onChildAt
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
-import androidx.ui.test.first
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onFirst
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
@@ -47,9 +47,9 @@
}
}
- findByTag("Parent")
- .children()
- .first()
+ onNodeWithTag("Parent")
+ .onChildren()
+ .onFirst()
.assert(hasTestTag("Child1"))
}
@@ -62,8 +62,8 @@
}
}
- findByTag("Parent")
- .childAt(1)
+ onNodeWithTag("Parent")
+ .onChildAt(1)
.assert(hasTestTag("Child2"))
}
@@ -80,8 +80,8 @@
"Failed: assertExists.\n" +
"Can't retrieve node at index '2' of '(TestTag = 'Parent').children'\n" +
"There are '2' nodes only:") {
- findByTag("Parent")
- .childAt(2)
+ onNodeWithTag("Parent")
+ .onChildAt(2)
.assertExists()
}
}
@@ -92,8 +92,8 @@
BoundaryNode(testTag = "Parent")
}
- findByTag("Parent")
- .childAt(2)
+ onNodeWithTag("Parent")
+ .onChildAt(2)
.assertDoesNotExist()
}
@@ -107,8 +107,8 @@
"Failed: assertExists.\n" +
"Can't retrieve node at index '2' of '(TestTag = 'Parent').children'\n" +
"There are no existing nodes for that selector.") {
- findByTag("Parent")
- .childAt(2)
+ onNodeWithTag("Parent")
+ .onChildAt(2)
.assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt
index b223997..0e1f9b4 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/AncestorsSelectorTest.kt
@@ -17,14 +17,14 @@
package androidx.ui.test.selectors
import androidx.test.filters.MediumTest
-import androidx.ui.test.ancestors
+import androidx.ui.test.onAncestors
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
-import androidx.ui.test.first
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onFirst
import androidx.ui.test.hasTestTag
-import androidx.ui.test.parent
+import androidx.ui.test.onParent
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
import org.junit.Test
@@ -50,8 +50,8 @@
}
}
- findByTag("NodeD")
- .ancestors()
+ onNodeWithTag("NodeD")
+ .onAncestors()
.assertCountEquals(4)
.apply {
get(0).assert(hasTestTag("NodeC"))
@@ -72,10 +72,10 @@
}
}
- findByTag("NodeD")
- .ancestors()
- .first()
- .ancestors()
+ onNodeWithTag("NodeD")
+ .onAncestors()
+ .onFirst()
+ .onAncestors()
.assertCountEquals(3)
.apply {
get(0).assert(hasTestTag("NodeB"))
@@ -89,9 +89,9 @@
BoundaryNode(testTag = "Node")
}
- findByTag("Node")
- .parent()
- .ancestors()
+ onNodeWithTag("Node")
+ .onParent()
+ .onAncestors()
.assertCountEquals(0)
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildSelectorTest.kt
index 0ae4de0..92edb12 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildSelectorTest.kt
@@ -18,9 +18,9 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
-import androidx.ui.test.child
+import androidx.ui.test.onChild
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
@@ -44,8 +44,8 @@
}
}
- findByTag("Parent")
- .child()
+ onNodeWithTag("Parent")
+ .onChild()
.assert(hasTestTag("Child"))
}
@@ -55,8 +55,8 @@
BoundaryNode(testTag = "Parent")
}
- findByTag("Parent")
- .child()
+ onNodeWithTag("Parent")
+ .onChild()
.assertDoesNotExist()
}
@@ -66,8 +66,8 @@
BoundaryNode(testTag = "Parent")
}
- findByTag("Parent")
- .child()
+ onNodeWithTag("Parent")
+ .onChild()
.assertExists()
}
@@ -86,8 +86,8 @@
"((TestTag = 'Parent').child)\n" +
"Nodes found:"
) {
- findByTag("Parent")
- .child()
+ onNodeWithTag("Parent")
+ .onChild()
.assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt
index d03732d..cb78014 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ChildrenSelectorTest.kt
@@ -19,9 +19,9 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -45,8 +45,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertCountEquals(2)
.apply {
get(0).assert(hasTestTag("Child1"))
@@ -60,8 +60,8 @@
BoundaryNode(testTag = "Parent")
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.assertCountEquals(0)
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterSelectorTest.kt
index 871533af..9345588 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterSelectorTest.kt
@@ -19,10 +19,10 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
import androidx.ui.test.filter
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
@@ -46,8 +46,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filter(hasTestTag("Child1"))
.assertCountEquals(1)
.apply {
@@ -64,8 +64,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filter(hasTestTag("Child1") or hasTestTag("Child2"))
.assertCountEquals(2)
.apply {
@@ -83,8 +83,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filter(hasTestTag("Child"))
.assertCountEquals(0)
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterToOneSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterToOneSelectorTest.kt
index 5772435..735f3a9 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterToOneSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/FilterToOneSelectorTest.kt
@@ -18,10 +18,10 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
import androidx.ui.test.filterToOne
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
@@ -46,8 +46,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filterToOne(hasTestTag("Child1"))
.assert(hasTestTag("Child1"))
}
@@ -69,8 +69,8 @@
"Nodes found:\n" +
"1) "
) {
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filterToOne(hasTestTag("Child1") or hasTestTag("Child2"))
.assertExists()
}
@@ -85,8 +85,8 @@
}
}
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filterToOne(hasTestTag("Child"))
.assertDoesNotExist()
}
@@ -104,8 +104,8 @@
"Failed: assertExists.\n" +
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"(((TestTag = 'Parent').children).filterToOne(TestTag = 'Child'))") {
- findByTag("Parent")
- .children()
+ onNodeWithTag("Parent")
+ .onChildren()
.filterToOne(hasTestTag("Child"))
.assertExists()
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/LastNodeSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/LastNodeSelectorTest.kt
index c779481..1ebcc152 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/LastNodeSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/LastNodeSelectorTest.kt
@@ -18,11 +18,11 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
-import androidx.ui.test.last
+import androidx.ui.test.onLast
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
import org.junit.Rule
@@ -46,9 +46,9 @@
}
}
- findByTag("Parent")
- .children()
- .last()
+ onNodeWithTag("Parent")
+ .onChildren()
+ .onLast()
.assert(hasTestTag("Child2"))
}
@@ -58,9 +58,9 @@
BoundaryNode(testTag = "Parent")
}
- findByTag("Parent")
- .children()
- .last()
+ onNodeWithTag("Parent")
+ .onChildren()
+ .onLast()
.assertDoesNotExist()
}
@@ -74,9 +74,9 @@
"Failed: assertExists.\n" +
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"(((TestTag = 'Parent').children).last)") {
- findByTag("Parent")
- .children()
- .last()
+ onNodeWithTag("Parent")
+ .onChildren()
+ .onLast()
.assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ParentSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ParentSelectorTest.kt
index 60baee2..2cec2b7 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ParentSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/ParentSelectorTest.kt
@@ -19,9 +19,9 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
-import androidx.ui.test.parent
+import androidx.ui.test.onParent
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessage
import org.junit.Rule
@@ -44,8 +44,8 @@
}
}
- findByTag("Child")
- .parent()
+ onNodeWithTag("Child")
+ .onParent()
.assert(hasTestTag("Parent"))
}
@@ -55,9 +55,9 @@
BoundaryNode(testTag = "Node")
}
- findByTag("Node")
- .parent()
- .parent()
+ onNodeWithTag("Node")
+ .onParent()
+ .onParent()
.assertDoesNotExist()
}
@@ -72,9 +72,9 @@
"Reason: Expected exactly '1' node but could not find any node that satisfies: " +
"(((TestTag = 'Node').parent).parent)"
) {
- findByTag("Node")
- .parent()
- .parent()
+ onNodeWithTag("Node")
+ .onParent()
+ .onParent()
.assertExists()
}
}
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingSelectorTest.kt
index d4f4796..f019c5f 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingSelectorTest.kt
@@ -19,9 +19,9 @@
import androidx.test.filters.MediumTest
import androidx.ui.test.assert
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
-import androidx.ui.test.sibling
+import androidx.ui.test.onSibling
import androidx.ui.test.util.BoundaryNode
import androidx.ui.test.util.expectErrorMessageStartsWith
import org.junit.Rule
@@ -45,8 +45,8 @@
}
}
- findByTag("Child1")
- .sibling()
+ onNodeWithTag("Child1")
+ .onSibling()
.assert(hasTestTag("Child2"))
}
@@ -67,8 +67,8 @@
"Nodes found:"
) {
- findByTag("Child1")
- .sibling()
+ onNodeWithTag("Child1")
+ .onSibling()
.assert(hasTestTag("Child2"))
}
}
@@ -81,8 +81,8 @@
}
}
- findByTag("Child")
- .sibling()
+ onNodeWithTag("Child")
+ .onSibling()
.assertDoesNotExist()
}
@@ -94,8 +94,8 @@
}
}
- findByTag("Child")
- .sibling()
+ onNodeWithTag("Child")
+ .onSibling()
.assertExists()
}
}
\ No newline at end of file
diff --git a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt
index 568481b..124ad9f 100644
--- a/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt
+++ b/ui/ui-test/src/androidTest/java/androidx/ui/test/selectors/SiblingsSelectorTest.kt
@@ -20,9 +20,9 @@
import androidx.ui.test.assert
import androidx.ui.test.assertCountEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasTestTag
-import androidx.ui.test.siblings
+import androidx.ui.test.onSiblings
import androidx.ui.test.util.BoundaryNode
import org.junit.Rule
import org.junit.Test
@@ -44,8 +44,8 @@
}
}
- findByTag("Child")
- .siblings()
+ onNodeWithTag("Child")
+ .onSiblings()
.assertCountEquals(0)
}
@@ -58,8 +58,8 @@
}
}
- findByTag("Child1")
- .siblings()
+ onNodeWithTag("Child1")
+ .onSiblings()
.assertCountEquals(1)
}
@@ -73,8 +73,8 @@
}
}
- findByTag("Child2")
- .siblings()
+ onNodeWithTag("Child2")
+ .onSiblings()
.assertCountEquals(2)
.apply {
get(0).assert(hasTestTag("Child1"))