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/integration-tests/demos/src/androidTest/java/androidx/ui/demos/test/DemoTest.kt b/ui/integration-tests/demos/src/androidTest/java/androidx/ui/demos/test/DemoTest.kt
index dcfa88c..def3e38 100644
--- a/ui/integration-tests/demos/src/androidTest/java/androidx/ui/demos/test/DemoTest.kt
+++ b/ui/integration-tests/demos/src/androidTest/java/androidx/ui/demos/test/DemoTest.kt
@@ -30,12 +30,12 @@
import androidx.ui.test.SemanticsNodeInteractionCollection
import androidx.ui.test.android.AndroidComposeTestRule
import androidx.ui.test.assertTextEquals
-import androidx.ui.test.doClick
-import androidx.ui.test.doScrollTo
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.performScrollTo
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.hasClickAction
import androidx.ui.test.hasText
import androidx.ui.test.isDialog
@@ -60,7 +60,7 @@
fun testFiltering() {
assertIsOnRootScreen()
// Enter filtering mode
- findByTag(Tags.FilterButton).doClick()
+ onNodeWithTag(Tags.FilterButton).performClick()
waitForIdle()
composeTestRule.clockTestRule.advanceClock(5000)
@@ -73,7 +73,7 @@
.first()
// Click on the first demo
val demoTitle = testDemo.title
- findByText(demoTitle).doScrollTo().doClick()
+ onNodeWithText(demoTitle).performScrollTo().performClick()
waitForIdle()
assertAppBarHasTitle(demoTitle)
@@ -156,10 +156,10 @@
path.drop(1).joinToString(" > ")
}
- find(hasText(title) and hasClickAction())
+ onNode(hasText(title) and hasClickAction())
.assertExists("Couldn't find \"$title\" in \"$navigationTitle\"")
- .doScrollTo()
- .doClick()
+ .performScrollTo()
+ .performClick()
waitForIdle()
composeTestRule.clockTestRule.advanceClock(5000)
@@ -174,7 +174,7 @@
// Don't `findAll` in WebComponentActivity, it doesn't have an AndroidOwner
if (title != "WebComponent") {
- while (findAll(isDialog()).isNotEmpty()) {
+ while (onAllNodes(isDialog()).isNotEmpty()) {
waitForIdle()
Espresso.pressBack()
}
@@ -199,7 +199,7 @@
* Asserts that the app bar title matches the given [title].
*/
private fun assertAppBarHasTitle(title: String) =
- findByTag(Tags.AppBarTitle).assertTextEquals(title)
+ onNodeWithTag(Tags.AppBarTitle).assertTextEquals(title)
private fun SemanticsNodeInteractionCollection.isNotEmpty(): Boolean {
return fetchSemanticsNodes().isNotEmpty()
diff --git a/ui/integration-tests/src/androidTest/java/androidx/ui/integration/test/VectorAssetTest.kt b/ui/integration-tests/src/androidTest/java/androidx/ui/integration/test/VectorAssetTest.kt
index db585d6..f770f26 100644
--- a/ui/integration-tests/src/androidTest/java/androidx/ui/integration/test/VectorAssetTest.kt
+++ b/ui/integration-tests/src/androidTest/java/androidx/ui/integration/test/VectorAssetTest.kt
@@ -24,7 +24,7 @@
import androidx.ui.integration.test.framework.ProgrammaticVectorTestCase
import androidx.ui.integration.test.framework.XmlVectorTestCase
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import org.junit.Assert.assertArrayEquals
import org.junit.Assert.assertEquals
import org.junit.Rule
@@ -55,8 +55,8 @@
}
}
- val xmlBitmap = findByTag(xmlTestCase.testTag).captureToBitmap()
- val programmaticBitmap = findByTag(programmaticTestCase.testTag).captureToBitmap()
+ val xmlBitmap = onNodeWithTag(xmlTestCase.testTag).captureToBitmap()
+ val programmaticBitmap = onNodeWithTag(programmaticTestCase.testTag).captureToBitmap()
assertEquals(xmlBitmap.width, programmaticBitmap.width)
assertEquals(xmlBitmap.height, programmaticBitmap.height)
diff --git a/ui/ui-animation/src/androidAndroidTest/kotlin/androidx/ui/animation/CrossfadeTest.kt b/ui/ui-animation/src/androidAndroidTest/kotlin/androidx/ui/animation/CrossfadeTest.kt
index 23a3cc7..6a5881f 100644
--- a/ui/ui-animation/src/androidAndroidTest/kotlin/androidx/ui/animation/CrossfadeTest.kt
+++ b/ui/ui-animation/src/androidAndroidTest/kotlin/androidx/ui/animation/CrossfadeTest.kt
@@ -25,7 +25,7 @@
import androidx.test.filters.MediumTest
import androidx.ui.foundation.Text
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByText
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.waitForIdle
import org.junit.Assert.assertTrue
@@ -53,7 +53,7 @@
}
composeTestRule.clockTestRule.advanceClock(DefaultDurationMillis.toLong())
- findByText(First).assertExists()
+ onNodeWithText(First).assertExists()
}
@Test
@@ -84,8 +84,8 @@
assertTrue(disposed)
}
- findByText(First).assertDoesNotExist()
- findByText(Second).assertExists()
+ onNodeWithText(First).assertDoesNotExist()
+ onNodeWithText(Second).assertExists()
}
@Test
@@ -133,8 +133,8 @@
}
composeTestRule.clockTestRule.advanceClock(DefaultDurationMillis.toLong())
- findByText(First).assertExists()
- findByText(Second).assertDoesNotExist()
+ onNodeWithText(First).assertExists()
+ onNodeWithText(Second).assertDoesNotExist()
runOnIdleCompose {
current = "other"
@@ -144,8 +144,8 @@
composeTestRule.clockTestRule.advanceClock(DefaultDurationMillis.toLong())
- findByText(First).assertDoesNotExist()
- findByText(Second).assertExists()
+ onNodeWithText(First).assertDoesNotExist()
+ onNodeWithText(Second).assertExists()
}
companion object {
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/HotReloadTests.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/HotReloadTests.kt
index b2ebce3..2c1232f 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/HotReloadTests.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/HotReloadTests.kt
@@ -33,7 +33,7 @@
import androidx.ui.semantics.accessibilityLabel
import androidx.ui.test.android.AndroidComposeTestRule
import androidx.ui.test.assertLabelEquals
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnUiThread
import org.junit.After
import org.junit.Assert.assertEquals
@@ -147,7 +147,7 @@
assertTrue(composeLatch.await(1, TimeUnit.SECONDS))
- fun target() = findByTag("text103")
+ fun target() = onNodeWithTag("text103")
// Assert that the composition has the correct value
target().assertLabelEquals(value)
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/PainterModifierTest.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/PainterModifierTest.kt
index c80b9e4..575ebc1f 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/PainterModifierTest.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/PainterModifierTest.kt
@@ -58,7 +58,7 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findRoot
+import androidx.ui.test.onRoot
import org.junit.Assert
import org.junit.Assert.assertEquals
import org.junit.Rule
@@ -447,7 +447,7 @@
)
}
- findRoot()
+ onRoot()
.assertWidthIsEqualTo(composableWidth.dp)
.assertHeightIsEqualTo(composableHeight.dp)
}
@@ -567,7 +567,7 @@
}
private fun obtainScreenshotBitmap(width: Int, height: Int = width): Bitmap {
- val bitmap = findRoot().captureToBitmap()
+ val bitmap = onRoot().captureToBitmap()
Assert.assertEquals(width, bitmap.width)
Assert.assertEquals(height, bitmap.height)
return bitmap
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/keyinput/ProcessKeyInputTest.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/keyinput/ProcessKeyInputTest.kt
index b6545e7..ec6dd86 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/keyinput/ProcessKeyInputTest.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/keyinput/ProcessKeyInputTest.kt
@@ -24,8 +24,8 @@
import androidx.ui.core.keyinput.KeyEventType.KeyUp
import androidx.ui.foundation.Box
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doSendKeyEvent
-import androidx.ui.test.findRoot
+import androidx.ui.test.onRoot
+import androidx.ui.test.performKeyPress
import androidx.ui.test.runOnIdleCompose
import com.google.common.truth.Truth.assertThat
import org.junit.Rule
@@ -48,7 +48,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
}
@Test(expected = IllegalStateException::class)
@@ -59,7 +59,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
}
@Test(expected = IllegalStateException::class)
@@ -71,7 +71,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
}
@Test
@@ -87,7 +87,7 @@
}
// Act.
- val keyConsumed = findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ val keyConsumed = onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -114,7 +114,7 @@
}
// Act.
- val keyConsumed = findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ val keyConsumed = onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -142,7 +142,7 @@
}
// Act.
- val keyConsumed = findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ val keyConsumed = onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -176,7 +176,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -211,7 +211,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -260,7 +260,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -311,7 +311,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
@@ -376,7 +376,7 @@
}
// Act.
- findRoot().doSendKeyEvent(keyEvent(A, KeyUp))
+ onRoot().performKeyPress(keyEvent(A, KeyUp))
// Assert.
runOnIdleCompose {
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/AndroidViewCompatTest.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/AndroidViewCompatTest.kt
index dfc6f93..4c34346 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/AndroidViewCompatTest.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/AndroidViewCompatTest.kt
@@ -81,7 +81,7 @@
import androidx.ui.test.assertIsDisplayed
import androidx.ui.test.assertPixels
import androidx.ui.test.captureToBitmap
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
import androidx.ui.unit.IntOffset
@@ -142,7 +142,7 @@
}
}
}
- findByTag("content").assertIsDisplayed()
+ onNodeWithTag("content").assertIsDisplayed()
val squareView = squareRef.value
assertNotNull(squareView)
Espresso
@@ -155,7 +155,7 @@
squareSize.value = 200
expectedSize = 200
}
- findByTag("content").assertIsDisplayed()
+ onNodeWithTag("content").assertIsDisplayed()
Espresso
.onView(instanceOf(ColoredSquareView::class.java))
.check(matches(isDescendantOfA(instanceOf(Owner::class.java))))
@@ -166,7 +166,7 @@
squareView!!.size = 300
expectedSize = 300
}
- findByTag("content").assertIsDisplayed()
+ onNodeWithTag("content").assertIsDisplayed()
Espresso
.onView(instanceOf(ColoredSquareView::class.java))
.check(matches(isDescendantOfA(instanceOf(Owner::class.java))))
@@ -203,7 +203,7 @@
Color.White
}
}
- findByTag("content")
+ onNodeWithTag("content")
.assertIsDisplayed()
.captureToBitmap()
.assertPixels(expectedColorProvider = expectedPixelColor)
@@ -217,7 +217,7 @@
.onView(instanceOf(ColoredSquareView::class.java))
.check(matches(isDescendantOfA(instanceOf(Owner::class.java))))
.check(matches(`is`(squareView)))
- findByTag("content")
+ onNodeWithTag("content")
.assertIsDisplayed()
.captureToBitmap()
.assertPixels(expectedColorProvider = expectedPixelColor)
@@ -231,7 +231,7 @@
.onView(instanceOf(ColoredSquareView::class.java))
.check(matches(isDescendantOfA(instanceOf(Owner::class.java))))
.check(matches(`is`(squareView)))
- findByTag("content")
+ onNodeWithTag("content")
.assertIsDisplayed()
.captureToBitmap()
.assertPixels(expectedColorProvider = expectedPixelColor)
@@ -425,13 +425,13 @@
view.setBackgroundColor(android.graphics.Color.BLUE)
}
}
- findByTag("view").captureToBitmap().assertPixels(IntSize(size, size)) { Color.Blue }
+ onNodeWithTag("view").captureToBitmap().assertPixels(IntSize(size, size)) { Color.Blue }
runOnIdleCompose { size += 20 }
- findByTag("view").captureToBitmap().assertPixels(IntSize(size, size)) { Color.Blue }
+ onNodeWithTag("view").captureToBitmap().assertPixels(IntSize(size, size)) { Color.Blue }
runOnIdleCompose { size += 20 }
- findByTag("view").captureToBitmap().assertPixels(IntSize(size, size)) { Color.Blue }
+ onNodeWithTag("view").captureToBitmap().assertPixels(IntSize(size, size)) { Color.Blue }
}
@Test
@@ -551,7 +551,7 @@
}
}
- findByTag("box").captureToBitmap().assertPixels(
+ onNodeWithTag("box").captureToBitmap().assertPixels(
IntSize((padding * 2 + size * 2).roundToInt(), (padding * 2 + size).roundToInt())
) { offset ->
if (offset.y < padding || offset.y >= padding + size || offset.x < padding ||
@@ -641,11 +641,13 @@
}
}
- findByTag("view").captureToBitmap().assertPixels(IntSize(sizePx, sizePx)) { Color.Green }
+ onNodeWithTag("view")
+ .captureToBitmap().assertPixels(IntSize(sizePx, sizePx)) { Color.Green }
runOnIdleCompose { first = false }
- findByTag("view").captureToBitmap().assertPixels(IntSize(sizePx, sizePx)) { Color.Blue }
+ onNodeWithTag("view")
+ .captureToBitmap().assertPixels(IntSize(sizePx, sizePx)) { Color.Blue }
}
@Test
@@ -677,14 +679,14 @@
}
}
- findByTag("view").captureToBitmap()
+ onNodeWithTag("view").captureToBitmap()
.assertPixels(IntSize(sizePx * 2, sizePx)) {
if (it.x < sizePx) Color.Green else Color.Blue
}
runOnIdleCompose { first = false }
- findByTag("view").captureToBitmap()
+ onNodeWithTag("view").captureToBitmap()
.assertPixels(IntSize(sizePx * 2, sizePx)) {
if (it.x < sizePx) Color.Blue else Color.Green
}
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/LayerTouchTransformTest.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/LayerTouchTransformTest.kt
index c6b4706..a31936b 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/LayerTouchTransformTest.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/core/test/LayerTouchTransformTest.kt
@@ -38,9 +38,9 @@
import androidx.ui.layout.preferredSize
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.findByTag
-import androidx.ui.test.sendDown
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.down
import androidx.ui.geometry.Offset
import androidx.ui.unit.dp
import org.junit.Assert
@@ -122,7 +122,7 @@
// its bounds
val mappedPosition = Offset(342.0f, 168.0f)
- val node = findByTag(testTag).doPartialGesture { sendDown(mappedPosition) }
+ val node = onNodeWithTag(testTag).performPartialGesture { down(mappedPosition) }
latch = CountDownLatch(1).apply {
await(5, TimeUnit.SECONDS)
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
index cd1a1cd..0480a00 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
@@ -30,11 +30,11 @@
import androidx.ui.test.assertLabelEquals
import androidx.ui.test.assertValueEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findAllByText
-import androidx.ui.test.findByTag
+import androidx.ui.test.onAllNodesWithText
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.assert
-import androidx.ui.test.findAllByLabel
-import androidx.ui.test.findByLabel
+import androidx.ui.test.onAllNodesWithLabel
+import androidx.ui.test.onNodeWithLabel
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
import com.google.common.truth.Truth.assertThat
@@ -78,8 +78,8 @@
}
}
- findByTag(tag1).assertLabelEquals(label1)
- findByTag(tag2).assertLabelEquals(label2)
+ onNodeWithTag(tag1).assertLabelEquals(label1)
+ onNodeWithTag(tag2).assertLabelEquals(label2)
}
@Test
@@ -94,13 +94,13 @@
}
}
- findByTag(TestTag).assertLabelEquals(label)
+ onNodeWithTag(TestTag).assertLabelEquals(label)
runOnIdleCompose { showSubtree.value = false }
- findByTag(TestTag).assertDoesNotHaveProperty(SemanticsProperties.AccessibilityLabel)
+ onNodeWithTag(TestTag).assertDoesNotHaveProperty(SemanticsProperties.AccessibilityLabel)
- findAllByText(label).assertCountEquals(0)
+ onAllNodesWithText(label).assertCountEquals(0)
}
@Test
@@ -117,13 +117,13 @@
}
}
- findByTag(TestTag)
+ onNodeWithTag(TestTag)
.assertLabelEquals(label)
.assertDoesNotHaveProperty(SemanticsProperties.AccessibilityValue)
runOnIdleCompose { showNewNode.value = true }
- findByTag(TestTag)
+ onNodeWithTag(TestTag)
.assertLabelEquals(label)
.assertValueEquals(value)
}
@@ -140,13 +140,13 @@
}
}
- findAllByLabel(label).assertCountEquals(1)
+ onAllNodesWithLabel(label).assertCountEquals(1)
runOnIdleCompose {
showSubtree.value = false
}
- findAllByLabel(label).assertCountEquals(0)
+ onAllNodesWithLabel(label).assertCountEquals(0)
}
@Test
@@ -160,11 +160,11 @@
) {}
}
- findByTag(TestTag).assertLabelEquals(beforeLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(beforeLabel)
runOnIdleCompose { isAfter.value = true }
- findByTag(TestTag).assertLabelEquals(afterLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(afterLabel)
}
@Test
@@ -181,11 +181,11 @@
}
}
- findByTag(TestTag).assertLabelEquals(beforeLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(beforeLabel)
runOnIdleCompose { isAfter.value = true }
- findByTag(TestTag).assertLabelEquals(afterLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(afterLabel)
}
@Test
@@ -204,11 +204,11 @@
}
}
- findByTag(TestTag).assertLabelEquals(beforeLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(beforeLabel)
runOnIdleCompose { isAfter.value = true }
- findByTag(TestTag).assertLabelEquals(afterLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(afterLabel)
}
@Test
@@ -225,11 +225,11 @@
}
}
- findByTag(TestTag).assertLabelEquals(beforeLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(beforeLabel)
runOnIdleCompose { isAfter.value = true }
- findByTag(TestTag).assertLabelEquals(afterLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(afterLabel)
}
@Test
@@ -243,8 +243,8 @@
}
}
- findByTag(TestTag).assertDoesNotHaveProperty(SemanticsProperties.AccessibilityLabel)
- findByLabel(label) // assert exists
+ onNodeWithTag(TestTag).assertDoesNotHaveProperty(SemanticsProperties.AccessibilityLabel)
+ onNodeWithLabel(label) // assert exists
}
@Test
@@ -265,11 +265,11 @@
}
}
- findByTag(TestTag).assertLabelEquals(beforeLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(beforeLabel)
runOnIdleCompose { isAfter.value = true }
- findByTag(TestTag).assertLabelEquals(afterLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(afterLabel)
}
@Test
@@ -300,13 +300,13 @@
}
// This isn't the important part, just makes sure everything is behaving as expected
- findByTag(TestTag).assertLabelEquals(beforeLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(beforeLabel)
assertThat(nodeCount).isEqualTo(1)
runOnIdleCompose { isAfter.value = true }
// Make sure everything is still behaving as expected
- findByTag(TestTag).assertLabelEquals(afterLabel)
+ onNodeWithTag(TestTag).assertLabelEquals(afterLabel)
// This is the important part: make sure we didn't replace the identity due to unwanted
// pivotal properties
assertThat(nodeCount).isEqualTo(1)
diff --git a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/viewinterop/ComposedViewTest.kt b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/viewinterop/ComposedViewTest.kt
index c435b9d..baf05e4 100644
--- a/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/viewinterop/ComposedViewTest.kt
+++ b/ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/viewinterop/ComposedViewTest.kt
@@ -45,7 +45,7 @@
import androidx.ui.test.android.AndroidComposeTestRule
import androidx.ui.test.assertPixels
import androidx.ui.test.captureToBitmap
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
import androidx.ui.unit.Dp
@@ -189,7 +189,7 @@
AndroidView(frameLayout, Modifier.testTag("view").drawBackground(Color.Blue))
}
- findByTag("view").captureToBitmap().assertPixels(IntSize(size, size)) {
+ onNodeWithTag("view").captureToBitmap().assertPixels(IntSize(size, size)) {
Color.Blue
}
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BorderTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BorderTest.kt
index ced47c0..8c84233 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BorderTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BorderTest.kt
@@ -34,7 +34,7 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.Density
import org.junit.Rule
import org.junit.Test
@@ -71,7 +71,7 @@
) {}
}
}
- val bitmap = findByTag(testTag).captureToBitmap()
+ val bitmap = onNodeWithTag(testTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.Red,
@@ -98,7 +98,7 @@
) {}
}
}
- val bitmap = findByTag(testTag).captureToBitmap()
+ val bitmap = onNodeWithTag(testTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.Red,
@@ -122,7 +122,7 @@
) {}
}
}
- val bitmap = findByTag(testTag).captureToBitmap()
+ val bitmap = onNodeWithTag(testTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.White,
@@ -144,7 +144,7 @@
) {}
}
}
- val bitmap = findByTag(testTag).captureToBitmap()
+ val bitmap = onNodeWithTag(testTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.White,
@@ -170,7 +170,7 @@
}
}
}
- val bitmap = findByTag(testTag).captureToBitmap()
+ val bitmap = onNodeWithTag(testTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.White,
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BoxTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BoxTest.kt
index 5932bdb..107359e 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BoxTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/BoxTest.kt
@@ -39,7 +39,7 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.geometry.Offset
import androidx.ui.unit.Density
import androidx.ui.unit.IntSize
@@ -258,7 +258,7 @@
)
}
}
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(composeTestRule.density, RectangleShape, Color.Red, Color.Red)
}
@@ -278,7 +278,7 @@
}
}
with(composeTestRule.density) {
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
shape = RectangleShape,
@@ -306,7 +306,7 @@
}
}
with(composeTestRule.density) {
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
shape = CircleShape,
@@ -333,7 +333,7 @@
}
}
with(composeTestRule.density) {
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
shape = RectangleShape,
@@ -366,7 +366,7 @@
}
}
with(composeTestRule.density) {
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
shape = CircleShape,
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt
index 670b858..2e8143b 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/CanvasTest.kt
@@ -34,7 +34,7 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findRoot
+import androidx.ui.test.onRoot
import androidx.ui.unit.dp
import org.junit.Assert
import org.junit.Rule
@@ -80,7 +80,7 @@
val paintBoxColor = Color.Red.toArgb()
val containerBgColor = Color.White.toArgb()
val strokeOffset = (strokeWidth / 2).toInt() + 3
- findRoot().captureToBitmap().apply {
+ onRoot().captureToBitmap().apply {
val imageStartX = width / 2 - boxWidth / 2
val imageStartY = height / 2 - boxHeight / 2
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTest.kt
index bbc906e..a0d18c7 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTest.kt
@@ -29,16 +29,16 @@
import androidx.ui.test.assertIsNotEnabled
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doGesture
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendClick
-import androidx.ui.test.sendDoubleClick
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendLongClick
-import androidx.ui.test.sendUp
+import androidx.ui.test.click
+import androidx.ui.test.doubleClick
+import androidx.ui.test.down
+import androidx.ui.test.longClick
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.up
import com.google.common.truth.Truth.assertThat
import org.junit.Rule
import org.junit.Test
@@ -62,7 +62,7 @@
}
}
- findByTag("myClickable")
+ onNodeWithTag("myClickable")
.assertIsEnabled()
.assertHasClickAction()
}
@@ -78,7 +78,7 @@
}
}
- findByTag("myClickable")
+ onNodeWithTag("myClickable")
.assertIsNotEnabled()
.assertHasNoClickAction()
}
@@ -97,15 +97,15 @@
}
}
- findByTag("myClickable")
- .doClick()
+ onNodeWithTag("myClickable")
+ .performClick()
runOnIdleCompose {
assertThat(counter).isEqualTo(1)
}
- findByTag("myClickable")
- .doClick()
+ onNodeWithTag("myClickable")
+ .performClick()
runOnIdleCompose {
assertThat(counter).isEqualTo(2)
@@ -126,18 +126,18 @@
}
}
- findByTag("myClickable")
- .doGesture {
- sendLongClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ longClick()
}
runOnIdleCompose {
assertThat(counter).isEqualTo(1)
}
- findByTag("myClickable")
- .doGesture {
- sendLongClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ longClick()
}
runOnIdleCompose {
@@ -166,9 +166,9 @@
}
}
- findByTag("myClickable")
- .doGesture {
- sendClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ click()
}
runOnIdleCompose {
@@ -176,9 +176,9 @@
assertThat(longClickCounter).isEqualTo(0)
}
- findByTag("myClickable")
- .doGesture {
- sendLongClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ longClick()
}
runOnIdleCompose {
@@ -208,8 +208,8 @@
}
}
- findByTag("myClickable")
- .doClick()
+ onNodeWithTag("myClickable")
+ .performClick()
val res = clickLatch.await(1000, TimeUnit.MILLISECONDS)
runOnIdleCompose {
@@ -217,9 +217,9 @@
assertThat(res).isTrue()
}
- findByTag("myClickable")
- .doGesture {
- sendDoubleClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ doubleClick()
}
runOnIdleCompose {
@@ -252,8 +252,8 @@
}
}
- findByTag("myClickable")
- .doClick()
+ onNodeWithTag("myClickable")
+ .performClick()
val res = clickLatch.await(1000, TimeUnit.MILLISECONDS)
runOnIdleCompose {
@@ -262,9 +262,9 @@
assertThat(res).isTrue()
}
- findByTag("myClickable")
- .doGesture {
- sendDoubleClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ doubleClick()
}
runOnIdleCompose {
@@ -273,9 +273,9 @@
assertThat(clickLatch.await(1000, TimeUnit.MILLISECONDS)).isTrue()
}
- findByTag("myClickable")
- .doGesture {
- sendLongClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ longClick()
}
runOnIdleCompose {
@@ -299,18 +299,18 @@
}
}
- findByTag("myClickable")
- .doGesture {
- sendDoubleClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ doubleClick()
}
runOnIdleCompose {
assertThat(counter).isEqualTo(1)
}
- findByTag("myClickable")
- .doGesture {
- sendDoubleClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ doubleClick()
}
runOnIdleCompose {
@@ -337,15 +337,15 @@
assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
}
- findByTag("myClickable")
- .doPartialGesture { sendDown(center) }
+ onNodeWithTag("myClickable")
+ .performPartialGesture { down(center) }
runOnIdleCompose {
assertThat(interactionState.value).contains(Interaction.Pressed)
}
- findByTag("myClickable")
- .doPartialGesture { sendUp() }
+ onNodeWithTag("myClickable")
+ .performPartialGesture { up() }
runOnIdleCompose {
assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
@@ -374,8 +374,8 @@
assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
}
- findByTag("myClickable")
- .doPartialGesture { sendDown(center) }
+ onNodeWithTag("myClickable")
+ .performPartialGesture { down(center) }
runOnIdleCompose {
assertThat(interactionState.value).contains(Interaction.Pressed)
@@ -417,8 +417,8 @@
}
}
- findByTag("myClickable")
- .doClick()
+ onNodeWithTag("myClickable")
+ .performClick()
runOnIdleCompose {
assertThat(doubleClickCounter).isEqualTo(0)
@@ -426,9 +426,9 @@
assertThat(clickLatch.count).isEqualTo(1)
}
- findByTag("myClickable")
- .doGesture {
- sendDoubleClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ doubleClick()
}
runOnIdleCompose {
@@ -437,9 +437,9 @@
assertThat(clickLatch.count).isEqualTo(1)
}
- findByTag("myClickable")
- .doGesture {
- sendLongClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ longClick()
}
runOnIdleCompose {
@@ -449,8 +449,8 @@
enabled.value = true
}
- findByTag("myClickable")
- .doClick()
+ onNodeWithTag("myClickable")
+ .performClick()
val res = clickLatch.await(1000, TimeUnit.MILLISECONDS)
runOnIdleCompose {
@@ -459,9 +459,9 @@
assertThat(res).isTrue()
}
- findByTag("myClickable")
- .doGesture {
- sendDoubleClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ doubleClick()
}
runOnIdleCompose {
@@ -470,9 +470,9 @@
assertThat(clickLatch.await(1000, TimeUnit.MILLISECONDS)).isTrue()
}
- findByTag("myClickable")
- .doGesture {
- sendLongClick()
+ onNodeWithTag("myClickable")
+ .performGesture {
+ longClick()
}
runOnIdleCompose {
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTextTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTextTest.kt
index aa721f3..3e44c68 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTextTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ClickableTextTest.kt
@@ -20,8 +20,8 @@
import androidx.ui.core.Modifier
import androidx.ui.core.testTag
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
import androidx.ui.text.AnnotatedString
import com.nhaarman.mockitokotlin2.any
@@ -50,7 +50,7 @@
)
}
- findByTag("clickableText").doClick()
+ onNodeWithTag("clickableText").performClick()
runOnIdleCompose {
verify(onClick, times(1)).invoke(any())
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt
index 7f67e6b..e052952 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DeterminateProgressTest.kt
@@ -26,7 +26,7 @@
import androidx.ui.test.assertRangeInfoEquals
import androidx.ui.test.assertValueEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnUiThread
import androidx.ui.unit.dp
import org.junit.Rule
@@ -55,7 +55,7 @@
.drawBackground(Color.Cyan))
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals("0 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0f, 0f..1f))
@@ -63,7 +63,7 @@
progress.value = 0.005f
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals("1 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0.005f, 0f..1f))
@@ -71,7 +71,7 @@
progress.value = 0.5f
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals("50 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0.5f, 0f..1f))
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DialogUiTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DialogUiTest.kt
index dbce2e5..4125093 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DialogUiTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DialogUiTest.kt
@@ -24,8 +24,8 @@
import androidx.ui.core.Modifier
import androidx.ui.test.assertIsDisplayed
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.runOnIdleCompose
import org.junit.Assert.assertEquals
import org.junit.Ignore
@@ -54,7 +54,7 @@
}
}
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
}
@Test
@@ -80,15 +80,15 @@
}
}
- findByText(textBeforeClick)
+ onNodeWithText(textBeforeClick)
.assertIsDisplayed()
// Click inside the dialog
- .doClick()
+ .performClick()
// Check that the Clickable was pressed and that the Dialog is still visible, but with
// the new text
- findByText(textBeforeClick).assertDoesNotExist()
- findByText(textAfterClick).assertIsDisplayed()
+ onNodeWithText(textBeforeClick).assertDoesNotExist()
+ onNodeWithText(textAfterClick).assertIsDisplayed()
}
@Test
@@ -103,14 +103,14 @@
}
}
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
// Click outside the dialog to dismiss it
val outsideX = 0
val outsideY = composeTestRule.displayMetrics.heightPixels / 2
UiDevice.getInstance(getInstrumentation()).click(outsideX, outsideY)
- findByText(defaultText).assertDoesNotExist()
+ onNodeWithText(defaultText).assertDoesNotExist()
}
@Test
@@ -125,7 +125,7 @@
}
}
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
// Click outside the dialog to try to dismiss it
val outsideX = 0
@@ -133,7 +133,7 @@
UiDevice.getInstance(getInstrumentation()).click(outsideX, outsideY)
// The Dialog should still be visible
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
}
@Test
@@ -148,12 +148,12 @@
}
}
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
// Click the back button to dismiss the Dialog
UiDevice.getInstance(getInstrumentation()).pressBack()
- findByText(defaultText).assertDoesNotExist()
+ onNodeWithText(defaultText).assertDoesNotExist()
}
// TODO(pavlis): Espresso loses focus on the dialog after back press. That makes the
@@ -171,13 +171,13 @@
}
}
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
// Click the back button to try to dismiss the dialog
UiDevice.getInstance(getInstrumentation()).pressBack()
// The Dialog should still be visible
- findByText(defaultText).assertIsDisplayed()
+ onNodeWithText(defaultText).assertIsDisplayed()
}
@Test
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DraggableTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DraggableTest.kt
index 29cacf7..7d3f71f 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DraggableTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DraggableTest.kt
@@ -29,15 +29,15 @@
import androidx.ui.layout.preferredSize
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performGesture
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendMoveBy
-import androidx.ui.test.sendSwipe
-import androidx.ui.test.sendSwipeWithVelocity
-import androidx.ui.test.sendUp
+import androidx.ui.test.down
+import androidx.ui.test.moveBy
+import androidx.ui.test.swipe
+import androidx.ui.test.swipeWithVelocity
+import androidx.ui.test.up
import androidx.ui.test.size
import androidx.ui.geometry.Offset
import androidx.ui.unit.dp
@@ -69,8 +69,8 @@
}
)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -80,8 +80,8 @@
assertThat(total).isGreaterThan(0)
total
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x, this.center.y + 100f),
duration = 100.milliseconds
@@ -90,8 +90,8 @@
runOnIdleCompose {
assertThat(total).isEqualTo(lastTotal)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x - 100f, this.center.y),
duration = 100.milliseconds
@@ -114,8 +114,8 @@
}
)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x, this.center.y + 100f),
duration = 100.milliseconds
@@ -125,8 +125,8 @@
assertThat(total).isGreaterThan(0)
total
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -135,8 +135,8 @@
runOnIdleCompose {
assertThat(total).isEqualTo(lastTotal)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x, this.center.y - 100f),
duration = 100.milliseconds
@@ -169,8 +169,8 @@
assertThat(startTrigger).isEqualTo(0)
assertThat(stopTrigger).isEqualTo(0)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -196,8 +196,8 @@
enabled = enabled.value
)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -208,8 +208,8 @@
enabled.value = false
total
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -234,8 +234,8 @@
}
)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipeWithVelocity(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipeWithVelocity(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
endVelocity = 112f,
@@ -261,8 +261,8 @@
startDragImmediately = true
)
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -291,8 +291,8 @@
)
} else Modifier
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -334,8 +334,8 @@
}
}
}
- findByTag(draggableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(draggableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 200f, this.center.y),
duration = 300.milliseconds
@@ -364,19 +364,19 @@
assertThat(interactionState.value).doesNotContain(Interaction.Dragged)
}
- findByTag(draggableBoxTag)
- .doPartialGesture {
- sendDown(Offset(size.width / 4f, size.height / 2f))
- sendMoveBy(Offset(size.width / 2f, 0f))
+ onNodeWithTag(draggableBoxTag)
+ .performPartialGesture {
+ down(Offset(size.width / 4f, size.height / 2f))
+ moveBy(Offset(size.width / 2f, 0f))
}
runOnIdleCompose {
assertThat(interactionState.value).contains(Interaction.Dragged)
}
- findByTag(draggableBoxTag)
- .doPartialGesture {
- sendUp()
+ onNodeWithTag(draggableBoxTag)
+ .performPartialGesture {
+ up()
}
runOnIdleCompose {
@@ -408,10 +408,10 @@
assertThat(interactionState.value).doesNotContain(Interaction.Dragged)
}
- findByTag(draggableBoxTag)
- .doPartialGesture {
- sendDown(Offset(size.width / 4f, size.height / 2f))
- sendMoveBy(Offset(size.width / 2f, 0f))
+ onNodeWithTag(draggableBoxTag)
+ .performPartialGesture {
+ down(Offset(size.width / 4f, size.height / 2f))
+ moveBy(Offset(size.width / 2f, 0f))
}
runOnIdleCompose {
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DrawBackgroundTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DrawBackgroundTest.kt
index 81cd2ad..bee152a 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DrawBackgroundTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/DrawBackgroundTest.kt
@@ -32,7 +32,7 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.Density
import org.junit.Rule
import org.junit.Test
@@ -61,7 +61,7 @@
}
}
}
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.Magenta,
@@ -87,7 +87,7 @@
}
}
}
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.Magenta,
@@ -109,7 +109,7 @@
)
}
}
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.Magenta,
@@ -133,7 +133,7 @@
)
}
}
- val bitmap = findByTag(contentTag).captureToBitmap()
+ val bitmap = onNodeWithTag(contentTag).captureToBitmap()
bitmap.assertShape(
density = composeTestRule.density,
backgroundColor = Color.Magenta,
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/FoundationTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/FoundationTest.kt
index 5ed7fc0..6326641 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/FoundationTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/FoundationTest.kt
@@ -24,7 +24,7 @@
import androidx.ui.layout.preferredSizeIn
import androidx.ui.test.ComposeTestRule
import androidx.ui.test.SemanticsNodeInteraction
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
/**
@@ -46,5 +46,5 @@
}
}
- return findByTag("containerForSizeAssertion")
+ return onNodeWithTag("containerForSizeAssertion")
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt
index e2f1abf..11d3fba 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ImageTest.kt
@@ -40,8 +40,8 @@
import androidx.ui.res.loadVectorResource
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
-import androidx.ui.test.findRoot
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onRoot
import androidx.ui.unit.IntOffset
import androidx.ui.unit.IntSize
import androidx.ui.unit.dp
@@ -112,7 +112,7 @@
val bgColorArgb = bgColor.toArgb()
val pathArgb = pathColor.toArgb()
- findByTag(contentTag).captureToBitmap().apply {
+ onNodeWithTag(contentTag).captureToBitmap().apply {
val imageStartX = width / 2 - imageWidth / 2
val imageStartY = height / 2 - imageHeight / 2
Assert.assertEquals(bgColorArgb, getPixel(imageStartX + 2, imageStartY))
@@ -152,7 +152,7 @@
val bgColorArgb = bgColor.toArgb()
val pathArgb = pathColor.toArgb()
- findRoot().captureToBitmap().apply {
+ onRoot().captureToBitmap().apply {
val imageStartX = width / 2 - subsectionWidth / 2
val imageStartY = height / 2 - subsectionHeight / 2
Assert.assertEquals(bgColorArgb, getPixel(imageStartX + 2, imageStartY))
@@ -222,7 +222,7 @@
val bgColorArgb = bgColor.toArgb()
val pathArgb = pathColor.toArgb()
- findByTag(contentTag).captureToBitmap().apply {
+ onNodeWithTag(contentTag).captureToBitmap().apply {
val imageStartX = width / 2 - imageComposableWidth / 2
val imageStartY = height / 2 - imageComposableHeight / 2
Assert.assertEquals(bgColorArgb, getPixel(imageStartX + 5, imageStartY))
@@ -266,7 +266,7 @@
val bgColorArgb = bgColor.toArgb()
val pathArgb = pathColor.toArgb()
- findByTag(contentTag).captureToBitmap().apply {
+ onNodeWithTag(contentTag).captureToBitmap().apply {
val composableEndX = width / 2 + imageComposableWidth / 2
val composableEndY = height / 2 + imageComposableHeight / 2
val imageStartX = composableEndX - imageWidth
@@ -318,7 +318,7 @@
val imageColor = Color.Red.toArgb()
val containerBgColor = Color.White.toArgb()
- findRoot().captureToBitmap().apply {
+ onRoot().captureToBitmap().apply {
val imageStartX = width / 2 - boxWidth / 2
val imageStartY = height / 2 - boxHeight / 2
Assert.assertEquals(containerBgColor, getPixel(imageStartX - 1, imageStartY - 1))
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/IndicationTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/IndicationTest.kt
index acd9946..6fe8f9e 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/IndicationTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/IndicationTest.kt
@@ -24,11 +24,11 @@
import androidx.ui.layout.preferredSize
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendUp
+import androidx.ui.test.down
+import androidx.ui.test.up
import androidx.ui.geometry.Offset
import androidx.ui.unit.dp
import com.google.common.truth.Truth.assertThat
@@ -81,18 +81,18 @@
)
}
assertThat(countDownLatch.count).isEqualTo(2)
- findByTag(testTag)
+ onNodeWithTag(testTag)
.assertExists()
- .doPartialGesture {
- sendDown(center)
+ .performPartialGesture {
+ down(center)
}
runOnIdleCompose {
assertThat(countDownLatch.count).isEqualTo(1)
}
- findByTag(testTag)
+ onNodeWithTag(testTag)
.assertExists()
- .doPartialGesture {
- sendUp()
+ .performPartialGesture {
+ up()
}
assertThat(countDownLatch.await(1000, TimeUnit.MILLISECONDS)).isTrue()
}
@@ -137,41 +137,41 @@
}
assertThat(lastPosition).isNull()
var position1: Offset? = null
- findByTag(testTag)
+ onNodeWithTag(testTag)
.assertExists()
- .doPartialGesture {
+ .performPartialGesture {
position1 = Offset(center.x, center.y + 20f)
// pointer 1, when we have multitouch
- sendDown(position1!!)
+ down(position1!!)
}
runOnIdleCompose {
assertThat(lastPosition).isEqualTo(position1!!)
}
- findByTag(testTag)
+ onNodeWithTag(testTag)
.assertExists()
- .doPartialGesture {
+ .performPartialGesture {
val position2 = Offset(center.x + 20f, center.y)
// pointer 2, when we have multitouch
- sendDown(position2)
+ down(position2)
}
// should be still position1
runOnIdleCompose {
assertThat(lastPosition).isEqualTo(position1!!)
}
- findByTag(testTag)
+ onNodeWithTag(testTag)
.assertExists()
- .doPartialGesture {
+ .performPartialGesture {
// pointer 1, when we have multitouch
- sendUp()
+ up()
}
runOnIdleCompose {
assertThat(lastPosition).isNull()
}
- findByTag(testTag)
+ onNodeWithTag(testTag)
.assertExists()
- .doPartialGesture {
+ .performPartialGesture {
// pointer 2, when we have multitouch
- sendUp()
+ up()
}
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollableTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollableTest.kt
index 8795598..5692904 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollableTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollableTest.kt
@@ -35,12 +35,12 @@
import androidx.ui.layout.preferredSize
import androidx.ui.test.center
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.runOnUiThread
-import androidx.ui.test.sendSwipe
-import androidx.ui.test.sendSwipeWithVelocity
+import androidx.ui.test.swipe
+import androidx.ui.test.swipeWithVelocity
import androidx.ui.geometry.Offset
import androidx.ui.unit.dp
import androidx.ui.unit.milliseconds
@@ -80,8 +80,8 @@
dragDirection = DragDirection.Horizontal
)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -93,8 +93,8 @@
assertThat(total).isGreaterThan(0)
total
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x, this.center.y + 100f),
duration = 100.milliseconds
@@ -105,8 +105,8 @@
runOnIdleCompose {
assertThat(total).isEqualTo(lastTotal)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x - 100f, this.center.y),
duration = 100.milliseconds
@@ -136,8 +136,8 @@
dragDirection = DragDirection.Vertical
)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x, this.center.y + 100f),
duration = 100.milliseconds
@@ -149,8 +149,8 @@
assertThat(total).isGreaterThan(0)
total
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -161,8 +161,8 @@
runOnIdleCompose {
assertThat(total).isEqualTo(lastTotal)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x, this.center.y - 100f),
duration = 100.milliseconds
@@ -200,8 +200,8 @@
assertThat(startTrigger).isEqualTo(0)
assertThat(stopTrigger).isEqualTo(0)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -240,8 +240,8 @@
enabled = enabled.value
)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -253,8 +253,8 @@
enabled.value = false
total
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -288,8 +288,8 @@
}
)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipeWithVelocity(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipeWithVelocity(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
endVelocity = 112f,
@@ -299,8 +299,8 @@
}
// don't advance clocks, so animation won't trigger yet
// and interrupt
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipeWithVelocity(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipeWithVelocity(
start = this.center,
end = Offset(this.center.x - 100f, this.center.y),
endVelocity = 312f,
@@ -332,8 +332,8 @@
dragDirection = DragDirection.Horizontal
)
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100f, this.center.y),
duration = 100.milliseconds
@@ -344,8 +344,8 @@
Truth.assertThat(total).isGreaterThan(0f)
total
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 114f, this.center.y),
duration = 100.milliseconds
@@ -384,8 +384,8 @@
Modifier
}
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 100, this.center.y),
duration = 100.milliseconds
@@ -547,8 +547,8 @@
}
}
}
- findByTag(scrollableBoxTag).doGesture {
- this.sendSwipe(
+ onNodeWithTag(scrollableBoxTag).performGesture {
+ this.swipe(
start = this.center,
end = Offset(this.center.x + 200f, this.center.y),
duration = 300.milliseconds
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollerTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollerTest.kt
index 615be76..a5578c4 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollerTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ScrollerTest.kt
@@ -39,17 +39,17 @@
import androidx.ui.test.assertPixels
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.doScrollTo
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performGesture
+import androidx.ui.test.performScrollTo
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
-import androidx.ui.test.sendClick
-import androidx.ui.test.sendSwipeDown
-import androidx.ui.test.sendSwipeLeft
-import androidx.ui.test.sendSwipeRight
-import androidx.ui.test.sendSwipeUp
+import androidx.ui.test.click
+import androidx.ui.test.swipeDown
+import androidx.ui.test.swipeLeft
+import androidx.ui.test.swipeRight
+import androidx.ui.test.swipeUp
import androidx.ui.unit.Dp
import androidx.ui.unit.IntSize
import androidx.ui.unit.dp
@@ -272,9 +272,9 @@
fun verticalScroller_scrollTo_scrollForward() {
createScrollableContent(isVertical = true)
- findByText("50")
+ onNodeWithText("50")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
}
@@ -282,9 +282,9 @@
fun horizontalScroller_scrollTo_scrollForward() {
createScrollableContent(isVertical = false)
- findByText("50")
+ onNodeWithText("50")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
}
@@ -299,9 +299,9 @@
)
)
- findByText("50")
+ onNodeWithText("50")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
}
@@ -316,9 +316,9 @@
)
)
- findByText("50")
+ onNodeWithText("50")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
}
@@ -326,14 +326,14 @@
fun verticalScroller_scrollTo_scrollBack() {
createScrollableContent(isVertical = true)
- findByText("50")
+ onNodeWithText("50")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
- findByText("20")
+ onNodeWithText("20")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
}
@@ -341,25 +341,25 @@
fun horizontalScroller_scrollTo_scrollBack() {
createScrollableContent(isVertical = false)
- findByText("50")
+ onNodeWithText("50")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
- findByText("20")
+ onNodeWithText("20")
.assertIsNotDisplayed()
- .doScrollTo()
+ .performScrollTo()
.assertIsDisplayed()
}
@Test
fun verticalScroller_swipeUp_swipeDown() {
- swipeScrollerAndBack(true, GestureScope::sendSwipeUp, GestureScope::sendSwipeDown)
+ swipeScrollerAndBack(true, GestureScope::swipeUp, GestureScope::swipeDown)
}
@Test
fun horizontalScroller_swipeLeft_swipeRight() {
- swipeScrollerAndBack(false, GestureScope::sendSwipeLeft, GestureScope::sendSwipeRight)
+ swipeScrollerAndBack(false, GestureScope::swipeLeft, GestureScope::swipeRight)
}
@Test
@@ -499,8 +499,8 @@
assertThat(scrollerPosition.isAnimating).isEqualTo(false)
}
- findByTag(scrollerTag)
- .doGesture { sendSwipeUp() }
+ onNodeWithTag(scrollerTag)
+ .performGesture { swipeUp() }
runOnIdleCompose {
clock.clockTimeMillis += 100
@@ -508,8 +508,8 @@
}
// TODO (matvei/jelle): this should be down, and not click to be 100% fair
- findByTag(scrollerTag)
- .doGesture { sendClick() }
+ onNodeWithTag(scrollerTag)
+ .performGesture { click() }
runOnIdleCompose {
assertThat(scrollerPosition.isAnimating).isEqualTo(false)
@@ -554,7 +554,7 @@
runOnIdleCompose {
clock.clockTimeMillis += 5000
}
- findByTag(scrollerTag).awaitScrollAnimation(scrollerPosition)
+ onNodeWithTag(scrollerTag).awaitScrollAnimation(scrollerPosition)
runOnIdleCompose {
assertThat(scrollerPosition.value).isEqualTo(assertValue)
}
@@ -577,14 +577,14 @@
assertThat(scrollerPosition.value).isEqualTo(0f)
}
- findByTag(scrollerTag)
- .doGesture { firstSwipe() }
+ onNodeWithTag(scrollerTag)
+ .performGesture { firstSwipe() }
runOnIdleCompose {
clock.clockTimeMillis += 5000
}
- findByTag(scrollerTag)
+ onNodeWithTag(scrollerTag)
.awaitScrollAnimation(scrollerPosition)
val scrolledValue = runOnIdleCompose {
@@ -592,14 +592,14 @@
}
assertThat(scrolledValue).isGreaterThan(0f)
- findByTag(scrollerTag)
- .doGesture { secondSwipe() }
+ onNodeWithTag(scrollerTag)
+ .performGesture { secondSwipe() }
runOnIdleCompose {
clock.clockTimeMillis += 5000
}
- findByTag(scrollerTag)
+ onNodeWithTag(scrollerTag)
.awaitScrollAnimation(scrollerPosition)
runOnIdleCompose {
@@ -676,7 +676,7 @@
height: Int = 40,
rowHeight: Int = 5
) {
- findByTag(scrollerTag)
+ onNodeWithTag(scrollerTag)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(width, height)) { pos ->
val colorIndex = (offset + pos.y) / rowHeight
@@ -691,7 +691,7 @@
height: Int = 45,
columnWidth: Int = 5
) {
- findByTag(scrollerTag)
+ onNodeWithTag(scrollerTag)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(width, height)) { pos ->
val colorIndex = (offset + pos.x) / columnWidth
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SelectableTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SelectableTest.kt
index 4d851fc..c5297ce 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SelectableTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SelectableTest.kt
@@ -30,16 +30,16 @@
import androidx.ui.test.assertIsUnselected
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.find
-import androidx.ui.test.findAll
-import androidx.ui.test.findByText
-import androidx.ui.test.first
+import androidx.ui.test.performClick
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNode
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.onNodeWithText
+import androidx.ui.test.onFirst
import androidx.ui.test.isInMutuallyExclusiveGroup
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendUp
+import androidx.ui.test.down
+import androidx.ui.test.up
import com.google.common.truth.Truth
import org.junit.Rule
import org.junit.Test
@@ -62,9 +62,9 @@
)
}
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(1)
- .first()
+ .onFirst()
.assertIsInMutuallyExclusiveGroup()
.assertIsSelected()
}
@@ -82,11 +82,11 @@
)
}
- find(isInMutuallyExclusiveGroup())
+ onNode(isInMutuallyExclusiveGroup())
.assertIsUnselected()
- .doClick()
+ .performClick()
.assertIsSelected()
- .doClick()
+ .performClick()
.assertIsUnselected()
}
@@ -102,9 +102,9 @@
)
}
- find(isInMutuallyExclusiveGroup())
+ onNode(isInMutuallyExclusiveGroup())
.assertIsUnselected()
- .doClick()
+ .performClick()
.assertIsUnselected()
}
@@ -128,15 +128,15 @@
Truth.assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
}
- findByText("SelectableText")
- .doPartialGesture { sendDown(center) }
+ onNodeWithText("SelectableText")
+ .performPartialGesture { down(center) }
runOnIdleCompose {
Truth.assertThat(interactionState.value).contains(Interaction.Pressed)
}
- findByText("SelectableText")
- .doPartialGesture { sendUp() }
+ onNodeWithText("SelectableText")
+ .performPartialGesture { up() }
runOnIdleCompose {
Truth.assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
@@ -166,8 +166,8 @@
Truth.assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
}
- findByText("SelectableText")
- .doPartialGesture { sendDown(center) }
+ onNodeWithText("SelectableText")
+ .performPartialGesture { down(center) }
runOnIdleCompose {
Truth.assertThat(interactionState.value).contains(Interaction.Pressed)
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
index 1eb2871..16fb63e 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
@@ -25,8 +25,8 @@
import androidx.ui.input.TextInputService
import androidx.ui.layout.fillMaxSize
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.find
+import androidx.ui.test.performClick
+import androidx.ui.test.onNode
import androidx.ui.test.hasInputMethodsSupport
import androidx.ui.test.runOnIdleCompose
import androidx.ui.text.SoftwareKeyboardController
@@ -72,8 +72,8 @@
}
// Perform click to focus in.
- find(hasInputMethodsSupport())
- .doClick()
+ onNode(hasInputMethodsSupport())
+ .performClick()
runOnIdleCompose {
verify(onTextInputStarted, times(1)).invoke(any())
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
index 155dd8c..b468f9c 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
@@ -30,8 +30,8 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.find
+import androidx.ui.test.performClick
+import androidx.ui.test.onNode
import androidx.ui.test.hasInputMethodsSupport
import androidx.ui.test.waitForIdle
import androidx.ui.text.TextStyle
@@ -71,14 +71,14 @@
}
)
}
- find(hasInputMethodsSupport()).doClick()
+ onNode(hasInputMethodsSupport()).performClick()
assert(latch.await(1, TimeUnit.SECONDS))
waitForIdle()
composeTestRule.clockTestRule.advanceClock(100)
with(composeTestRule.density) {
- find(hasInputMethodsSupport())
+ onNode(hasInputMethodsSupport())
.captureToBitmap()
.assertCursor(2.dp, this)
}
@@ -108,7 +108,7 @@
}
}
- find(hasInputMethodsSupport()).doClick()
+ onNode(hasInputMethodsSupport()).performClick()
assert(latch.await(1, TimeUnit.SECONDS))
waitForIdle()
@@ -116,14 +116,14 @@
// cursor visible first 500 ms
composeTestRule.clockTestRule.advanceClock(100)
with(composeTestRule.density) {
- find(hasInputMethodsSupport())
+ onNode(hasInputMethodsSupport())
.captureToBitmap()
.assertCursor(2.dp, this)
}
// cursor invisible during next 500 ms
composeTestRule.clockTestRule.advanceClock(700)
- find(hasInputMethodsSupport())
+ onNode(hasInputMethodsSupport())
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
index 33c26ee..d11e00c 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
@@ -30,12 +30,12 @@
import androidx.ui.input.SetSelectionEditOp
import androidx.ui.input.TextInputService
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.find
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNode
import androidx.ui.test.hasInputMethodsSupport
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
-import androidx.ui.test.sendClick
+import androidx.ui.test.click
import androidx.ui.text.TextRange
import com.google.common.truth.Truth.assertThat
import com.nhaarman.mockitokotlin2.any
@@ -90,8 +90,8 @@
}
// Perform click to focus in.
- find(hasInputMethodsSupport())
- .doGesture { sendClick(Offset(1f, 1f)) }
+ onNode(hasInputMethodsSupport())
+ .performGesture { click(Offset(1f, 1f)) }
runOnIdleCompose {
// Verify startInput is called and capture the callback.
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
index c009349..f841167 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
@@ -46,9 +46,9 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.hasImeAction
import androidx.ui.test.hasInputMethodsSupport
import androidx.ui.test.runOnIdleCompose
@@ -96,7 +96,7 @@
}
}
- find(hasInputMethodsSupport()).doClick()
+ onNode(hasInputMethodsSupport()).performClick()
runOnIdleCompose {
assertThat(focusModifier.focusState).isEqualTo(FocusState.Focused)
@@ -131,7 +131,7 @@
}
}
- find(hasInputMethodsSupport()).doClick()
+ onNode(hasInputMethodsSupport()).performClick()
var onEditCommandCallback: ((List<EditOperation>) -> Unit)? = null
runOnIdleCompose {
@@ -203,7 +203,7 @@
}
}
- find(hasInputMethodsSupport()).doClick()
+ onNode(hasInputMethodsSupport()).performClick()
var onEditCommandCallback: ((List<EditOperation>) -> Unit)? = null
runOnIdleCompose {
@@ -271,7 +271,7 @@
}
}
- find(hasInputMethodsSupport()).doClick()
+ onNode(hasInputMethodsSupport()).performClick()
var onEditCommandCallback: ((List<EditOperation>) -> Unit)? = null
runOnIdleCompose {
@@ -420,7 +420,7 @@
)
}
- find(hasInputMethodsSupport())
+ onNode(hasInputMethodsSupport())
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -441,7 +441,7 @@
)
}
- findByTag("textField")
+ onNodeWithTag("textField")
.assert(hasInputMethodsSupport())
.assert(hasImeAction(ImeAction.Unspecified))
}
@@ -456,7 +456,7 @@
)
}
- find(hasInputMethodsSupport())
+ onNode(hasInputMethodsSupport())
.assert(hasImeAction(ImeAction.Search))
}
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextTest.kt
index 143b4657..9b68464 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextTest.kt
@@ -22,7 +22,7 @@
import androidx.ui.graphics.Color
import androidx.ui.test.assertTextEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
import androidx.ui.text.TextStyle
import androidx.ui.text.font.FontStyle
@@ -232,6 +232,6 @@
}
}
- findByTag("text").assertTextEquals(TestText)
+ onNodeWithTag("text").assertTextEquals(TestText)
}
}
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ToggleableTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ToggleableTest.kt
index 6c7334c..8529f6a 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ToggleableTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ToggleableTest.kt
@@ -38,15 +38,15 @@
import androidx.ui.test.assertIsOn
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.isToggleable
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendUp
+import androidx.ui.test.down
+import androidx.ui.test.up
import com.google.common.truth.Truth.assertThat
import org.junit.Rule
import org.junit.Test
@@ -89,15 +89,15 @@
FoundationSemanticsProperties.ToggleableState, ToggleableState.Indeterminate
)
- findByTag("checkedToggleable")
+ onNodeWithTag("checkedToggleable")
.assertIsEnabled()
.assertIsOn()
.assertHasClickAction()
- findByTag("unCheckedToggleable")
+ onNodeWithTag("unCheckedToggleable")
.assertIsEnabled()
.assertIsOff()
.assertHasClickAction()
- findByTag("indeterminateToggleable")
+ onNodeWithTag("indeterminateToggleable")
.assertIsEnabled()
.assert(hasIndeterminateState())
.assertHasClickAction()
@@ -122,11 +122,11 @@
}
}
- findByTag("checkedToggleable")
+ onNodeWithTag("checkedToggleable")
.assertIsEnabled()
.assertIsOn()
.assertHasClickAction()
- findByTag("unCheckedToggleable")
+ onNodeWithTag("unCheckedToggleable")
.assertIsEnabled()
.assertIsOff()
.assertHasClickAction()
@@ -147,7 +147,7 @@
}
}
- find(isToggleable())
+ onNode(isToggleable())
.assertIsNotEnabled()
.assertHasNoClickAction()
}
@@ -168,8 +168,8 @@
}
}
- find(isToggleable())
- .doClick()
+ onNode(isToggleable())
+ .performClick()
runOnIdleCompose {
assertThat(checked).isEqualTo(false)
@@ -196,15 +196,15 @@
assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
}
- findByText("ToggleableText")
- .doPartialGesture { sendDown(center) }
+ onNodeWithText("ToggleableText")
+ .performPartialGesture { down(center) }
runOnIdleCompose {
assertThat(interactionState.value).contains(Interaction.Pressed)
}
- findByText("ToggleableText")
- .doPartialGesture { sendUp() }
+ onNodeWithText("ToggleableText")
+ .performPartialGesture { up() }
runOnIdleCompose {
assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
@@ -234,8 +234,8 @@
assertThat(interactionState.value).doesNotContain(Interaction.Pressed)
}
- findByText("ToggleableText")
- .doPartialGesture { sendDown(center) }
+ onNodeWithText("ToggleableText")
+ .performPartialGesture { down(center) }
runOnIdleCompose {
assertThat(interactionState.value).contains(Interaction.Pressed)
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ZoomableTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ZoomableTest.kt
index edd436b..658ab47 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ZoomableTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/ZoomableTest.kt
@@ -27,11 +27,11 @@
import androidx.ui.test.AnimationClockTestRule
import androidx.ui.test.center
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.runOnUiThread
-import androidx.ui.test.sendPinch
+import androidx.ui.test.pinch
import androidx.ui.test.size
import androidx.ui.unit.dp
import androidx.ui.unit.toSize
@@ -64,13 +64,13 @@
setZoomableContent { Modifier.zoomable(state) }
- findByTag(TEST_TAG).doGesture {
+ onNodeWithTag(TEST_TAG).performGesture {
val leftStartX = center.x - 10
val leftEndX = size.toSize().width * EDGE_FUZZ_FACTOR
val rightStartX = center.x + 10
val rightEndX = size.toSize().width * (1 - EDGE_FUZZ_FACTOR)
- sendPinch(
+ pinch(
Offset(leftStartX, center.y),
Offset(leftEndX, center.y),
Offset(rightStartX, center.y),
@@ -95,13 +95,13 @@
setZoomableContent { Modifier.zoomable(state) }
- findByTag(TEST_TAG).doGesture {
+ onNodeWithTag(TEST_TAG).performGesture {
val leftStartX = size.toSize().width * EDGE_FUZZ_FACTOR
val leftEndX = center.x - 10
val rightStartX = size.toSize().width * (1 - EDGE_FUZZ_FACTOR)
val rightEndX = center.x + 10
- sendPinch(
+ pinch(
Offset(leftStartX, center.y),
Offset(leftEndX, center.y),
Offset(rightStartX, center.y),
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyColumnItemsTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyColumnItemsTest.kt
index 9b342ab..81739a0 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyColumnItemsTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyColumnItemsTest.kt
@@ -39,14 +39,14 @@
import androidx.ui.test.assertIsDisplayed
import androidx.ui.test.assertIsNotDisplayed
import androidx.ui.test.center
-import androidx.ui.test.children
+import androidx.ui.test.onChildren
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendSwipeUp
-import androidx.ui.test.sendSwipeWithVelocity
+import androidx.ui.test.swipeUp
+import androidx.ui.test.swipeWithVelocity
import androidx.ui.test.waitForIdle
import androidx.ui.unit.Density
import androidx.ui.unit.Dp
@@ -104,8 +104,8 @@
assertWithMessage("Additional composition occurred for no apparent reason")
.that(composed).isFalse()
- findByTag(LazyColumnItemsTag)
- .doGesture { sendSwipeUp() }
+ onNodeWithTag(LazyColumnItemsTag)
+ .performGesture { swipeUp() }
waitForIdle()
@@ -223,13 +223,13 @@
while (numItems >= 0) {
// Confirm the number of children to ensure there are no extra items
- findByTag(tag)
- .children()
+ onNodeWithTag(tag)
+ .onChildren()
.assertCountEquals(numItems)
// Confirm the children's content
for (i in 1..3) {
- findByText("$i").apply {
+ onNodeWithText("$i").apply {
if (i <= numItems) {
assertExists()
} else {
@@ -265,13 +265,13 @@
// Confirm the number of children to ensure there are no extra items
val numItems = data.size
- findByTag(tag)
- .children()
+ onNodeWithTag(tag)
+ .onChildren()
.assertCountEquals(numItems)
// Confirm the children's content
for (item in data) {
- findByText("$item").assertExists()
+ onNodeWithText("$item").assertExists()
}
}
}
@@ -299,10 +299,10 @@
}
}
- findByTag(LazyColumnItemsTag)
+ onNodeWithTag(LazyColumnItemsTag)
.scrollBy(y = 21.dp, density = composeTestRule.density)
- findByTag(thirdTag)
+ onNodeWithTag(thirdTag)
.assertExists()
.assertIsNotDisplayed()
@@ -312,23 +312,23 @@
waitForIdle()
- findByTag(LazyColumnItemsTag)
+ onNodeWithTag(LazyColumnItemsTag)
.scrollBy(y = 10.dp, density = composeTestRule.density)
- findByTag(thirdTag)
+ onNodeWithTag(thirdTag)
.assertIsDisplayed()
}
}
internal fun SemanticsNodeInteraction.scrollBy(x: Dp = 0.dp, y: Dp = 0.dp, density: Density) =
- doGesture {
+ performGesture {
with(density) {
val touchSlop = TouchSlop.toIntPx()
val xPx = x.toIntPx()
val yPx = y.toIntPx()
val offsetX = if (xPx > 0) xPx + touchSlop else if (xPx < 0) xPx - touchSlop else 0
val offsetY = if (yPx > 0) yPx + touchSlop else if (yPx < 0) xPx - touchSlop else 0
- sendSwipeWithVelocity(
+ swipeWithVelocity(
start = center,
end = Offset(center.x - offsetX, center.y - offsetY),
endVelocity = 0f
diff --git a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyRowItemsTest.kt b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyRowItemsTest.kt
index e306602..43dcdc2 100644
--- a/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyRowItemsTest.kt
+++ b/ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/lazy/LazyRowItemsTest.kt
@@ -25,7 +25,7 @@
import androidx.ui.layout.preferredWidth
import androidx.ui.test.assertIsDisplayed
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
import org.junit.Rule
import org.junit.Test
@@ -53,16 +53,16 @@
}
}
- findByTag("1")
+ onNodeWithTag("1")
.assertIsDisplayed()
- findByTag("2")
+ onNodeWithTag("2")
.assertIsDisplayed()
- findByTag("3")
+ onNodeWithTag("3")
.assertDoesNotExist()
- findByTag("4")
+ onNodeWithTag("4")
.assertDoesNotExist()
}
@@ -78,19 +78,19 @@
}
}
- findByTag(LazyRowItemsTag)
+ onNodeWithTag(LazyRowItemsTag)
.scrollBy(x = 50.dp, density = composeTestRule.density)
- findByTag("1")
+ onNodeWithTag("1")
.assertIsDisplayed()
- findByTag("2")
+ onNodeWithTag("2")
.assertIsDisplayed()
- findByTag("3")
+ onNodeWithTag("3")
.assertIsDisplayed()
- findByTag("4")
+ onNodeWithTag("4")
.assertDoesNotExist()
}
@@ -106,16 +106,16 @@
}
}
- findByTag(LazyRowItemsTag)
+ onNodeWithTag(LazyRowItemsTag)
.scrollBy(x = 102.dp, density = composeTestRule.density)
- findByTag("1")
+ onNodeWithTag("1")
.assertDoesNotExist()
- findByTag("2")
+ onNodeWithTag("2")
.assertIsDisplayed()
- findByTag("3")
+ onNodeWithTag("3")
.assertIsDisplayed()
}
@@ -131,19 +131,19 @@
}
}
- findByTag(LazyRowItemsTag)
+ onNodeWithTag(LazyRowItemsTag)
.scrollBy(x = 150.dp, density = composeTestRule.density)
- findByTag("1")
+ onNodeWithTag("1")
.assertDoesNotExist()
- findByTag("2")
+ onNodeWithTag("2")
.assertIsDisplayed()
- findByTag("3")
+ onNodeWithTag("3")
.assertIsDisplayed()
- findByTag("4")
+ onNodeWithTag("4")
.assertIsDisplayed()
}
}
diff --git a/ui/ui-layout/src/androidAndroidTest/kotlin/androidx/ui/layout/test/LayoutOffsetTest.kt b/ui/ui-layout/src/androidAndroidTest/kotlin/androidx/ui/layout/test/LayoutOffsetTest.kt
index 212b057..dad5892 100644
--- a/ui/ui-layout/src/androidAndroidTest/kotlin/androidx/ui/layout/test/LayoutOffsetTest.kt
+++ b/ui/ui-layout/src/androidAndroidTest/kotlin/androidx/ui/layout/test/LayoutOffsetTest.kt
@@ -34,7 +34,7 @@
import androidx.ui.layout.size
import androidx.ui.layout.wrapContentSize
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
import androidx.ui.unit.dp
import org.junit.Assert
@@ -79,7 +79,7 @@
}
}
- findByTag("stack").assertExists()
+ onNodeWithTag("stack").assertExists()
runOnIdleCompose {
assertEquals(offsetX.toIntPx(), positionX)
assertEquals(offsetY.toIntPx(), positionY)
@@ -112,7 +112,7 @@
}
}
- findByTag("stack").assertExists()
+ onNodeWithTag("stack").assertExists()
runOnIdleCompose {
assertEquals(containerWidth.toIntPx() - offsetX.toIntPx() - boxSize, positionX)
assertEquals(offsetY.toIntPx(), positionY)
@@ -138,7 +138,7 @@
}
}
- findByTag("stack").assertExists()
+ onNodeWithTag("stack").assertExists()
runOnIdleCompose {
Assert.assertEquals(offsetX, positionX)
Assert.assertEquals(offsetY, positionY)
@@ -171,7 +171,7 @@
}
}
- findByTag("stack").assertExists()
+ onNodeWithTag("stack").assertExists()
runOnIdleCompose {
Assert.assertEquals(
containerWidth.toIntPx() - offsetX.roundToInt() - boxSize,
diff --git a/ui/ui-material/icons/extended/src/androidTest/java/androidx/ui/material/icons/test/IconComparisonTest.kt b/ui/ui-material/icons/extended/src/androidTest/java/androidx/ui/material/icons/test/IconComparisonTest.kt
index c5be28e..f4c91ea 100644
--- a/ui/ui-material/icons/extended/src/androidTest/java/androidx/ui/material/icons/test/IconComparisonTest.kt
+++ b/ui/ui-material/icons/extended/src/androidTest/java/androidx/ui/material/icons/test/IconComparisonTest.kt
@@ -41,7 +41,7 @@
import androidx.ui.res.vectorResource
import androidx.ui.test.android.AndroidComposeTestRule
import androidx.ui.test.captureToBitmap
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnUiThread
import androidx.ui.test.waitForIdle
import com.google.common.truth.Truth
@@ -114,8 +114,8 @@
assertVectorAssetsAreEqual(xmlVector!!, programmaticVector, iconName)
assertBitmapsAreEqual(
- findByTag(XmlTestTag).captureToBitmap(),
- findByTag(ProgrammaticTestTag).captureToBitmap(),
+ onNodeWithTag(XmlTestTag).captureToBitmap(),
+ onNodeWithTag(ProgrammaticTestTag).captureToBitmap(),
iconName
)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/AppBarTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/AppBarTest.kt
index a3a3c71..dc4f5ac 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/AppBarTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/AppBarTest.kt
@@ -31,8 +31,8 @@
import androidx.ui.test.assertLeftPositionInRootIsEqualTo
import androidx.ui.test.assertTopPositionInRootIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.getBoundsInRoot
import androidx.ui.text.TextStyle
import androidx.ui.unit.Dp
@@ -70,7 +70,7 @@
composeTestRule.setMaterialContent {
TopAppBar(title = { Text(title) })
}
- findByText(title).assertIsDisplayed()
+ onNodeWithText(title).assertIsDisplayed()
}
@Test
@@ -91,25 +91,25 @@
}
}
- val appBarBounds = findByTag("bar").getBoundsInRoot()
- val titleBounds = findByTag("title").getBoundsInRoot()
+ val appBarBounds = onNodeWithTag("bar").getBoundsInRoot()
+ val titleBounds = onNodeWithTag("title").getBoundsInRoot()
val appBarBottomEdgeY = appBarBounds.top + appBarBounds.height
- findByTag("navigationIcon")
+ onNodeWithTag("navigationIcon")
// Navigation icon should be 4.dp from the start
.assertLeftPositionInRootIsEqualTo(AppBarStartAndEndPadding)
// Navigation icon should be 4.dp from the bottom
.assertTopPositionInRootIsEqualTo(
appBarBottomEdgeY - AppBarStartAndEndPadding - FakeIconSize)
- findByTag("title")
+ onNodeWithTag("title")
// Title should be 72.dp from the start
// 4.dp padding for the whole app bar + 68.dp inset
.assertLeftPositionInRootIsEqualTo(4.dp + 68.dp)
// Title should be vertically centered
.assertTopPositionInRootIsEqualTo((appBarBounds.height - titleBounds.height) / 2)
- findByTag("action")
+ onNodeWithTag("action")
// Action should be placed at the end
.assertLeftPositionInRootIsEqualTo(expectedActionPosition(appBarBounds.width))
// Action should be 4.dp from the bottom
@@ -132,14 +132,14 @@
}
}
- val appBarBounds = findByTag("bar").getBoundsInRoot()
+ val appBarBounds = onNodeWithTag("bar").getBoundsInRoot()
- findByTag("title")
+ onNodeWithTag("title")
// Title should now be placed 16.dp from the start, as there is no navigation icon
// 4.dp padding for the whole app bar + 12.dp inset
.assertLeftPositionInRootIsEqualTo(4.dp + 12.dp)
- findByTag("action")
+ onNodeWithTag("action")
// Action should still be placed at the end
.assertLeftPositionInRootIsEqualTo(expectedActionPosition(appBarBounds.width))
}
@@ -181,10 +181,10 @@
}
}
- val appBarBounds = findByTag("bar").getBoundsInRoot()
+ val appBarBounds = onNodeWithTag("bar").getBoundsInRoot()
val appBarBottomEdgeY = appBarBounds.top + appBarBounds.height
- findByTag("icon")
+ onNodeWithTag("icon")
// Child icon should be 4.dp from the start
.assertLeftPositionInRootIsEqualTo(AppBarStartAndEndPadding)
// Child icon should be 4.dp from the bottom
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt
index 359cbd3..8e0f172 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/BottomNavigationTest.kt
@@ -36,10 +36,10 @@
import androidx.ui.test.assertLeftPositionInRootIsEqualTo
import androidx.ui.test.assertTopPositionInRootIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findAll
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.getBoundsInRoot
import androidx.ui.test.isInMutuallyExclusiveGroup
import androidx.ui.unit.dp
@@ -133,16 +133,16 @@
}
}
- val itemBounds = findByTag("item").getBoundsInRoot()
- val iconBounds = findByTag("icon", useUnmergedTree = true).getBoundsInRoot()
- val textBounds = findByText("ItemText").getBoundsInRoot()
+ val itemBounds = onNodeWithTag("item").getBoundsInRoot()
+ val iconBounds = onNodeWithTag("icon", useUnmergedTree = true).getBoundsInRoot()
+ val textBounds = onNodeWithText("ItemText").getBoundsInRoot()
// Distance from the bottom to the text baseline and from the text baseline to the
// bottom of the icon
val textBaseline = 12.dp
// Relative position of the baseline to the top of text
- val relativeTextBaseline = findByText("ItemText").getLastBaselinePosition()
+ val relativeTextBaseline = onNodeWithText("ItemText").getLastBaselinePosition()
// Absolute y position of the text baseline
val absoluteTextBaseline = textBounds.top + relativeTextBaseline
@@ -150,7 +150,7 @@
// Text baseline should be 12.dp from the bottom of the item
absoluteTextBaseline.assertIsEqualTo(itemBottom - textBaseline)
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
// The icon should be centered in the item
.assertLeftPositionInRootIsEqualTo((itemBounds.width - iconBounds.width) / 2)
// The bottom of the icon is 12.dp above the text baseline
@@ -182,12 +182,12 @@
// The text should not be placed, since the item is not selected and alwaysShowLabels
// is false
- findByText("ItemText", useUnmergedTree = true).assertIsNotDisplayed()
+ onNodeWithText("ItemText", useUnmergedTree = true).assertIsNotDisplayed()
- val itemBounds = findByTag("item").getBoundsInRoot()
- val iconBounds = findByTag("icon", useUnmergedTree = true).getBoundsInRoot()
+ val itemBounds = onNodeWithTag("item").getBoundsInRoot()
+ val iconBounds = onNodeWithTag("icon", useUnmergedTree = true).getBoundsInRoot()
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
.assertLeftPositionInRootIsEqualTo((itemBounds.width - iconBounds.width) / 2)
.assertTopPositionInRootIsEqualTo((itemBounds.height - iconBounds.height) / 2)
}
@@ -212,11 +212,11 @@
}
}
- val itemBounds = findByTag("item").getBoundsInRoot()
- val iconBounds = findByTag("icon", useUnmergedTree = true).getBoundsInRoot()
+ val itemBounds = onNodeWithTag("item").getBoundsInRoot()
+ val iconBounds = onNodeWithTag("icon", useUnmergedTree = true).getBoundsInRoot()
// The icon should be centered in the item, as there is no text placeable provided
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
.assertLeftPositionInRootIsEqualTo((itemBounds.width - iconBounds.width) / 2)
.assertTopPositionInRootIsEqualTo((itemBounds.height - iconBounds.height) / 2)
}
@@ -228,7 +228,7 @@
}
// Find all items and ensure there are 3
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(3)
// Ensure semantics match for selected state of the items
.apply {
@@ -238,7 +238,7 @@
}
// Click the last item
.apply {
- get(2).doClick()
+ get(2).performClick()
}
.apply {
get(0).assertIsUnselected()
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonScreenshotTest.kt
index 6901f48..5da9d7e 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonScreenshotTest.kt
@@ -28,13 +28,13 @@
import androidx.ui.test.captureToBitmap
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.find
-import androidx.ui.test.findByText
-import androidx.ui.test.findRoot
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithText
import androidx.ui.unit.dp
import androidx.ui.test.hasClickAction
-import androidx.ui.test.sendDown
+import androidx.ui.test.down
+import androidx.ui.test.onRoot
import androidx.ui.test.waitForIdle
import org.junit.Rule
import org.junit.Test
@@ -60,7 +60,7 @@
}
}
- find(hasClickAction())
+ onNode(hasClickAction())
.captureToBitmap()
.assertAgainstGolden(screenshotRule, "button_default")
}
@@ -73,7 +73,7 @@
}
}
- findByText("Button")
+ onNodeWithText("Button")
.captureToBitmap()
.assertAgainstGolden(screenshotRule, "button_disabled")
}
@@ -89,14 +89,14 @@
composeTestRule.clockTestRule.pauseClock()
// Start ripple
- find(hasClickAction())
- .doPartialGesture { sendDown(center) }
+ onNode(hasClickAction())
+ .performPartialGesture { down(center) }
// Let ripple propagate
waitForIdle()
composeTestRule.clockTestRule.advanceClock(50)
- findRoot()
+ onRoot()
.captureToBitmap()
.assertAgainstGolden(screenshotRule, "button_ripple")
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
index 5556d88..b45304d 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
@@ -64,10 +64,10 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.hasClickAction
import androidx.ui.test.runOnIdleCompose
import androidx.ui.unit.Dp
@@ -101,7 +101,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.assertIsEnabled()
}
@@ -115,7 +115,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.assertIsNotEnabled()
}
@@ -135,8 +135,8 @@
// TODO(b/129400818): this actually finds the text, not the button as
// merge semantics aren't implemented yet
- findByText(text)
- .doClick()
+ onNodeWithText(text)
+ .performClick()
runOnIdleCompose {
assertThat(counter).isEqualTo(1)
@@ -157,11 +157,11 @@
}
}
}
- findByTag(tag)
+ onNodeWithTag(tag)
// Confirm the button starts off enabled, with a click action
.assertHasClickAction()
.assertIsEnabled()
- .doClick()
+ .performClick()
// Then confirm it's disabled with no click action after clicking it
.assertHasNoClickAction()
.assertIsNotEnabled()
@@ -190,16 +190,16 @@
}
}
- findByTag(button1Tag)
- .doClick()
+ onNodeWithTag(button1Tag)
+ .performClick()
runOnIdleCompose {
assertThat(button1Counter).isEqualTo(1)
assertThat(button2Counter).isEqualTo(0)
}
- findByTag(button2Tag)
- .doClick()
+ onNodeWithTag(button2Tag)
+ .performClick()
runOnIdleCompose {
assertThat(button1Counter).isEqualTo(1)
@@ -220,7 +220,7 @@
}
}
- find(hasClickAction())
+ onNode(hasClickAction())
.assertHeightIsEqualTo(36.dp)
}
@@ -235,7 +235,7 @@
}
}
- find(hasClickAction())
+ onNode(hasClickAction())
.assertHeightIsAtLeast(37.dp)
}
@@ -303,7 +303,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -377,7 +377,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -410,7 +410,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -440,7 +440,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -467,7 +467,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -581,7 +581,7 @@
}
}
- findByTag("stack")
+ onNodeWithTag("stack")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -600,7 +600,7 @@
}
}
- findByTag("button")
+ onNodeWithTag("button")
.assertWidthIsEqualTo(20.dp)
.assertHeightIsEqualTo(15.dp)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
index 6c9e136..f3fcca5 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
@@ -31,7 +31,7 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
import org.junit.Rule
import org.junit.Test
@@ -68,7 +68,7 @@
}
}
- findByTag("card")
+ onNodeWithTag("card")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
index f10d795..7fe300b 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
@@ -31,12 +31,12 @@
import androidx.ui.test.captureToBitmap
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.isToggleable
-import androidx.ui.test.sendDown
+import androidx.ui.test.down
import androidx.ui.test.waitForIdle
import org.junit.Rule
import org.junit.Test
@@ -87,8 +87,8 @@
Checkbox(modifier = wrap, checked = false, })
}
}
- findByTag(wrapperTestTag).doPartialGesture {
- sendDown(center)
+ onNodeWithTag(wrapperTestTag).performPartialGesture {
+ down(center)
}
assertToggeableAgainstGolden("checkbox_pressed")
}
@@ -155,8 +155,8 @@
composeTestRule.clockTestRule.pauseClock()
- find(isToggleable())
- .doClick()
+ onNode(isToggleable())
+ .performClick()
waitForIdle()
@@ -180,8 +180,8 @@
composeTestRule.clockTestRule.pauseClock()
- find(isToggleable())
- .doClick()
+ onNode(isToggleable())
+ .performClick()
waitForIdle()
@@ -192,7 +192,7 @@
private fun assertToggeableAgainstGolden(goldenName: String) {
// TODO: replace with find(isToggeable()) after b/157687898 is fixed
- findByTag(wrapperTestTag)
+ onNodeWithTag(wrapperTestTag)
.captureToBitmap()
.assertAgainstGolden(screenshotRule, goldenName)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxUiTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxUiTest.kt
index 41c052f..04ad106 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxUiTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxUiTest.kt
@@ -31,8 +31,8 @@
import androidx.ui.test.assertIsOn
import androidx.ui.test.assertValueEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
import org.junit.Rule
import org.junit.Test
@@ -57,12 +57,12 @@
}
}
- findByTag("checkboxUnchecked")
+ onNodeWithTag("checkboxUnchecked")
.assertIsEnabled()
.assertIsOff()
.assertValueEquals(Strings.Unchecked)
- findByTag("checkboxChecked")
+ onNodeWithTag("checkboxChecked")
.assertIsEnabled()
.assertIsOn()
.assertValueEquals(Strings.Checked)
@@ -75,9 +75,9 @@
Checkbox(checked, onCheckedChange, modifier = Modifier.testTag(defaultTag))
}
- findByTag(defaultTag)
+ onNodeWithTag(defaultTag)
.assertIsOff()
- .doClick()
+ .performClick()
.assertIsOn()
}
@@ -88,11 +88,11 @@
Checkbox(checked, onCheckedChange, modifier = Modifier.testTag(defaultTag))
}
- findByTag(defaultTag)
+ onNodeWithTag(defaultTag)
.assertIsOff()
- .doClick()
+ .performClick()
.assertIsOn()
- .doClick()
+ .performClick()
.assertIsOff()
}
@@ -104,7 +104,7 @@
Checkbox(checked, {}, enabled = false, modifier = Modifier.testTag(defaultTag))
}
- findByTag(defaultTag)
+ onNodeWithTag(defaultTag)
.assertHasNoClickAction()
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerScreenshotTest.kt
index 57d6209..e402322 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerScreenshotTest.kt
@@ -30,7 +30,7 @@
import androidx.ui.test.ComposeTestRule
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
import org.junit.Rule
import org.junit.Test
@@ -99,7 +99,7 @@
}
private fun assertScreenshotAgainstGolden(goldenName: String) {
- findByTag("container")
+ onNodeWithTag("container")
.captureToBitmap()
.assertAgainstGolden(screenshotRule, goldenName)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
index 1e6e627..47c2ec9 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/DrawerTest.kt
@@ -38,17 +38,17 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.center
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.globalBounds
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
-import androidx.ui.test.sendClick
-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.click
+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.unit.dp
import androidx.ui.unit.height
import androidx.ui.unit.width
@@ -77,7 +77,7 @@
}, bodyContent = emptyContent())
}
- findByTag("content")
+ onNodeWithTag("content")
.assertLeftPositionInRootIsEqualTo(0.dp)
}
@@ -106,7 +106,7 @@
}, bodyContent = emptyContent())
}
- findByTag("content")
+ onNodeWithTag("content")
.assertWidthIsEqualTo(rootWidth() - 56.dp)
}
@@ -121,7 +121,7 @@
val width = rootWidth()
val height = rootHeight()
val expectedHeight = if (width > height) 0.dp else (height / 2)
- findByTag("content")
+ onNodeWithTag("content")
.assertTopPositionInRootIsEqualTo(expectedHeight)
}
@@ -213,7 +213,7 @@
}
// Click in the middle of the drawer (which is the middle of the body)
- findByTag("Drawer").doGesture { sendClick() }
+ onNodeWithTag("Drawer").performGesture { click() }
runOnIdleCompose {
assertThat(drawerClicks).isEqualTo(0)
@@ -224,10 +224,10 @@
sleep(100) // TODO(147586311): remove this sleep when opening the drawer triggers a wait
// Click on the left-center pixel of the drawer
- findByTag("Drawer").doGesture {
+ onNodeWithTag("Drawer").performGesture {
val left = 1.0f
val centerY = (globalBounds.height / 2)
- sendClick(Offset(left, centerY))
+ click(Offset(left, centerY))
}
runOnIdleCompose {
@@ -309,7 +309,7 @@
}
// Click in the middle of the drawer (which is the middle of the body)
- findByTag("Drawer").doGesture { sendClick() }
+ onNodeWithTag("Drawer").performGesture { click() }
runOnIdleCompose {
assertThat(drawerClicks).isEqualTo(0)
@@ -322,11 +322,11 @@
sleep(100) // TODO(147586311): remove this sleep when opening the drawer triggers a wait
// Click on the bottom-center pixel of the drawer
- findByTag("Drawer").doGesture {
+ onNodeWithTag("Drawer").performGesture {
val bounds = globalBounds
val centerX = bounds.width / 2
val bottom = bounds.height - 1.0f
- sendClick(Offset(centerX, bottom))
+ click(Offset(centerX, bottom))
}
assertThat(drawerClicks).isEqualTo(1)
@@ -349,15 +349,15 @@
}
}
- findByTag("Drawer")
- .doGesture { sendSwipeRight() }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeRight() }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(DrawerState.Opened)
}
- findByTag("Drawer")
- .doGesture { sendSwipeLeft() }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeLeft() }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(DrawerState.Closed)
@@ -380,15 +380,15 @@
}
}
- findByTag("Drawer")
- .doGesture { sendSwipeLeft() }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeLeft() }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(DrawerState.Opened)
}
- findByTag("Drawer")
- .doGesture { sendSwipeRight() }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeRight() }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(DrawerState.Closed)
@@ -411,15 +411,15 @@
}
}
- findByTag("Drawer")
- .doGesture { sendSwipeUp() }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeUp() }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Expanded)
}
- findByTag("Drawer")
- .doGesture { sendSwipeDown() }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeDown() }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Closed)
@@ -443,68 +443,68 @@
}
val threshold = with (composeTestRule.density) { BottomDrawerThreshold.toPx() }
- findByTag("Drawer")
- .doGesture { sendSwipeUpBy(threshold / 2) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeUpBy(threshold / 2) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Closed)
}
- findByTag("Drawer")
- .doGesture { sendSwipeUpBy(threshold) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeUpBy(threshold) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Opened)
}
- findByTag("Drawer")
- .doGesture { sendSwipeUpBy(threshold / 2) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeUpBy(threshold / 2) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Opened)
}
- findByTag("Drawer")
- .doGesture { sendSwipeUpBy(threshold) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeUpBy(threshold) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Expanded)
}
- findByTag("Drawer")
- .doGesture { sendSwipeDownBy(threshold / 2) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeDownBy(threshold / 2) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Expanded)
}
- findByTag("Drawer")
- .doGesture { sendSwipeDownBy(threshold) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeDownBy(threshold) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Opened)
}
- findByTag("Drawer")
- .doGesture { sendSwipeDownBy(threshold / 2) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeDownBy(threshold / 2) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Opened)
}
- findByTag("Drawer")
- .doGesture { sendSwipeDownBy(threshold) }
+ onNodeWithTag("Drawer")
+ .performGesture { swipeDownBy(threshold) }
runOnIdleCompose {
assertThat(drawerState.value).isEqualTo(BottomDrawerState.Closed)
}
}
- private fun GestureScope.sendSwipeUpBy(offset: Float) {
- sendSwipe(center, center.copy(y = center.y - offset))
+ private fun GestureScope.swipeUpBy(offset: Float) {
+ swipe(center, center.copy(y = center.y - offset))
}
- private fun GestureScope.sendSwipeDownBy(offset: Float) {
- sendSwipe(center, center.copy(y = center.y + offset))
+ private fun GestureScope.swipeDownBy(offset: Float) {
+ swipe(center, center.copy(y = center.y + offset))
}
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ElevationOverlayTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ElevationOverlayTest.kt
index 203aec8..e04243b 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ElevationOverlayTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ElevationOverlayTest.kt
@@ -27,7 +27,7 @@
import androidx.ui.test.assertPixels
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.Dp
import androidx.ui.unit.IntSize
import androidx.ui.unit.dp
@@ -70,7 +70,7 @@
fun correctElevationOverlayInDarkTheme() {
setupSurfaceForTesting(elevation!!, darkColorPalette())
- findByTag(Tag)
+ onNodeWithTag(Tag)
.captureToBitmap()
.assertPixels(SurfaceSize) {
expectedOverlayColor
@@ -84,7 +84,7 @@
// No overlay should be applied in light theme
val expectedSurfaceColor = Color.White
- findByTag(Tag)
+ onNodeWithTag(Tag)
.captureToBitmap()
.assertPixels(SurfaceSize) {
expectedSurfaceColor
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/FloatingActionButtonTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/FloatingActionButtonTest.kt
index 99fcc38..75a32e6 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/FloatingActionButtonTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/FloatingActionButtonTest.kt
@@ -41,9 +41,9 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.runOnIdleCompose
import androidx.ui.unit.center
import androidx.ui.unit.dp
@@ -72,7 +72,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.assertIsEnabled()
}
@@ -88,8 +88,8 @@
}
}
- findByText(text)
- .doClick()
+ onNodeWithText(text)
+ .performClick()
runOnIdleCompose {
assertThat(counter).isEqualTo(1)
@@ -118,7 +118,7 @@
)
}
- findByTag("FAB")
+ onNodeWithTag("FAB")
.assertHeightIsEqualTo(48.dp)
.assertWidthIsAtLeast(48.dp)
}
@@ -133,7 +133,7 @@
)
}
- findByTag("FAB")
+ onNodeWithTag("FAB")
.assertWidthIsEqualTo(48.dp)
.assertHeightIsEqualTo(48.dp)
}
@@ -161,7 +161,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -194,7 +194,7 @@
}
}
- findByTag("myButton")
+ onNodeWithTag("myButton")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/IconButtonTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/IconButtonTest.kt
index 60256a7..84ace1d 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/IconButtonTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/IconButtonTest.kt
@@ -30,9 +30,9 @@
import androidx.ui.test.assertTopPositionInRootIsEqualTo
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.isToggleable
import androidx.ui.unit.dp
import org.junit.Rule
@@ -76,7 +76,7 @@
}
// Icon should be centered inside the IconButton
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
.assertLeftPositionInRootIsEqualTo(24.dp / 2)
.assertTopPositionInRootIsEqualTo(24.dp / 2)
}
@@ -97,7 +97,7 @@
}
// Icon should be centered inside the IconButton
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
.assertLeftPositionInRootIsEqualTo((48.dp - width) / 2)
.assertTopPositionInRootIsEqualTo((48.dp - height) / 2)
}
@@ -129,7 +129,7 @@
}
// Icon should be centered inside the IconButton
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
.assertLeftPositionInRootIsEqualTo(24.dp / 2)
.assertTopPositionInRootIsEqualTo(24.dp / 2)
}
@@ -149,7 +149,7 @@
}
// Icon should be centered inside the IconButton
- findByTag("icon", useUnmergedTree = true)
+ onNodeWithTag("icon", useUnmergedTree = true)
.assertLeftPositionInRootIsEqualTo((48.dp - width) / 2)
.assertTopPositionInRootIsEqualTo((48.dp - height) / 2)
}
@@ -159,9 +159,9 @@
composeTestRule.setMaterialContent {
IconToggleButtonSample()
}
- find(isToggleable()).apply {
+ onNode(isToggleable()).apply {
assertIsOff()
- doClick()
+ performClick()
assertIsOn()
}
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/MaterialTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/MaterialTest.kt
index b9cf4aa..64d21ff 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/MaterialTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/MaterialTest.kt
@@ -29,8 +29,8 @@
import androidx.ui.test.assertHeightIsEqualTo
import androidx.ui.test.assertIsEqualTo
import androidx.ui.test.assertWidthIsEqualTo
-import androidx.ui.test.findByTag
-import androidx.ui.test.findRoot
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onRoot
import androidx.ui.test.getAlignmentLinePosition
import androidx.ui.test.runOnIdleCompose
import androidx.ui.text.FirstBaseline
@@ -77,7 +77,7 @@
}
fun rootWidth(): Dp {
- val nodeInteraction = findRoot()
+ val nodeInteraction = onRoot()
val node = nodeInteraction.fetchSemanticsNode("Failed to get screen width")
@OptIn(ExperimentalLayoutNodeApi::class)
val owner = node.componentNode.owner as AndroidOwner
@@ -88,7 +88,7 @@
}
fun rootHeight(): Dp {
- val nodeInteraction = findRoot()
+ val nodeInteraction = onRoot()
val node = nodeInteraction.fetchSemanticsNode("Failed to get screen height")
@OptIn(ExperimentalLayoutNodeApi::class)
val owner = node.componentNode.owner as AndroidOwner
@@ -121,5 +121,5 @@
}
}
- return findByTag("containerForSizeAssertion")
+ return onNodeWithTag("containerForSizeAssertion")
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/MenuTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/MenuTest.kt
index ffbe7fd..7af020c 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/MenuTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/MenuTest.kt
@@ -34,10 +34,10 @@
import androidx.ui.layout.preferredSize
import androidx.ui.layout.size
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
-import androidx.ui.test.hasAnyDescendantThat
+import androidx.ui.test.performClick
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.hasAnyDescendant
import androidx.ui.test.hasTestTag
import androidx.ui.test.isPopup
import androidx.ui.test.runOnIdleCompose
@@ -78,22 +78,22 @@
}
}
}
- findByTag("MenuContent").assertDoesNotExist()
+ onNodeWithTag("MenuContent").assertDoesNotExist()
runOnIdleCompose { expanded = true }
waitForIdle()
composeTestRule.clockTestRule.advanceClock(InTransitionDuration.toLong())
- findByTag("MenuContent").assertExists()
+ onNodeWithTag("MenuContent").assertExists()
runOnIdleCompose { expanded = false }
waitForIdle()
composeTestRule.clockTestRule.advanceClock(OutTransitionDuration.toLong())
- findByTag("MenuContent").assertDoesNotExist()
+ onNodeWithTag("MenuContent").assertDoesNotExist()
runOnIdleCompose { expanded = true }
waitForIdle()
composeTestRule.clockTestRule.advanceClock(InTransitionDuration.toLong())
- findByTag("MenuContent").assertExists()
+ onNodeWithTag("MenuContent").assertExists()
}
@Test
@@ -113,11 +113,11 @@
}
}
- findByTag("MenuContent1").assertExists()
- findByTag("MenuContent2").assertExists()
- val node = find(
- isPopup() and hasAnyDescendantThat(hasTestTag("MenuContent1")) and
- hasAnyDescendantThat(hasTestTag("MenuContent2"))
+ onNodeWithTag("MenuContent1").assertExists()
+ onNodeWithTag("MenuContent2").assertExists()
+ val node = onNode(
+ isPopup() and hasAnyDescendant(hasTestTag("MenuContent1")) and
+ hasAnyDescendant(hasTestTag("MenuContent2"))
).assertExists().fetchSemanticsNode()
with(composeTestRule.density) {
assertThat(node.size.width).isEqualTo(130 + MenuElevationInset.toIntPx() * 2)
@@ -316,7 +316,7 @@
}
}
- findByTag("MenuItem").doClick()
+ onNodeWithTag("MenuItem").performClick()
runOnIdleCompose {
assertThat(clicked).isTrue()
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ProgressIndicatorTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ProgressIndicatorTest.kt
index 095ad0e..d000aff 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ProgressIndicatorTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ProgressIndicatorTest.kt
@@ -27,7 +27,7 @@
import androidx.ui.test.assertValueEquals
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnUiThread
import androidx.ui.unit.dp
import org.junit.Ignore
@@ -56,7 +56,7 @@
LinearProgressIndicator(modifier = Modifier.testTag(tag), progress = progress.value)
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertIsDisplayed()
.assertValueEquals("0 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0f, 0f..1f))
@@ -65,7 +65,7 @@
progress.value = 0.5f
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertIsDisplayed()
.assertValueEquals("50 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0.5f, 0f..1f))
@@ -91,7 +91,7 @@
LinearProgressIndicator(modifier = Modifier.testTag(tag))
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals(Strings.InProgress)
}
@@ -119,7 +119,7 @@
)
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertIsDisplayed()
.assertValueEquals("0 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0f, 0f..1f))
@@ -128,7 +128,7 @@
progress.value = 0.5f
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertIsDisplayed()
.assertValueEquals("50 percent")
.assertRangeInfoEquals(AccessibilityRangeInfo(0.5f, 0f..1f))
@@ -153,7 +153,7 @@
CircularProgressIndicator(modifier = Modifier.testTag(tag))
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals(Strings.InProgress)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
index 104ae67..f3be708 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
@@ -31,12 +31,12 @@
import androidx.ui.test.captureToBitmap
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.isInMutuallyExclusiveGroup
-import androidx.ui.test.sendDown
+import androidx.ui.test.down
import androidx.ui.test.waitForIdle
import org.junit.Rule
import org.junit.Test
@@ -87,8 +87,8 @@
RadioButton(selected = false, >
}
}
- findByTag(wrapperTestTag).doPartialGesture {
- sendDown(center)
+ onNodeWithTag(wrapperTestTag).performPartialGesture {
+ down(center)
}
assertSelectableAgainstGolden("radioButton_pressed")
}
@@ -127,8 +127,8 @@
composeTestRule.clockTestRule.pauseClock()
- find(isInMutuallyExclusiveGroup())
- .doClick()
+ onNode(isInMutuallyExclusiveGroup())
+ .performClick()
waitForIdle()
@@ -151,8 +151,8 @@
composeTestRule.clockTestRule.pauseClock()
- find(isInMutuallyExclusiveGroup())
- .doClick()
+ onNode(isInMutuallyExclusiveGroup())
+ .performClick()
waitForIdle()
@@ -163,7 +163,7 @@
private fun assertSelectableAgainstGolden(goldenName: String) {
// TODO: replace with find(isInMutuallyExclusiveGroup()) after b/157687898 is fixed
- findByTag(wrapperTestTag)
+ onNodeWithTag(wrapperTestTag)
.captureToBitmap()
.assertAgainstGolden(screenshotRule, goldenName)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonTest.kt
index cd48273..0f5f167 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonTest.kt
@@ -28,8 +28,8 @@
import androidx.ui.test.assertIsUnselected
import androidx.ui.test.assertValueEquals
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
import org.junit.Rule
import org.junit.Test
@@ -75,9 +75,9 @@
}
}
- findByTag(itemOne).assertHasSelectedSemantics()
- findByTag(itemTwo).assertHasUnSelectedSemantics()
- findByTag(itemThree).assertHasUnSelectedSemantics()
+ onNodeWithTag(itemOne).assertHasSelectedSemantics()
+ onNodeWithTag(itemTwo).assertHasUnSelectedSemantics()
+ onNodeWithTag(itemThree).assertHasUnSelectedSemantics()
}
@Test
@@ -96,15 +96,15 @@
}
}
- findByTag(itemOne)
+ onNodeWithTag(itemOne)
.assertHasSelectedSemantics()
- .doClick()
+ .performClick()
.assertHasSelectedSemantics()
- findByTag(itemTwo)
+ onNodeWithTag(itemTwo)
.assertHasUnSelectedSemantics()
- findByTag(itemThree)
+ onNodeWithTag(itemThree)
.assertHasUnSelectedSemantics()
}
@@ -122,15 +122,15 @@
}
}
}
- findByTag(itemTwo)
+ onNodeWithTag(itemTwo)
.assertHasUnSelectedSemantics()
- .doClick()
+ .performClick()
.assertHasSelectedSemantics()
- findByTag(itemOne)
+ onNodeWithTag(itemOne)
.assertHasUnSelectedSemantics()
- findByTag(itemThree)
+ onNodeWithTag(itemThree)
.assertHasUnSelectedSemantics()
}
@@ -150,23 +150,23 @@
}
}
- findByTag(itemTwo)
+ onNodeWithTag(itemTwo)
.assertHasUnSelectedSemantics()
- .doClick()
+ .performClick()
.assertHasSelectedSemantics()
- findByTag(itemOne)
+ onNodeWithTag(itemOne)
.assertHasUnSelectedSemantics()
- findByTag(itemThree)
+ onNodeWithTag(itemThree)
.assertHasUnSelectedSemantics()
- .doClick()
+ .performClick()
.assertHasSelectedSemantics()
- findByTag(itemOne)
+ onNodeWithTag(itemOne)
.assertHasUnSelectedSemantics()
- findByTag(itemTwo)
+ onNodeWithTag(itemTwo)
.assertHasUnSelectedSemantics()
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
index 3c55c35..f18e253 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
@@ -46,12 +46,12 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.captureToBitmap
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.runOnUiThread
-import androidx.ui.test.sendSwipeLeft
-import androidx.ui.test.sendSwipeRight
+import androidx.ui.test.swipeLeft
+import androidx.ui.test.swipeRight
import androidx.ui.unit.IntSize
import androidx.ui.unit.dp
import androidx.ui.unit.toSize
@@ -200,12 +200,12 @@
}
}
assertThat(drawerChildPosition.x).isLessThan(0f)
- findByTag(scaffoldTag).doGesture {
- sendSwipeRight()
+ onNodeWithTag(scaffoldTag).performGesture {
+ swipeRight()
}
assertThat(drawerChildPosition.x).isLessThan(0f)
- findByTag(scaffoldTag).doGesture {
- sendSwipeLeft()
+ onNodeWithTag(scaffoldTag).performGesture {
+ swipeLeft()
}
assertThat(drawerChildPosition.x).isLessThan(0f)
@@ -213,12 +213,12 @@
scaffoldState.isDrawerGesturesEnabled = true
}
- findByTag(scaffoldTag).doGesture {
- sendSwipeRight()
+ onNodeWithTag(scaffoldTag).performGesture {
+ swipeRight()
}
assertThat(drawerChildPosition.x).isEqualTo(0f)
- findByTag(scaffoldTag).doGesture {
- sendSwipeLeft()
+ onNodeWithTag(scaffoldTag).performGesture {
+ swipeLeft()
}
assertThat(drawerChildPosition.x).isLessThan(0f)
}
@@ -367,7 +367,7 @@
}
}
- findByTag("Scaffold")
+ onNodeWithTag("Scaffold")
.captureToBitmap().apply {
// asserts the appbar(top half part) has the shadow
val yPos = height / 2 + 2
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SliderTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SliderTest.kt
index 4fc7d44..732e0ea 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SliderTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SliderTest.kt
@@ -39,15 +39,15 @@
import androidx.ui.test.centerX
import androidx.ui.test.centerY
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.left
import androidx.ui.test.right
import androidx.ui.test.runOnIdleCompose
import androidx.ui.test.runOnUiThread
-import androidx.ui.test.sendDown
-import androidx.ui.test.sendMoveBy
-import androidx.ui.test.sendUp
+import androidx.ui.test.down
+import androidx.ui.test.moveBy
+import androidx.ui.test.up
import androidx.ui.unit.dp
import com.google.common.truth.Truth
import org.junit.Assert.assertEquals
@@ -83,11 +83,11 @@
runOnIdleCompose {
state.value = 2f
}
- findByTag(tag).assertValueEquals("100 percent")
+ onNodeWithTag(tag).assertValueEquals("100 percent")
runOnIdleCompose {
state.value = -123145f
}
- findByTag(tag).assertValueEquals("0 percent")
+ onNodeWithTag(tag).assertValueEquals("0 percent")
}
@Test(expected = IllegalArgumentException::class)
@@ -107,14 +107,14 @@
state.value = it })
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals("0 percent")
runOnUiThread {
state.value = 0.5f
}
- findByTag(tag)
+ onNodeWithTag(tag)
.assertValueEquals("50 percent")
}
@@ -137,11 +137,11 @@
var expected = 0f
- findByTag(tag)
- .doPartialGesture {
- sendDown(center)
- sendMoveBy(Offset(100f, 0f))
- sendUp()
+ onNodeWithTag(tag)
+ .performPartialGesture {
+ down(center)
+ moveBy(Offset(100f, 0f))
+ up()
expected = calculateFraction(left, right, centerX + 100)
}
runOnIdleCompose {
@@ -168,10 +168,10 @@
var expected = 0f
- findByTag(tag)
- .doPartialGesture {
- sendDown(Offset(centerX + 50, centerY))
- sendUp()
+ onNodeWithTag(tag)
+ .performPartialGesture {
+ down(Offset(centerX + 50, centerY))
+ up()
expected = calculateFraction(left, right, centerX + 50)
}
runOnIdleCompose {
@@ -198,11 +198,11 @@
var expected = 0f
- findByTag(tag)
- .doPartialGesture {
- sendDown(center)
- sendMoveBy(Offset(100f, 0f))
- sendUp()
+ onNodeWithTag(tag)
+ .performPartialGesture {
+ down(center)
+ moveBy(Offset(100f, 0f))
+ up()
// subtract here as we're in rtl and going in the opposite direction
expected = calculateFraction(left, right, centerX - 100)
}
@@ -230,10 +230,10 @@
var expected = 0f
- findByTag(tag)
- .doPartialGesture {
- sendDown(Offset(centerX + 50, centerY))
- sendUp()
+ onNodeWithTag(tag)
+ .performPartialGesture {
+ down(Offset(centerX + 50, centerY))
+ up()
expected = calculateFraction(left, right, centerX - 50)
}
runOnIdleCompose {
@@ -273,7 +273,7 @@
)
}
- findByTag(sliderTag).captureToBitmap().apply {
+ onNodeWithTag(sliderTag).captureToBitmap().apply {
assertNotEquals(0, thumbStrokeWidth)
assertNotEquals(0, thumbPx)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
index d91be77..13cadce 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
@@ -37,9 +37,9 @@
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByTag
-import androidx.ui.test.findByText
+import androidx.ui.test.performClick
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.onNodeWithText
import androidx.ui.test.getAlignmentLinePosition
import androidx.ui.test.getBoundsInRoot
import androidx.ui.text.FirstBaseline
@@ -77,13 +77,13 @@
}
}
- findByText("Message")
+ onNodeWithText("Message")
.assertExists()
assertThat(clicked).isFalse()
- findByText("UNDO")
- .doClick()
+ onNodeWithText("UNDO")
+ .performClick()
assertThat(clicked).isTrue()
}
@@ -102,13 +102,13 @@
.assertWidthIsEqualTo(300.dp)
.assertHeightIsEqualTo(48.dp)
- val firstBaseLine = findByText("Message").getAlignmentLinePosition(FirstBaseline)
- val lastBaseLine = findByText("Message").getAlignmentLinePosition(LastBaseline)
+ val firstBaseLine = onNodeWithText("Message").getAlignmentLinePosition(FirstBaseline)
+ val lastBaseLine = onNodeWithText("Message").getAlignmentLinePosition(LastBaseline)
firstBaseLine.assertIsNotEqualTo(0.dp, "first baseline")
firstBaseLine.assertIsEqualTo(lastBaseLine, "first baseline")
val snackBounds = snackbar.getBoundsInRoot()
- val textBounds = findByText("Message").getBoundsInRoot()
+ val textBounds = onNodeWithText("Message").getBoundsInRoot()
val textTopOffset = textBounds.top - snackBounds.top
val textBottomOffset = textBounds.top - snackBounds.top
@@ -129,13 +129,13 @@
}
.assertWidthIsEqualTo(300.dp)
- val firstBaseLine = findByText("Message").getAlignmentLinePosition(FirstBaseline)
- val lastBaseLine = findByText("Message").getAlignmentLinePosition(LastBaseline)
+ val firstBaseLine = onNodeWithText("Message").getAlignmentLinePosition(FirstBaseline)
+ val lastBaseLine = onNodeWithText("Message").getAlignmentLinePosition(LastBaseline)
firstBaseLine.assertIsNotEqualTo(0.dp, "first baseline")
firstBaseLine.assertIsEqualTo(lastBaseLine, "first baseline")
val snackBounds = snackbar.getBoundsInRoot()
- val textBounds = findByText("Message").getBoundsInRoot()
+ val textBounds = onNodeWithText("Message").getBoundsInRoot()
val textTopOffset = textBounds.top - snackBounds.top
val textBottomOffset = textBounds.top - snackBounds.top
@@ -165,14 +165,14 @@
.assertWidthIsEqualTo(300.dp)
.assertHeightIsEqualTo(48.dp)
- val textBaseLine = findByText("Message").getAlignmentLinePosition(FirstBaseline)
- val buttonBaseLine = findByTag("button").getAlignmentLinePosition(FirstBaseline)
+ val textBaseLine = onNodeWithText("Message").getAlignmentLinePosition(FirstBaseline)
+ val buttonBaseLine = onNodeWithTag("button").getAlignmentLinePosition(FirstBaseline)
textBaseLine.assertIsNotEqualTo(0.dp, "text baseline")
buttonBaseLine.assertIsNotEqualTo(0.dp, "button baseline")
val snackBounds = snackbar.getBoundsInRoot()
- val textBounds = findByText("Message").getBoundsInRoot()
- val buttonBounds = findByText("Undo").getBoundsInRoot()
+ val textBounds = onNodeWithText("Message").getBoundsInRoot()
+ val buttonBounds = onNodeWithText("Undo").getBoundsInRoot()
val buttonTopOffset = buttonBounds.top - snackBounds.top
val textTopOffset = textBounds.top - snackBounds.top
@@ -203,14 +203,14 @@
)
}
- val textBaseLine = findByText("Message").getAlignmentLinePosition(FirstBaseline)
- val buttonBaseLine = findByTag("button").getAlignmentLinePosition(FirstBaseline)
+ val textBaseLine = onNodeWithText("Message").getAlignmentLinePosition(FirstBaseline)
+ val buttonBaseLine = onNodeWithTag("button").getAlignmentLinePosition(FirstBaseline)
textBaseLine.assertIsNotEqualTo(0.dp, "text baseline")
buttonBaseLine.assertIsNotEqualTo(0.dp, "button baseline")
val snackBounds = snackbar.getBoundsInRoot()
- val textBounds = findByText("Message").getBoundsInRoot()
- val buttonBounds = findByText("Undo").getBoundsInRoot()
+ val textBounds = onNodeWithText("Message").getBoundsInRoot()
+ val buttonBounds = onNodeWithText("Undo").getBoundsInRoot()
val buttonTopOffset = buttonBounds.top - snackBounds.top
val textTopOffset = textBounds.top - snackBounds.top
@@ -234,15 +234,15 @@
.assertWidthIsEqualTo(300.dp)
.assertHeightIsEqualTo(68.dp)
- val firstBaseline = findByTag("text").getFirstBaselinePosition()
- val lastBaseline = findByTag("text").getLastBaselinePosition()
+ val firstBaseline = onNodeWithTag("text").getFirstBaselinePosition()
+ val lastBaseline = onNodeWithTag("text").getLastBaselinePosition()
firstBaseline.assertIsNotEqualTo(0.dp, "first baseline")
lastBaseline.assertIsNotEqualTo(0.dp, "last baseline")
firstBaseline.assertIsNotEqualTo(lastBaseline, "first baseline")
val snackBounds = snackbar.getBoundsInRoot()
- val textBounds = findByTag("text").getBoundsInRoot()
+ val textBounds = onNodeWithTag("text").getBoundsInRoot()
val textTopOffset = textBounds.top - snackBounds.top
val textBottomOffset = textBounds.top - snackBounds.top
@@ -272,17 +272,17 @@
.assertWidthIsEqualTo(300.dp)
.assertHeightIsEqualTo(68.dp)
- val textFirstBaseLine = findByTag("text").getFirstBaselinePosition()
- val textLastBaseLine = findByTag("text").getLastBaselinePosition()
+ val textFirstBaseLine = onNodeWithTag("text").getFirstBaselinePosition()
+ val textLastBaseLine = onNodeWithTag("text").getLastBaselinePosition()
textFirstBaseLine.assertIsNotEqualTo(0.dp, "first baseline")
textLastBaseLine.assertIsNotEqualTo(0.dp, "last baseline")
textFirstBaseLine.assertIsNotEqualTo(textLastBaseLine, "first baseline")
- findByTag("text")
+ onNodeWithTag("text")
.assertTopPositionInRootIsEqualTo(30.dp - textFirstBaseLine)
- val buttonBounds = findByTag("button").getBoundsInRoot()
+ val buttonBounds = onNodeWithTag("button").getBoundsInRoot()
val snackBounds = snackbar.getBoundsInRoot()
val buttonCenter = buttonBounds.top + (buttonBounds.height / 2)
@@ -310,15 +310,15 @@
)
}
- val textFirstBaseLine = findByText("Message").getFirstBaselinePosition()
- val textLastBaseLine = findByText("Message").getLastBaselinePosition()
- val textBounds = findByText("Message").getBoundsInRoot()
- val buttonBounds = findByTag("button").getBoundsInRoot()
+ val textFirstBaseLine = onNodeWithText("Message").getFirstBaselinePosition()
+ val textLastBaseLine = onNodeWithText("Message").getLastBaselinePosition()
+ val textBounds = onNodeWithText("Message").getBoundsInRoot()
+ val buttonBounds = onNodeWithTag("button").getBoundsInRoot()
- findByText("Message")
+ onNodeWithText("Message")
.assertTopPositionInRootIsEqualTo(30.dp - textFirstBaseLine)
- findByTag("button")
+ onNodeWithTag("button")
.assertTopPositionInRootIsEqualTo(18.dp + textBounds.top + textLastBaseLine)
snackbar
@@ -349,7 +349,7 @@
}
}
- findByTag("snackbar")
+ onNodeWithTag("snackbar")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
index 22af85e..538796d 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
@@ -33,7 +33,7 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.unit.dp
import org.junit.Rule
import org.junit.Test
@@ -64,7 +64,7 @@
}
}
- findByTag("stack")
+ onNodeWithTag("stack")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -91,7 +91,7 @@
}
}
- findByTag("stack")
+ onNodeWithTag("stack")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -116,7 +116,7 @@
}
}
- findByTag("stack")
+ onNodeWithTag("stack")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
@@ -141,7 +141,7 @@
}
}
- findByTag("stack")
+ onNodeWithTag("stack")
.captureToBitmap()
.assertShape(
density = composeTestRule.density,
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchScreenshotTest.kt
index 2170258..17401b2 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchScreenshotTest.kt
@@ -32,12 +32,12 @@
import androidx.ui.test.captureToBitmap
import androidx.ui.test.center
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doPartialGesture
-import androidx.ui.test.find
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.performPartialGesture
+import androidx.ui.test.onNode
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.isToggleable
-import androidx.ui.test.sendDown
+import androidx.ui.test.down
import androidx.ui.test.waitForIdle
import org.junit.Rule
import org.junit.Test
@@ -121,8 +121,8 @@
}
}
- findByTag(wrapperTestTag).doPartialGesture {
- sendDown(center)
+ onNodeWithTag(wrapperTestTag).performPartialGesture {
+ down(center)
}
assertToggeableAgainstGolden("switch_pressed")
}
@@ -161,8 +161,8 @@
composeTestRule.clockTestRule.pauseClock()
- find(isToggleable())
- .doClick()
+ onNode(isToggleable())
+ .performClick()
waitForIdle()
@@ -185,8 +185,8 @@
composeTestRule.clockTestRule.pauseClock()
- find(isToggleable())
- .doClick()
+ onNode(isToggleable())
+ .performClick()
waitForIdle()
@@ -197,7 +197,7 @@
private fun assertToggeableAgainstGolden(goldenName: String) {
// TODO: replace with find(isToggeable()) after b/157687898 is fixed
- findByTag(wrapperTestTag)
+ onNodeWithTag(wrapperTestTag)
.captureToBitmap()
.assertAgainstGolden(screenshotRule, goldenName)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchTest.kt
index 19f3247..0419d2b 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/SwitchTest.kt
@@ -33,12 +33,12 @@
import androidx.ui.test.assertValueEquals
import androidx.ui.test.assertWidthIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doGesture
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.performGesture
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnIdleCompose
-import androidx.ui.test.sendSwipeLeft
-import androidx.ui.test.sendSwipeRight
+import androidx.ui.test.swipeLeft
+import androidx.ui.test.swipeRight
import androidx.ui.unit.dp
import com.google.common.truth.Truth
import org.junit.Rule
@@ -68,11 +68,11 @@
}
}
- findByTag("checked")
+ onNodeWithTag("checked")
.assertIsEnabled()
.assertIsOn()
.assertValueEquals(Strings.Checked)
- findByTag("unchecked")
+ onNodeWithTag("unchecked")
.assertIsEnabled()
.assertIsOff()
.assertValueEquals(Strings.Unchecked)
@@ -92,9 +92,9 @@
)
}
}
- findByTag(defaultSwitchTag)
+ onNodeWithTag(defaultSwitchTag)
.assertIsOff()
- .doClick()
+ .performClick()
.assertIsOn()
}
@@ -112,11 +112,11 @@
)
}
}
- findByTag(defaultSwitchTag)
+ onNodeWithTag(defaultSwitchTag)
.assertIsOff()
- .doClick()
+ .performClick()
.assertIsOn()
- .doClick()
+ .performClick()
.assertIsOff()
}
@@ -131,7 +131,7 @@
enabled = false
)
}
- findByTag(defaultSwitchTag)
+ onNodeWithTag(defaultSwitchTag)
.assertHasNoClickAction()
}
@@ -160,15 +160,15 @@
}
}
- findByTag(defaultSwitchTag)
- .doGesture { sendSwipeRight() }
+ onNodeWithTag(defaultSwitchTag)
+ .performGesture { swipeRight() }
runOnIdleCompose {
Truth.assertThat(state.value).isEqualTo(true)
}
- findByTag(defaultSwitchTag)
- .doGesture { sendSwipeLeft() }
+ onNodeWithTag(defaultSwitchTag)
+ .performGesture { swipeLeft() }
runOnIdleCompose {
Truth.assertThat(state.value).isEqualTo(false)
@@ -190,15 +190,15 @@
}
}
- findByTag(defaultSwitchTag)
- .doGesture { sendSwipeLeft() }
+ onNodeWithTag(defaultSwitchTag)
+ .performGesture { swipeLeft() }
runOnIdleCompose {
Truth.assertThat(state.value).isEqualTo(true)
}
- findByTag(defaultSwitchTag)
- .doGesture { sendSwipeRight() }
+ onNodeWithTag(defaultSwitchTag)
+ .performGesture { swipeRight() }
runOnIdleCompose {
Truth.assertThat(state.value).isEqualTo(false)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
index 27958ae..be7c851 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/TabTest.kt
@@ -40,9 +40,9 @@
import androidx.ui.test.assertIsUnselected
import androidx.ui.test.assertPositionInRootIsEqualTo
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findAll
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+import androidx.ui.test.onAllNodes
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.getBoundsInRoot
import androidx.ui.test.isInMutuallyExclusiveGroup
import androidx.ui.unit.dp
@@ -133,20 +133,20 @@
}
}
- val tabRowBounds = findByTag("tabRow").getBoundsInRoot()
+ val tabRowBounds = onNodeWithTag("tabRow").getBoundsInRoot()
- findByTag("indicator")
+ onNodeWithTag("indicator")
.assertPositionInRootIsEqualTo(
expectedLeft = 0.dp,
expectedTop = tabRowBounds.height - indicatorHeight
)
// Click the second tab
- findAll(isInMutuallyExclusiveGroup())[1].doClick()
+ onAllNodes(isInMutuallyExclusiveGroup())[1].performClick()
// Indicator should now be placed in the bottom left of the second tab, so its x coordinate
// should be in the middle of the TabRow
- findByTag("indicator")
+ onNodeWithTag("indicator")
.assertPositionInRootIsEqualTo(
expectedLeft = (tabRowBounds.width / 2),
expectedTop = tabRowBounds.height - indicatorHeight
@@ -180,9 +180,9 @@
val indicatorHeight = 2.dp
val expectedBaselineDistance = expectedBaseline + indicatorHeight
- val tabRowBounds = findByTag("tabRow").getBoundsInRoot()
- val textBounds = findByTag("text").getBoundsInRoot()
- val textBaselinePos = findByTag("text").getLastBaselinePosition()
+ val tabRowBounds = onNodeWithTag("tabRow").getBoundsInRoot()
+ val textBounds = onNodeWithTag("text").getBoundsInRoot()
+ val textBaselinePos = onNodeWithTag("text").getLastBaselinePosition()
val baselinePositionY = textBounds.top + textBaselinePos
val expectedPositionY = tabRowBounds.height - expectedBaselineDistance
@@ -217,9 +217,9 @@
val indicatorHeight = 2.dp
val expectedBaselineDistance = expectedBaseline + indicatorHeight
- val tabRowBounds = findByTag("tabRow").getBoundsInRoot()
- val textBounds = findByTag("text").getBoundsInRoot()
- val textBaselinePos = findByTag("text").getLastBaselinePosition()
+ val tabRowBounds = onNodeWithTag("tabRow").getBoundsInRoot()
+ val textBounds = onNodeWithTag("text").getBoundsInRoot()
+ val textBaselinePos = onNodeWithTag("text").getLastBaselinePosition()
val baselinePositionY = textBounds.top + textBaselinePos
val expectedPositionY = tabRowBounds.height - expectedBaselineDistance
@@ -252,9 +252,9 @@
val expectedBaseline = 10.dp
val indicatorHeight = 2.dp
- val tabRowBounds = findByTag("tabRow").getBoundsInRoot()
- val textBounds = findByTag("text").getBoundsInRoot()
- val textBaselinePos = findByTag("text").getLastBaselinePosition()
+ val tabRowBounds = onNodeWithTag("tabRow").getBoundsInRoot()
+ val textBounds = onNodeWithTag("text").getBoundsInRoot()
+ val textBaselinePos = onNodeWithTag("text").getLastBaselinePosition()
val expectedBaselineDistance = expectedBaseline + indicatorHeight
@@ -301,10 +301,10 @@
}
}
- val tabRowBounds = findByTag("tabRow").getBoundsInRoot()
+ val tabRowBounds = onNodeWithTag("tabRow").getBoundsInRoot()
// Indicator should be placed in the bottom left of the first tab
- findByTag("indicator")
+ onNodeWithTag("indicator")
.assertPositionInRootIsEqualTo(
// Tabs in a scrollable tab row are offset 52.dp from each end
expectedLeft = scrollableTabRowOffset,
@@ -312,11 +312,11 @@
)
// Click the second tab
- findAll(isInMutuallyExclusiveGroup())[1].doClick()
+ onAllNodes(isInMutuallyExclusiveGroup())[1].performClick()
// Indicator should now be placed in the bottom left of the second tab, so its x coordinate
// should be in the middle of the TabRow
- findByTag("indicator")
+ onNodeWithTag("indicator")
.assertPositionInRootIsEqualTo(
expectedLeft = scrollableTabRowOffset + minimumTabWidth,
expectedTop = tabRowBounds.height - indicatorHeight
@@ -331,7 +331,7 @@
}
// Only the first tab should be selected
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(3)
.apply {
get(0).assertIsSelected()
@@ -348,7 +348,7 @@
}
// Only the first tab should be selected
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(3)
.apply {
get(0).assertIsSelected()
@@ -357,10 +357,10 @@
}
// Click the last tab
- findAll(isInMutuallyExclusiveGroup())[2].doClick()
+ onAllNodes(isInMutuallyExclusiveGroup())[2].performClick()
// Now only the last tab should be selected
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(3)
.apply {
get(0).assertIsUnselected()
@@ -377,7 +377,7 @@
}
// Only the first tab should be selected
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(10)
.apply {
get(0).assertIsSelected()
@@ -395,7 +395,7 @@
}
// Only the first tab should be selected
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(10)
.apply {
get(0).assertIsSelected()
@@ -405,10 +405,10 @@
}
// Click the second tab
- findAll(isInMutuallyExclusiveGroup())[1].doClick()
+ onAllNodes(isInMutuallyExclusiveGroup())[1].performClick()
// Now only the second tab should be selected
- findAll(isInMutuallyExclusiveGroup())
+ onAllNodes(isInMutuallyExclusiveGroup())
.assertCountEquals(10)
.apply {
get(0).assertIsUnselected()
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
index d52810d..8b8ed07 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
@@ -51,7 +51,7 @@
import androidx.ui.test.ComposeTestRule
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
import androidx.ui.test.runOnUiThread
import androidx.ui.test.waitForIdle
import androidx.ui.unit.dp
@@ -529,7 +529,7 @@
interactionState.addInteraction(Interaction.Pressed, Offset(10f, 10f))
}
- with(findByTag(Tag)) {
+ with(onNodeWithTag(Tag)) {
val centerPixel = captureToBitmap()
.run {
getPixel(width / 2, height / 2)
@@ -548,7 +548,7 @@
rippleTheme = createRippleTheme(newColor, newAlpha)
}
- with(findByTag(Tag)) {
+ with(onNodeWithTag(Tag)) {
val centerPixel = captureToBitmap()
.run {
getPixel(width / 2, height / 2)
@@ -594,7 +594,7 @@
composeTestRule.clockTestRule.advanceClock(50)
// Capture and compare screenshots
- findByTag(Tag)
+ onNodeWithTag(Tag)
.captureToBitmap()
.assertAgainstGolden(screenshotRule, goldenIdentifier)
@@ -604,7 +604,7 @@
waitForIdle()
// Compare expected and actual pixel color
- val centerPixel = findByTag(Tag)
+ val centerPixel = onNodeWithTag(Tag)
.captureToBitmap()
.run {
getPixel(width / 2, height / 2)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/FilledTextFieldTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/FilledTextFieldTest.kt
index ad0d24d..85ad37b 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/FilledTextFieldTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/FilledTextFieldTest.kt
@@ -55,12 +55,12 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doGesture
-import androidx.ui.test.doSendImeAction
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+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.performImeAction
import androidx.ui.test.waitForIdle
import androidx.ui.text.FirstBaseline
import androidx.ui.text.SoftwareKeyboardController
@@ -136,14 +136,14 @@
}
}
- findByTag(textField1Tag).doClick()
+ onNodeWithTag(textField1Tag).performClick()
runOnIdleCompose {
assertThat(textField1Focused).isTrue()
assertThat(textField2Focused).isFalse()
}
- findByTag(textField2Tag).doClick()
+ onNodeWithTag(textField2Tag).performClick()
runOnIdleCompose {
assertThat(textField1Focused).isFalse()
@@ -167,8 +167,8 @@
}
// Click on (2, 2) which is Surface area and outside input area
- findByTag(TextfieldTag).doGesture {
- sendClick(Offset(2f, 2f))
+ onNodeWithTag(TextfieldTag).performGesture {
+ click(Offset(2f, 2f))
}
testRule.runOnIdleComposeWithDensity {
@@ -465,7 +465,7 @@
}
// click to focus
- findByTag(TextfieldTag).doClick()
+ onNodeWithTag(TextfieldTag).performClick()
}
@Test
@@ -677,7 +677,7 @@
)
}
- findByTag(TextfieldTag)
+ onNodeWithTag(TextfieldTag)
.captureToBitmap()
.assertShape(
density = testRule.density,
@@ -714,7 +714,7 @@
val expectedColor = Color.Blue.copy(alpha = 0.12f).compositeOver(Color.White)
- findByTag(TextfieldTag)
+ onNodeWithTag(TextfieldTag)
.captureToBitmap()
.assertShape(
density = testRule.density,
@@ -725,10 +725,10 @@
shapeOverlapPixelCount = with(testRule.density) { 1.dp.toPx() }
)
- findByTag(TextfieldTag).doClick()
+ onNodeWithTag(TextfieldTag).performClick()
assert(latch.await(1, TimeUnit.SECONDS))
- findByTag(TextfieldTag)
+ onNodeWithTag(TextfieldTag)
.captureToBitmap()
.assertShape(
density = testRule.density,
@@ -757,8 +757,8 @@
}
assertThat(controller).isNull()
- findByTag(TextfieldTag)
- .doClick()
+ onNodeWithTag(TextfieldTag)
+ .performClick()
runOnIdleCompose {
assertThat(controller).isNotNull()
@@ -783,8 +783,8 @@
}
assertThat(controller).isNull()
- findByTag(TextfieldTag)
- .doSendImeAction()
+ onNodeWithTag(TextfieldTag)
+ .performImeAction()
runOnIdleCompose {
assertThat(controller).isNotNull()
@@ -792,7 +792,7 @@
}
private fun clickAndAdvanceClock(tag: String, time: Long) {
- findByTag(tag).doClick()
+ onNodeWithTag(tag).performClick()
waitForIdle()
testRule.clockTestRule.pauseClock()
testRule.clockTestRule.advanceClock(time)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/OutlinedTextFieldTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/OutlinedTextFieldTest.kt
index b728ad7..6137d4c 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/OutlinedTextFieldTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/OutlinedTextFieldTest.kt
@@ -50,12 +50,12 @@
import androidx.ui.test.assertShape
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.doGesture
-import androidx.ui.test.doSendImeAction
-import androidx.ui.test.findByTag
+import androidx.ui.test.performClick
+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.performImeAction
import androidx.ui.test.waitForIdle
import androidx.ui.text.SoftwareKeyboardController
import androidx.ui.unit.IntSize
@@ -112,14 +112,14 @@
}
}
- findByTag(textField1Tag).doClick()
+ onNodeWithTag(textField1Tag).performClick()
runOnIdleCompose {
assertThat(textField1Focused).isTrue()
assertThat(textField2Focused).isFalse()
}
- findByTag(textField2Tag).doClick()
+ onNodeWithTag(textField2Tag).performClick()
runOnIdleCompose {
assertThat(textField1Focused).isFalse()
@@ -143,8 +143,8 @@
}
// Click on (2, 2) which is a background area and outside input area
- findByTag(TextfieldTag).doGesture {
- sendClick(Offset(2f, 2f))
+ onNodeWithTag(TextfieldTag).performGesture {
+ click(Offset(2f, 2f))
}
testRule.runOnIdleComposeWithDensity {
@@ -388,7 +388,7 @@
}
// click to focus
- findByTag(TextfieldTag).doClick()
+ onNodeWithTag(TextfieldTag).performClick()
}
@Test
@@ -593,7 +593,7 @@
}
}
- findByTag(TextfieldTag)
+ onNodeWithTag(TextfieldTag)
.captureToBitmap()
.assertShape(
density = testRule.density,
@@ -622,8 +622,8 @@
}
assertThat(controller).isNull()
- findByTag(TextfieldTag)
- .doClick()
+ onNodeWithTag(TextfieldTag)
+ .performClick()
runOnIdleCompose {
assertThat(controller).isNotNull()
@@ -648,8 +648,8 @@
}
assertThat(controller).isNull()
- findByTag(TextfieldTag)
- .doSendImeAction()
+ onNodeWithTag(TextfieldTag)
+ .performImeAction()
runOnIdleCompose {
assertThat(controller).isNotNull()
@@ -657,7 +657,7 @@
}
private fun clickAndAdvanceClock(tag: String, time: Long) {
- findByTag(tag).doClick()
+ onNodeWithTag(tag).performClick()
waitForIdle()
testRule.clockTestRule.pauseClock()
testRule.clockTestRule.advanceClock(time)
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
index 38893bc..c8aafd2 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
@@ -33,8 +33,8 @@
import androidx.ui.material.setMaterialContent
import androidx.ui.test.captureToBitmap
import androidx.ui.test.createComposeRule
-import androidx.ui.test.doClick
-import androidx.ui.test.findByTag
+import androidx.ui.test.onNodeWithTag
+import androidx.ui.test.performClick
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -95,8 +95,8 @@
}
}
- findByTag(TextFieldTag)
- .doClick()
+ onNodeWithTag(TextFieldTag)
+ .performClick()
assertAgainstGolden("outlined_textField_focused")
}
@@ -113,8 +113,8 @@
}
}
- findByTag(TextFieldTag)
- .doClick()
+ onNodeWithTag(TextFieldTag)
+ .performClick()
assertAgainstGolden("outlined_textField_focused_rtl")
}
@@ -161,8 +161,8 @@
}
}
- findByTag(TextFieldTag)
- .doClick()
+ onNodeWithTag(TextFieldTag)
+ .performClick()
assertAgainstGolden("filled_textField_focused")
}
@@ -179,14 +179,14 @@
}
}
- findByTag(TextFieldTag)
- .doClick()
+ onNodeWithTag(TextFieldTag)
+ .performClick()
assertAgainstGolden("filled_textField_focused_rtl")
}
private fun assertAgainstGolden(goldenIdentifier: String) {
- findByTag(TextFieldTag)
+ onNodeWithTag(TextFieldTag)
.captureToBitmap()
.assertAgainstGolden(screenshotRule, goldenIdentifier)
}
diff --git a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldTest.kt b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldTest.kt
index 0e9c6a5..7283d7e 100644
--- a/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldTest.kt
+++ b/ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldTest.kt
@@ -35,11 +35,11 @@
import androidx.ui.test.assertPixels
import androidx.ui.test.captureToBitmap
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.sendSwipeDown
-import androidx.ui.test.sendSwipeUp
+import androidx.ui.test.swipeDown
+import androidx.ui.test.swipeUp
import androidx.ui.unit.IntSize
import androidx.ui.unit.dp
import com.google.common.truth.Truth.assertThat
@@ -140,7 +140,7 @@
runOnIdleCompose {}
- findByTag(TextfieldTag)
+ onNodeWithTag(TextfieldTag)
.captureToBitmap()
.assertPixels(expectedSize = IntSize(parentSize, parentSize)) { position ->
if (position.x > textFieldSize && position.y > textFieldSize) Color.White else null
@@ -169,16 +169,16 @@
assertThat(scrollerPosition.current).isEqualTo(0f)
}
- findByTag(TextfieldTag)
- .doGesture { sendSwipeDown() }
+ onNodeWithTag(TextfieldTag)
+ .performGesture { swipeDown() }
val firstSwipePosition = runOnIdleCompose {
scrollerPosition.current
}
assertThat(firstSwipePosition).isGreaterThan(0f)
- findByTag(TextfieldTag)
- .doGesture { sendSwipeUp() }
+ onNodeWithTag(TextfieldTag)
+ .performGesture { swipeUp() }
runOnIdleCompose {
assertThat(scrollerPosition.current).isLessThan(firstSwipePosition)
}
@@ -206,8 +206,8 @@
}
}
- findByTag(TextfieldTag)
- .doGesture { sendSwipeDown() }
+ onNodeWithTag(TextfieldTag)
+ .performGesture { swipeDown() }
val swipePosition = runOnIdleCompose {
scrollerPosition.current
diff --git a/ui/ui-test/api/0.1.0-dev15.txt b/ui/ui-test/api/0.1.0-dev15.txt
index 7104f4a..e992fff 100644
--- a/ui/ui-test/api/0.1.0-dev15.txt
+++ b/ui/ui-test/api/0.1.0-dev15.txt
@@ -2,12 +2,18 @@
package androidx.ui.test {
public final class ActionsKt {
- method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
- method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
- method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method @Deprecated public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performClick(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method public static void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
}
public final class AnimationClockTestRule implements org.junit.rules.TestRule {
@@ -160,17 +166,17 @@
}
public final class FiltersKt {
- method public static androidx.ui.test.SemanticsMatcher hasAnyAncestorThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyChildThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyDescendantThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnySiblingThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyAncestor(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyChild(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyDescendant(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnySibling(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasClickAction();
method public static androidx.ui.test.SemanticsMatcher hasImeAction(androidx.ui.input.ImeAction actionType);
method public static androidx.ui.test.SemanticsMatcher hasInputMethodsSupport();
method public static androidx.ui.test.SemanticsMatcher hasLabel(String label, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsMatcher hasNoClickAction();
method public static androidx.ui.test.SemanticsMatcher hasNoScrollAction();
- method public static androidx.ui.test.SemanticsMatcher hasParentThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasParent(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasRangeInfo(androidx.ui.semantics.AccessibilityRangeInfo rangeInfo);
method public static androidx.ui.test.SemanticsMatcher hasScrollAction();
method public static androidx.ui.test.SemanticsMatcher hasSubstring(String substring, boolean ignoreCase = false);
@@ -194,22 +200,37 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodes(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNode(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithSubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onRoot(boolean useUnmergedTree = false);
}
public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
+ method public static void cancel(androidx.ui.test.PartialGestureScope);
+ method public static void click(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method public static void doubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method public static void down(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void down(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static inline float getBottom(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomCenter(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomLeft(androidx.ui.test.BaseGestureScope);
@@ -230,32 +251,46 @@
method public static androidx.ui.geometry.Offset getTopRight(androidx.ui.test.BaseGestureScope);
method public static inline int getWidth(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.geometry.Offset position);
+ method public static void longClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method public static void move(androidx.ui.test.PartialGestureScope);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
method public static void movePointerBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
method public static void movePointerTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static androidx.ui.geometry.Offset percentOffset(androidx.ui.test.BaseGestureScope, @FloatRange(from=-1.0, to=1.0) float x = 0f, @FloatRange(from=-1.0, to=1.0) float y = 0f);
- method public static void sendCancel(androidx.ui.test.PartialGestureScope);
- method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
- method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
- method public static void sendMove(androidx.ui.test.PartialGestureScope);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
- method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendSwipeDown(androidx.ui.test.GestureScope);
- method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
- method public static void sendSwipeRight(androidx.ui.test.GestureScope);
- method public static void sendSwipeUp(androidx.ui.test.GestureScope);
- method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void pinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendCancel(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method @Deprecated public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method @Deprecated public static void sendMove(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendSwipeDown(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeLeft(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeRight(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeUp(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void swipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void swipeDown(androidx.ui.test.GestureScope);
+ method public static void swipeLeft(androidx.ui.test.GestureScope);
+ method public static void swipeRight(androidx.ui.test.GestureScope);
+ method public static void swipeUp(androidx.ui.test.GestureScope);
+ method public static void swipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void up(androidx.ui.test.PartialGestureScope, int pointerId = 0);
}
public final class KeyInputHelpersKt {
- method public static boolean doSendKeyEvent(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
+ method public static boolean performKeyPress(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
}
public final class OutputKt {
@@ -275,17 +310,17 @@
}
public final class SelectorsKt {
- method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteractionCollection filter(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsNodeInteraction filterToOne(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction last(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAncestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChild(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChildAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onChildren(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onFirst(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onLast(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onParent(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onSibling(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onSiblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
@@ -349,10 +384,14 @@
}
public final class TextActionsKt {
- method public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
- method public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextClearance(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextInput(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performTextReplacement(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
}
}
diff --git a/ui/ui-test/api/current.txt b/ui/ui-test/api/current.txt
index 7104f4a..e992fff 100644
--- a/ui/ui-test/api/current.txt
+++ b/ui/ui-test/api/current.txt
@@ -2,12 +2,18 @@
package androidx.ui.test {
public final class ActionsKt {
- method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
- method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
- method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method @Deprecated public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performClick(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method public static void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
}
public final class AnimationClockTestRule implements org.junit.rules.TestRule {
@@ -160,17 +166,17 @@
}
public final class FiltersKt {
- method public static androidx.ui.test.SemanticsMatcher hasAnyAncestorThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyChildThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyDescendantThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnySiblingThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyAncestor(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyChild(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyDescendant(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnySibling(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasClickAction();
method public static androidx.ui.test.SemanticsMatcher hasImeAction(androidx.ui.input.ImeAction actionType);
method public static androidx.ui.test.SemanticsMatcher hasInputMethodsSupport();
method public static androidx.ui.test.SemanticsMatcher hasLabel(String label, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsMatcher hasNoClickAction();
method public static androidx.ui.test.SemanticsMatcher hasNoScrollAction();
- method public static androidx.ui.test.SemanticsMatcher hasParentThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasParent(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasRangeInfo(androidx.ui.semantics.AccessibilityRangeInfo rangeInfo);
method public static androidx.ui.test.SemanticsMatcher hasScrollAction();
method public static androidx.ui.test.SemanticsMatcher hasSubstring(String substring, boolean ignoreCase = false);
@@ -194,22 +200,37 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodes(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNode(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithSubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onRoot(boolean useUnmergedTree = false);
}
public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
+ method public static void cancel(androidx.ui.test.PartialGestureScope);
+ method public static void click(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method public static void doubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method public static void down(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void down(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static inline float getBottom(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomCenter(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomLeft(androidx.ui.test.BaseGestureScope);
@@ -230,32 +251,46 @@
method public static androidx.ui.geometry.Offset getTopRight(androidx.ui.test.BaseGestureScope);
method public static inline int getWidth(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.geometry.Offset position);
+ method public static void longClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method public static void move(androidx.ui.test.PartialGestureScope);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
method public static void movePointerBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
method public static void movePointerTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static androidx.ui.geometry.Offset percentOffset(androidx.ui.test.BaseGestureScope, @FloatRange(from=-1.0, to=1.0) float x = 0f, @FloatRange(from=-1.0, to=1.0) float y = 0f);
- method public static void sendCancel(androidx.ui.test.PartialGestureScope);
- method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
- method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
- method public static void sendMove(androidx.ui.test.PartialGestureScope);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
- method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendSwipeDown(androidx.ui.test.GestureScope);
- method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
- method public static void sendSwipeRight(androidx.ui.test.GestureScope);
- method public static void sendSwipeUp(androidx.ui.test.GestureScope);
- method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void pinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendCancel(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method @Deprecated public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method @Deprecated public static void sendMove(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendSwipeDown(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeLeft(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeRight(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeUp(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void swipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void swipeDown(androidx.ui.test.GestureScope);
+ method public static void swipeLeft(androidx.ui.test.GestureScope);
+ method public static void swipeRight(androidx.ui.test.GestureScope);
+ method public static void swipeUp(androidx.ui.test.GestureScope);
+ method public static void swipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void up(androidx.ui.test.PartialGestureScope, int pointerId = 0);
}
public final class KeyInputHelpersKt {
- method public static boolean doSendKeyEvent(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
+ method public static boolean performKeyPress(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
}
public final class OutputKt {
@@ -275,17 +310,17 @@
}
public final class SelectorsKt {
- method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteractionCollection filter(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsNodeInteraction filterToOne(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction last(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAncestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChild(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChildAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onChildren(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onFirst(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onLast(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onParent(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onSibling(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onSiblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
@@ -349,10 +384,14 @@
}
public final class TextActionsKt {
- method public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
- method public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextClearance(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextInput(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performTextReplacement(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
}
}
diff --git a/ui/ui-test/api/public_plus_experimental_0.1.0-dev15.txt b/ui/ui-test/api/public_plus_experimental_0.1.0-dev15.txt
index 7104f4a..e992fff 100644
--- a/ui/ui-test/api/public_plus_experimental_0.1.0-dev15.txt
+++ b/ui/ui-test/api/public_plus_experimental_0.1.0-dev15.txt
@@ -2,12 +2,18 @@
package androidx.ui.test {
public final class ActionsKt {
- method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
- method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
- method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method @Deprecated public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performClick(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method public static void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
}
public final class AnimationClockTestRule implements org.junit.rules.TestRule {
@@ -160,17 +166,17 @@
}
public final class FiltersKt {
- method public static androidx.ui.test.SemanticsMatcher hasAnyAncestorThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyChildThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyDescendantThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnySiblingThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyAncestor(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyChild(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyDescendant(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnySibling(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasClickAction();
method public static androidx.ui.test.SemanticsMatcher hasImeAction(androidx.ui.input.ImeAction actionType);
method public static androidx.ui.test.SemanticsMatcher hasInputMethodsSupport();
method public static androidx.ui.test.SemanticsMatcher hasLabel(String label, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsMatcher hasNoClickAction();
method public static androidx.ui.test.SemanticsMatcher hasNoScrollAction();
- method public static androidx.ui.test.SemanticsMatcher hasParentThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasParent(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasRangeInfo(androidx.ui.semantics.AccessibilityRangeInfo rangeInfo);
method public static androidx.ui.test.SemanticsMatcher hasScrollAction();
method public static androidx.ui.test.SemanticsMatcher hasSubstring(String substring, boolean ignoreCase = false);
@@ -194,22 +200,37 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodes(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNode(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithSubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onRoot(boolean useUnmergedTree = false);
}
public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
+ method public static void cancel(androidx.ui.test.PartialGestureScope);
+ method public static void click(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method public static void doubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method public static void down(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void down(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static inline float getBottom(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomCenter(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomLeft(androidx.ui.test.BaseGestureScope);
@@ -230,32 +251,46 @@
method public static androidx.ui.geometry.Offset getTopRight(androidx.ui.test.BaseGestureScope);
method public static inline int getWidth(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.geometry.Offset position);
+ method public static void longClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method public static void move(androidx.ui.test.PartialGestureScope);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
method public static void movePointerBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
method public static void movePointerTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static androidx.ui.geometry.Offset percentOffset(androidx.ui.test.BaseGestureScope, @FloatRange(from=-1.0, to=1.0) float x = 0f, @FloatRange(from=-1.0, to=1.0) float y = 0f);
- method public static void sendCancel(androidx.ui.test.PartialGestureScope);
- method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
- method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
- method public static void sendMove(androidx.ui.test.PartialGestureScope);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
- method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendSwipeDown(androidx.ui.test.GestureScope);
- method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
- method public static void sendSwipeRight(androidx.ui.test.GestureScope);
- method public static void sendSwipeUp(androidx.ui.test.GestureScope);
- method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void pinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendCancel(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method @Deprecated public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method @Deprecated public static void sendMove(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendSwipeDown(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeLeft(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeRight(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeUp(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void swipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void swipeDown(androidx.ui.test.GestureScope);
+ method public static void swipeLeft(androidx.ui.test.GestureScope);
+ method public static void swipeRight(androidx.ui.test.GestureScope);
+ method public static void swipeUp(androidx.ui.test.GestureScope);
+ method public static void swipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void up(androidx.ui.test.PartialGestureScope, int pointerId = 0);
}
public final class KeyInputHelpersKt {
- method public static boolean doSendKeyEvent(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
+ method public static boolean performKeyPress(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
}
public final class OutputKt {
@@ -275,17 +310,17 @@
}
public final class SelectorsKt {
- method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteractionCollection filter(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsNodeInteraction filterToOne(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction last(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAncestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChild(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChildAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onChildren(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onFirst(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onLast(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onParent(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onSibling(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onSiblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
@@ -349,10 +384,14 @@
}
public final class TextActionsKt {
- method public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
- method public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextClearance(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextInput(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performTextReplacement(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
}
}
diff --git a/ui/ui-test/api/public_plus_experimental_current.txt b/ui/ui-test/api/public_plus_experimental_current.txt
index 7104f4a..e992fff 100644
--- a/ui/ui-test/api/public_plus_experimental_current.txt
+++ b/ui/ui-test/api/public_plus_experimental_current.txt
@@ -2,12 +2,18 @@
package androidx.ui.test {
public final class ActionsKt {
- method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
- method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
- method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method @Deprecated public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performClick(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method public static void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
}
public final class AnimationClockTestRule implements org.junit.rules.TestRule {
@@ -160,17 +166,17 @@
}
public final class FiltersKt {
- method public static androidx.ui.test.SemanticsMatcher hasAnyAncestorThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyChildThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyDescendantThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnySiblingThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyAncestor(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyChild(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyDescendant(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnySibling(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasClickAction();
method public static androidx.ui.test.SemanticsMatcher hasImeAction(androidx.ui.input.ImeAction actionType);
method public static androidx.ui.test.SemanticsMatcher hasInputMethodsSupport();
method public static androidx.ui.test.SemanticsMatcher hasLabel(String label, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsMatcher hasNoClickAction();
method public static androidx.ui.test.SemanticsMatcher hasNoScrollAction();
- method public static androidx.ui.test.SemanticsMatcher hasParentThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasParent(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasRangeInfo(androidx.ui.semantics.AccessibilityRangeInfo rangeInfo);
method public static androidx.ui.test.SemanticsMatcher hasScrollAction();
method public static androidx.ui.test.SemanticsMatcher hasSubstring(String substring, boolean ignoreCase = false);
@@ -194,22 +200,37 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodes(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNode(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithSubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onRoot(boolean useUnmergedTree = false);
}
public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
+ method public static void cancel(androidx.ui.test.PartialGestureScope);
+ method public static void click(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method public static void doubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method public static void down(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void down(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static inline float getBottom(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomCenter(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomLeft(androidx.ui.test.BaseGestureScope);
@@ -230,32 +251,46 @@
method public static androidx.ui.geometry.Offset getTopRight(androidx.ui.test.BaseGestureScope);
method public static inline int getWidth(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.geometry.Offset position);
+ method public static void longClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method public static void move(androidx.ui.test.PartialGestureScope);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
method public static void movePointerBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
method public static void movePointerTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static androidx.ui.geometry.Offset percentOffset(androidx.ui.test.BaseGestureScope, @FloatRange(from=-1.0, to=1.0) float x = 0f, @FloatRange(from=-1.0, to=1.0) float y = 0f);
- method public static void sendCancel(androidx.ui.test.PartialGestureScope);
- method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
- method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
- method public static void sendMove(androidx.ui.test.PartialGestureScope);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
- method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendSwipeDown(androidx.ui.test.GestureScope);
- method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
- method public static void sendSwipeRight(androidx.ui.test.GestureScope);
- method public static void sendSwipeUp(androidx.ui.test.GestureScope);
- method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void pinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendCancel(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method @Deprecated public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method @Deprecated public static void sendMove(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendSwipeDown(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeLeft(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeRight(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeUp(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void swipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void swipeDown(androidx.ui.test.GestureScope);
+ method public static void swipeLeft(androidx.ui.test.GestureScope);
+ method public static void swipeRight(androidx.ui.test.GestureScope);
+ method public static void swipeUp(androidx.ui.test.GestureScope);
+ method public static void swipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void up(androidx.ui.test.PartialGestureScope, int pointerId = 0);
}
public final class KeyInputHelpersKt {
- method public static boolean doSendKeyEvent(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
+ method public static boolean performKeyPress(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
}
public final class OutputKt {
@@ -275,17 +310,17 @@
}
public final class SelectorsKt {
- method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteractionCollection filter(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsNodeInteraction filterToOne(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction last(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAncestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChild(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChildAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onChildren(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onFirst(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onLast(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onParent(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onSibling(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onSiblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
@@ -349,10 +384,14 @@
}
public final class TextActionsKt {
- method public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
- method public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextClearance(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextInput(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performTextReplacement(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
}
}
diff --git a/ui/ui-test/api/restricted_0.1.0-dev15.txt b/ui/ui-test/api/restricted_0.1.0-dev15.txt
index 7104f4a..e992fff 100644
--- a/ui/ui-test/api/restricted_0.1.0-dev15.txt
+++ b/ui/ui-test/api/restricted_0.1.0-dev15.txt
@@ -2,12 +2,18 @@
package androidx.ui.test {
public final class ActionsKt {
- method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
- method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
- method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method @Deprecated public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performClick(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method public static void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
}
public final class AnimationClockTestRule implements org.junit.rules.TestRule {
@@ -160,17 +166,17 @@
}
public final class FiltersKt {
- method public static androidx.ui.test.SemanticsMatcher hasAnyAncestorThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyChildThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyDescendantThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnySiblingThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyAncestor(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyChild(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyDescendant(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnySibling(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasClickAction();
method public static androidx.ui.test.SemanticsMatcher hasImeAction(androidx.ui.input.ImeAction actionType);
method public static androidx.ui.test.SemanticsMatcher hasInputMethodsSupport();
method public static androidx.ui.test.SemanticsMatcher hasLabel(String label, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsMatcher hasNoClickAction();
method public static androidx.ui.test.SemanticsMatcher hasNoScrollAction();
- method public static androidx.ui.test.SemanticsMatcher hasParentThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasParent(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasRangeInfo(androidx.ui.semantics.AccessibilityRangeInfo rangeInfo);
method public static androidx.ui.test.SemanticsMatcher hasScrollAction();
method public static androidx.ui.test.SemanticsMatcher hasSubstring(String substring, boolean ignoreCase = false);
@@ -194,22 +200,37 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodes(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNode(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithSubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onRoot(boolean useUnmergedTree = false);
}
public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
+ method public static void cancel(androidx.ui.test.PartialGestureScope);
+ method public static void click(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method public static void doubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method public static void down(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void down(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static inline float getBottom(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomCenter(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomLeft(androidx.ui.test.BaseGestureScope);
@@ -230,32 +251,46 @@
method public static androidx.ui.geometry.Offset getTopRight(androidx.ui.test.BaseGestureScope);
method public static inline int getWidth(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.geometry.Offset position);
+ method public static void longClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method public static void move(androidx.ui.test.PartialGestureScope);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
method public static void movePointerBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
method public static void movePointerTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static androidx.ui.geometry.Offset percentOffset(androidx.ui.test.BaseGestureScope, @FloatRange(from=-1.0, to=1.0) float x = 0f, @FloatRange(from=-1.0, to=1.0) float y = 0f);
- method public static void sendCancel(androidx.ui.test.PartialGestureScope);
- method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
- method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
- method public static void sendMove(androidx.ui.test.PartialGestureScope);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
- method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendSwipeDown(androidx.ui.test.GestureScope);
- method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
- method public static void sendSwipeRight(androidx.ui.test.GestureScope);
- method public static void sendSwipeUp(androidx.ui.test.GestureScope);
- method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void pinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendCancel(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method @Deprecated public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method @Deprecated public static void sendMove(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendSwipeDown(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeLeft(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeRight(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeUp(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void swipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void swipeDown(androidx.ui.test.GestureScope);
+ method public static void swipeLeft(androidx.ui.test.GestureScope);
+ method public static void swipeRight(androidx.ui.test.GestureScope);
+ method public static void swipeUp(androidx.ui.test.GestureScope);
+ method public static void swipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void up(androidx.ui.test.PartialGestureScope, int pointerId = 0);
}
public final class KeyInputHelpersKt {
- method public static boolean doSendKeyEvent(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
+ method public static boolean performKeyPress(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
}
public final class OutputKt {
@@ -275,17 +310,17 @@
}
public final class SelectorsKt {
- method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteractionCollection filter(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsNodeInteraction filterToOne(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction last(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAncestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChild(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChildAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onChildren(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onFirst(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onLast(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onParent(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onSibling(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onSiblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
@@ -349,10 +384,14 @@
}
public final class TextActionsKt {
- method public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
- method public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextClearance(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextInput(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performTextReplacement(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
}
}
diff --git a/ui/ui-test/api/restricted_current.txt b/ui/ui-test/api/restricted_current.txt
index 7104f4a..e992fff 100644
--- a/ui/ui-test/api/restricted_current.txt
+++ b/ui/ui-test/api/restricted_current.txt
@@ -2,12 +2,18 @@
package androidx.ui.test {
public final class ActionsKt {
- method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
- method public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
- method public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
- method public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static <T extends kotlin.Function<? extends java.lang.Boolean>> void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method @Deprecated public static void callSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doClick(androidx.ui.test.SemanticsNodeInteraction);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction doScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performClick(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction performGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.GestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performPartialGesture(androidx.ui.test.SemanticsNodeInteraction, kotlin.jvm.functions.Function1<? super androidx.ui.test.PartialGestureScope,kotlin.Unit> block);
+ method public static androidx.ui.test.SemanticsNodeInteraction performScrollTo(androidx.ui.test.SemanticsNodeInteraction);
+ method public static <T extends kotlin.Function<? extends java.lang.Boolean>> void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<T>> key, kotlin.jvm.functions.Function1<? super T,kotlin.Unit> invocation);
+ method public static void performSemanticsAction(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.semantics.SemanticsPropertyKey<androidx.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> key);
}
public final class AnimationClockTestRule implements org.junit.rules.TestRule {
@@ -160,17 +166,17 @@
}
public final class FiltersKt {
- method public static androidx.ui.test.SemanticsMatcher hasAnyAncestorThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyChildThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnyDescendantThat(androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsMatcher hasAnySiblingThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyAncestor(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyChild(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnyDescendant(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasAnySibling(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasClickAction();
method public static androidx.ui.test.SemanticsMatcher hasImeAction(androidx.ui.input.ImeAction actionType);
method public static androidx.ui.test.SemanticsMatcher hasInputMethodsSupport();
method public static androidx.ui.test.SemanticsMatcher hasLabel(String label, boolean ignoreCase = false);
method public static androidx.ui.test.SemanticsMatcher hasNoClickAction();
method public static androidx.ui.test.SemanticsMatcher hasNoScrollAction();
- method public static androidx.ui.test.SemanticsMatcher hasParentThat(androidx.ui.test.SemanticsMatcher matcher);
+ method public static androidx.ui.test.SemanticsMatcher hasParent(androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsMatcher hasRangeInfo(androidx.ui.semantics.AccessibilityRangeInfo rangeInfo);
method public static androidx.ui.test.SemanticsMatcher hasScrollAction();
method public static androidx.ui.test.SemanticsMatcher hasSubstring(String substring, boolean ignoreCase = false);
@@ -194,22 +200,37 @@
}
public final class FindersKt {
- method public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
- method public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction find(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAll(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteractionCollection findAllByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findBySubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByTag(String testTag, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findByText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method @Deprecated public static androidx.ui.test.SemanticsNodeInteraction findRoot(boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodes(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAllNodesWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNode(androidx.ui.test.SemanticsMatcher matcher, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithLabel(String label, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithSubstring(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithTag(String testTag, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onNodeWithText(String text, boolean ignoreCase = false, boolean useUnmergedTree = false);
+ method public static androidx.ui.test.SemanticsNodeInteraction onRoot(boolean useUnmergedTree = false);
}
public final class GestureScope extends androidx.ui.test.BaseGestureScope {
}
public final class GestureScopeKt {
+ method public static void cancel(androidx.ui.test.PartialGestureScope);
+ method public static void click(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method public static void doubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method public static void down(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void down(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static inline float getBottom(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomCenter(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset getBottomLeft(androidx.ui.test.BaseGestureScope);
@@ -230,32 +251,46 @@
method public static androidx.ui.geometry.Offset getTopRight(androidx.ui.test.BaseGestureScope);
method public static inline int getWidth(androidx.ui.test.BaseGestureScope);
method public static androidx.ui.geometry.Offset localToGlobal(androidx.ui.test.BaseGestureScope, androidx.ui.geometry.Offset position);
+ method public static void longClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method public static void move(androidx.ui.test.PartialGestureScope);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method public static void moveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
method public static void movePointerBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
method public static void movePointerTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method public static void moveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
method public static androidx.ui.geometry.Offset percentOffset(androidx.ui.test.BaseGestureScope, @FloatRange(from=-1.0, to=1.0) float x = 0f, @FloatRange(from=-1.0, to=1.0) float y = 0f);
- method public static void sendCancel(androidx.ui.test.PartialGestureScope);
- method public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
- method public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
- method public static void sendMove(androidx.ui.test.PartialGestureScope);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
- method public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
- method public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
- method public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
- method public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendSwipeDown(androidx.ui.test.GestureScope);
- method public static void sendSwipeLeft(androidx.ui.test.GestureScope);
- method public static void sendSwipeRight(androidx.ui.test.GestureScope);
- method public static void sendSwipeUp(androidx.ui.test.GestureScope);
- method public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
- method public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void pinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendCancel(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center);
+ method @Deprecated public static void sendDoubleClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration delay = androidx.ui.test.GestureScopeKt.doubleClickDelay);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendDown(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendLongClick(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset position = center, androidx.ui.unit.Duration duration = androidx.ui.core.gesture.ConstantsKt.LongPressTimeout + 100.milliseconds);
+ method @Deprecated public static void sendMove(androidx.ui.test.PartialGestureScope);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveBy(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset delta);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, int pointerId, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendMoveTo(androidx.ui.test.PartialGestureScope, androidx.ui.geometry.Offset position);
+ method @Deprecated public static void sendPinch(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start0, androidx.ui.geometry.Offset end0, androidx.ui.geometry.Offset start1, androidx.ui.geometry.Offset end1, androidx.ui.unit.Duration duration = 400.milliseconds);
+ method @Deprecated public static void sendSwipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendSwipeDown(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeLeft(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeRight(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeUp(androidx.ui.test.GestureScope);
+ method @Deprecated public static void sendSwipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method @Deprecated public static void sendUp(androidx.ui.test.PartialGestureScope, int pointerId = 0);
+ method public static void swipe(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void swipeDown(androidx.ui.test.GestureScope);
+ method public static void swipeLeft(androidx.ui.test.GestureScope);
+ method public static void swipeRight(androidx.ui.test.GestureScope);
+ method public static void swipeUp(androidx.ui.test.GestureScope);
+ method public static void swipeWithVelocity(androidx.ui.test.GestureScope, androidx.ui.geometry.Offset start, androidx.ui.geometry.Offset end, @FloatRange(from=0.0) float endVelocity, androidx.ui.unit.Duration duration = 200.milliseconds);
+ method public static void up(androidx.ui.test.PartialGestureScope, int pointerId = 0);
}
public final class KeyInputHelpersKt {
- method public static boolean doSendKeyEvent(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
+ method public static boolean performKeyPress(androidx.ui.test.SemanticsNodeInteraction, androidx.ui.core.keyinput.KeyEvent2 keyEvent);
}
public final class OutputKt {
@@ -275,17 +310,17 @@
}
public final class SelectorsKt {
- method public static androidx.ui.test.SemanticsNodeInteractionCollection ancestors(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction child(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction childAt(androidx.ui.test.SemanticsNodeInteraction, int index);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection children(androidx.ui.test.SemanticsNodeInteraction);
method public static androidx.ui.test.SemanticsNodeInteractionCollection filter(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
method public static androidx.ui.test.SemanticsNodeInteraction filterToOne(androidx.ui.test.SemanticsNodeInteractionCollection, androidx.ui.test.SemanticsMatcher matcher);
- method public static androidx.ui.test.SemanticsNodeInteraction first(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction last(androidx.ui.test.SemanticsNodeInteractionCollection);
- method public static androidx.ui.test.SemanticsNodeInteraction parent(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteraction sibling(androidx.ui.test.SemanticsNodeInteraction);
- method public static androidx.ui.test.SemanticsNodeInteractionCollection siblings(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onAncestors(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChild(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onChildAt(androidx.ui.test.SemanticsNodeInteraction, int index);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onChildren(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onFirst(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onLast(androidx.ui.test.SemanticsNodeInteractionCollection);
+ method public static androidx.ui.test.SemanticsNodeInteraction onParent(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteraction onSibling(androidx.ui.test.SemanticsNodeInteraction);
+ method public static androidx.ui.test.SemanticsNodeInteractionCollection onSiblings(androidx.ui.test.SemanticsNodeInteraction);
}
public final class SemanticsMatcher {
@@ -349,10 +384,14 @@
}
public final class TextActionsKt {
- method public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
- method public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
- method public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doClearText(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doReplaceText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method @Deprecated public static void doSendText(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performImeAction(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextClearance(androidx.ui.test.SemanticsNodeInteraction, boolean alreadyHasFocus = false);
+ method public static void performTextInput(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
+ method public static void performTextReplacement(androidx.ui.test.SemanticsNodeInteraction, String text, boolean alreadyHasFocus = false);
}
}
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"))
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt b/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
index 9543c65..96b92f0 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
@@ -24,9 +24,9 @@
import androidx.ui.semantics.SemanticsPropertyKey
/**
- * Performs a click action on the given component.
+ * Performs a click action on the element represented by the given semantics node.
*/
-fun SemanticsNodeInteraction.doClick(): SemanticsNodeInteraction {
+fun SemanticsNodeInteraction.performClick(): SemanticsNodeInteraction {
// TODO(jellefresen): Replace with semantics action when semantics merging is done
// The problem we currently have is that the click action might be defined on a different
// semantics node than we're interacting with now, even though it is "semantically" the same.
@@ -35,22 +35,22 @@
// Since in general the intended click action can be on a wrapping node or a child node, we
// can't just forward to the correct node, as we don't know if we should search up or down the
// tree.
- return doGesture {
- sendClick()
+ return performGesture {
+ click()
}
}
/**
- * Scrolls to a component using SemanticsActions. It first identifies a parent component with a
+ * Scrolls to a node using SemanticsActions. It first identifies a parent semantics node with a
* Semantics ScrollTo action, then it retrieves the location of the current element and computes
* the relative coordinates that will be used by the scroller.
*
- * Throws [AssertionError] if there is no parent component with ScrollTo SemanticsAction, the
- * current semantics component doesn't have a bounding rectangle set or if a layout node used to
+ * Throws [AssertionError] if there is no parent node with ScrollTo SemanticsAction, the
+ * current semantics node doesn't have a bounding rectangle set or if a layout node used to
* compute the relative coordinates to be fed to the ScrollTo action can't be found.
*/
-fun SemanticsNodeInteraction.doScrollTo(): SemanticsNodeInteraction {
- // find containing component with scroll action
+fun SemanticsNodeInteraction.performScrollTo(): SemanticsNodeInteraction {
+ // find containing node with scroll action
val errorMessageOnFail = "Failed to perform doScrollTo."
val node = fetchSemanticsNode(errorMessageOnFail)
val scrollableSemanticsNode = node.findClosestParentNode {
@@ -82,13 +82,13 @@
*
* Example usage:
* ```
- * findByTag("myWidget")
+ * onNodeWithTag("myWidget")
* .doGesture {
* sendSwipeUp()
* }
* ```
*/
-fun SemanticsNodeInteraction.doGesture(
+fun SemanticsNodeInteraction.performGesture(
block: GestureScope.() -> Unit
): SemanticsNodeInteraction {
val node = fetchSemanticsNode("Failed to perform a gesture.")
@@ -107,19 +107,19 @@
* complete and can be resumed later. It is the responsibility of the caller to make sure partial
* gestures don't leave the test in an inconsistent state.
*
- * When [sending the down event][sendDown], a token is returned which needs to be used in all
+ * When [sending the down event][down], a token is returned which needs to be used in all
* subsequent events of this gesture.
*
* Example usage:
* ```
* val position = Offset(10f, 10f)
- * findByTag("myWidget")
- * .doPartialGesture { sendDown(position) }
+ * onNodeWithTag("myWidget")
+ * .performPartialGesture { sendDown(position) }
* .assertHasClickAction()
- * .doPartialGesture { sendUp(position) }
+ * .performPartialGesture { sendUp(position) }
* ```
*/
-fun SemanticsNodeInteraction.doPartialGesture(
+fun SemanticsNodeInteraction.performPartialGesture(
block: PartialGestureScope.() -> Unit
): SemanticsNodeInteraction {
val node = fetchSemanticsNode("Failed to perform a partial gesture.")
@@ -148,15 +148,15 @@
*
* @throws AssertionError If the semantics action is not defined on this node.
*/
-fun <T : Function<Boolean>> SemanticsNodeInteraction.callSemanticsAction(
+fun <T : Function<Boolean>> SemanticsNodeInteraction.performSemanticsAction(
key: SemanticsPropertyKey<AccessibilityAction<T>>,
invocation: (T) -> Unit
) {
- val node = fetchSemanticsNode("Failed to call ${key.name} action.")
+ val node = fetchSemanticsNode("Failed to perform ${key.name} action.")
if (key !in node.config) {
throw AssertionError(
buildGeneralErrorMessage(
- "Failed to call ${key.name} action as it is not defined on the node.",
+ "Failed to perform ${key.name} action as it is not defined on the node.",
selector, node)
)
}
@@ -179,8 +179,111 @@
*
* @throws AssertionError If the semantics action is not defined on this node.
*/
-fun SemanticsNodeInteraction.callSemanticsAction(
+fun SemanticsNodeInteraction.performSemanticsAction(
key: SemanticsPropertyKey<AccessibilityAction<() -> Boolean>>
) {
- callSemanticsAction(key) { it.invoke() }
+ performSemanticsAction(key) { it.invoke() }
}
+
+// DEPRECATED APIs SECTION
+
+/**
+ * Performs a click action on the given component.
+ */
+@Deprecated("Renamed to performClick",
+ replaceWith = ReplaceWith("performClick()"))
+fun SemanticsNodeInteraction.doClick(): SemanticsNodeInteraction = performClick()
+
+/**
+ * Scrolls to a component using SemanticsActions. It first identifies a parent component with a
+ * Semantics ScrollTo action, then it retrieves the location of the current element and computes
+ * the relative coordinates that will be used by the scroller.
+ *
+ * Throws [AssertionError] if there is no parent component with ScrollTo SemanticsAction, the
+ * current semantics component doesn't have a bounding rectangle set or if a layout node used to
+ * compute the relative coordinates to be fed to the ScrollTo action can't be found.
+ */
+@Deprecated("Renamed to performScrollTo",
+ replaceWith = ReplaceWith("performScrollTo()"))
+fun SemanticsNodeInteraction.doScrollTo(): SemanticsNodeInteraction = performScrollTo()
+
+/**
+ * Executes the gestures specified in the given block.
+ *
+ * Example usage:
+ * ```
+ * onNodeWithTag("myWidget")
+ * .doGesture {
+ * sendSwipeUp()
+ * }
+ * ```
+ */
+@Deprecated("Renamed to performGesture",
+ replaceWith = ReplaceWith("performGesture(block)"))
+fun SemanticsNodeInteraction.doGesture(
+ block: GestureScope.() -> Unit
+): SemanticsNodeInteraction = performGesture(block)
+
+/**
+ * Executes the (partial) gesture specified in the given block. The gesture doesn't need to be
+ * complete and can be resumed later. It is the responsibility of the caller to make sure partial
+ * gestures don't leave the test in an inconsistent state.
+ *
+ * When [sending the down event][down], a token is returned which needs to be used in all
+ * subsequent events of this gesture.
+ *
+ * Example usage:
+ * ```
+ * val position = Offset(10f, 10f)
+ * onNodeWithTag("myWidget")
+ * .doPartialGesture { sendDown(position) }
+ * .assertHasClickAction()
+ * .doPartialGesture { sendUp(position) }
+ * ```
+ */
+@Deprecated("Renamed to performPartialGesture",
+ replaceWith = ReplaceWith("performPartialGesture(block)"))
+fun SemanticsNodeInteraction.doPartialGesture(
+ block: PartialGestureScope.() -> Unit
+): SemanticsNodeInteraction = performPartialGesture(block)
+
+/**
+ * Provides support to call custom semantics actions on this node.
+ *
+ * This method is supposed to be used for actions with parameters.
+ *
+ * This will properly verify that the actions exists and provide clear error message in case it
+ * does not. It also handle synchronization and performing the action on the UI thread. This call
+ * is blocking until the action is performed
+ *
+ * @param key Key of the action to be performed.
+ * @param invocation Place where you call your action. In the argument is provided the underlying
+ * action from the given Semantics action.
+ *
+ * @throws AssertionError If the semantics action is not defined on this node.
+ */
+@Deprecated("Renamed to performSemanticsAction",
+ replaceWith = ReplaceWith("performSemanticsAction(key, invocation)"))
+fun <T : Function<Boolean>> SemanticsNodeInteraction.callSemanticsAction(
+ key: SemanticsPropertyKey<AccessibilityAction<T>>,
+ invocation: (T) -> Unit
+) = performSemanticsAction(key, invocation)
+
+/**
+ * Provides support to call custom semantics actions on this node.
+ *
+ * This method is for calling actions that have no parameters.
+ *
+ * This will properly verify that the actions exists and provide clear error message in case it
+ * does not. It also handle synchronization and performing the action on the UI thread. This call
+ * is blocking until the action is performed
+ *
+ * @param key Key of the action to be performed.
+ *
+ * @throws AssertionError If the semantics action is not defined on this node.
+ */
+@Deprecated("Renamed to performSemanticsAction",
+ replaceWith = ReplaceWith("performSemanticsAction(key)"))
+fun SemanticsNodeInteraction.callSemanticsAction(
+ key: SemanticsPropertyKey<AccessibilityAction<() -> Boolean>>
+) = performSemanticsAction(key)
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt b/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
index 7e72a19..a5641aa 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Assertions.kt
@@ -31,31 +31,31 @@
import androidx.ui.unit.width
/**
- * Asserts that the current component has hidden property set to true.
+ * Asserts that the current semantics node has hidden property set to true.
*
- * Note that this does not verify parents of the component. For stronger guarantees of visibility
- * see [assertIsNotDisplayed]. If you want to assert that the component is not even in the hierarchy
+ * Note that this does not verify parents of the node. For stronger guarantees of visibility
+ * see [assertIsNotDisplayed]. If you want to assert that the node is not even in the hierarchy
* use [SemanticsNodeInteraction.assertDoesNotExist].
*
- * Throws [AssertionError] if the component is not hidden.
+ * Throws [AssertionError] if the node is not hidden.
*/
fun SemanticsNodeInteraction.assertIsHidden(): SemanticsNodeInteraction = assert(isHidden())
/**
- * Asserts that the current component has hidden property set to false.
+ * Asserts that the current semantics node has hidden property set to false.
*
- * Note that this does not verify parents of the component. For stronger guarantees of visibility
- * see [assertIsDisplayed]. If you only want to assert that the component is in the hierarchy use
+ * Note that this does not verify parents of the node. For stronger guarantees of visibility
+ * see [assertIsDisplayed]. If you only want to assert that the node is in the hierarchy use
* [SemanticsNodeInteraction.assertExists]
*
- * Throws [AssertionError] if the component is hidden.
+ * Throws [AssertionError] if the node is hidden.
*/
fun SemanticsNodeInteraction.assertIsNotHidden(): SemanticsNodeInteraction = assert(isNotHidden())
/**
- * Asserts that the current component is displayed on screen.
+ * Asserts that the current semantics node is displayed on screen.
*
- * Throws [AssertionError] if the component is not displayed.
+ * Throws [AssertionError] if the node is not displayed.
*/
fun SemanticsNodeInteraction.assertIsDisplayed(): SemanticsNodeInteraction {
// TODO(b/143607231): check semantics hidden property
@@ -69,9 +69,9 @@
}
/**
- * Asserts that the current component is not displayed on screen.
+ * Asserts that the current semantics node is not displayed on screen.
*
- * Throws [AssertionError] if the component is displayed.
+ * Throws [AssertionError] if the node is displayed.
*/
fun SemanticsNodeInteraction.assertIsNotDisplayed(): SemanticsNodeInteraction {
// TODO(b/143607231): check semantics hidden property
@@ -85,73 +85,73 @@
}
/**
- * Asserts that the current component is enabled.
+ * Asserts that the current semantics node is enabled.
*
- * Throws [AssertionError] if the component is not enabled or does not define the property at all.
+ * Throws [AssertionError] if the node is not enabled or does not define the property at all.
*/
fun SemanticsNodeInteraction.assertIsEnabled(): SemanticsNodeInteraction = assert(isEnabled())
/**
- * Asserts that the current component is not enabled.
+ * Asserts that the current semantics node is not enabled.
*
- * Throws [AssertionError] if the component is enabled or does not defined the property at all.
+ * Throws [AssertionError] if the node is enabled or does not defined the property at all.
*/
fun SemanticsNodeInteraction.assertIsNotEnabled(): SemanticsNodeInteraction = assert(isNotEnabled())
/**
- * Asserts that the current component is checked.
+ * Asserts that the current semantics node is checked.
*
- * Throws [AssertionError] if the component is not unchecked, indeterminate, or not toggleable.
+ * Throws [AssertionError] if the node is not unchecked, indeterminate, or not toggleable.
*/
fun SemanticsNodeInteraction.assertIsOn(): SemanticsNodeInteraction = assert(isOn())
/**
- * Asserts that the current component is unchecked.
+ * Asserts that the current semantics node is unchecked.
*
- * Throws [AssertionError] if the component is checked, indeterminate, or not toggleable.
+ * Throws [AssertionError] if the node is checked, indeterminate, or not toggleable.
*/
fun SemanticsNodeInteraction.assertIsOff(): SemanticsNodeInteraction = assert(isOff())
/**
- * Asserts that the current component is selected.
+ * Asserts that the current semantics node is selected.
*
- * Throws [AssertionError] if the component is unselected or not selectable.
+ * Throws [AssertionError] if the node is unselected or not selectable.
*/
fun SemanticsNodeInteraction.assertIsSelected(): SemanticsNodeInteraction = assert(isSelected())
/**
- * Asserts that the current component is unselected.
+ * Asserts that the current semantics node is unselected.
*
- * Throws [AssertionError] if the component is selected or not selectable.
+ * Throws [AssertionError] if the node is selected or not selectable.
*/
fun SemanticsNodeInteraction.assertIsUnselected(): SemanticsNodeInteraction =
assert(isUnselected())
/**
- * Asserts that the current component is toggleable.
+ * Asserts that the current semantics node is toggleable.
*
- * Throws [AssertionError] if the component is not toggleable.
+ * Throws [AssertionError] if the node is not toggleable.
*/
fun SemanticsNodeInteraction.assertIsToggleable(): SemanticsNodeInteraction =
assert(isToggleable())
/**
- * Asserts that the current component is selectable.
+ * Asserts that the current semantics node is selectable.
*
- * Throws [AssertionError] if the component is not selectable.
+ * Throws [AssertionError] if the node is not selectable.
*/
fun SemanticsNodeInteraction.assertIsSelectable(): SemanticsNodeInteraction =
assert(isSelectable())
/**
- * Asserts the component is in a mutually exclusive group. This is used by radio groups to assert
- * only one is selected at a given time.
+ * Asserts the semantics node is in a mutually exclusive group. This is used by radio groups to
+ * assert only one is selected at a given time.
*/
fun SemanticsNodeInteraction.assertIsInMutuallyExclusiveGroup(): SemanticsNodeInteraction =
assert(isInMutuallyExclusiveGroup())
/**
- * Asserts the component's label equals the given String.
+ * Asserts the node's label equals the given String.
* For further details please check [SemanticsProperties.AccessibilityLabel].
* Throws [AssertionError] if the node's value is not equal to `value`, or if the node has no value
*/
@@ -159,7 +159,7 @@
assert(hasLabel(value))
/**
- * Asserts the component's text equals the given String.
+ * Asserts the node's text equals the given String.
* For further details please check [SemanticsProperties.Text].
* Throws [AssertionError] if the node's value is not equal to `value`, or if the node has no value
*/
@@ -167,7 +167,7 @@
assert(hasText(value))
/**
- * Asserts the component's value equals the given value.
+ * Asserts the node's value equals the given value.
*
* For further details please check [SemanticsProperties.AccessibilityValue].
* Throws [AssertionError] if the node's value is not equal to `value`, or if the node has no value
@@ -176,7 +176,7 @@
assert(hasValue(value))
/**
- * Asserts the component's range info equals the given value.
+ * Asserts the node's range info equals the given value.
*
* For further details please check [SemanticsProperties.AccessibilityRangeInfo].
* Throws [AssertionError] if the node's value is not equal to `value`, or if the node has no value
@@ -186,17 +186,17 @@
assert(hasRangeInfo(value))
/**
- * Asserts that the current component has a click action.
+ * Asserts that the current semantics node has a click action.
*
- * Throws [AssertionError] if the component is doesn't have a click action.
+ * Throws [AssertionError] if the node is doesn't have a click action.
*/
fun SemanticsNodeInteraction.assertHasClickAction(): SemanticsNodeInteraction =
assert(hasClickAction())
/**
- * Asserts that the current component doesn't have a click action.
+ * Asserts that the current semantics node has doesn't have a click action.
*
- * Throws [AssertionError] if the component has a click action.
+ * Throws [AssertionError] if the node has a click action.
*/
fun SemanticsNodeInteraction.assertHasNoClickAction(): SemanticsNodeInteraction =
assert(hasNoClickAction())
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/BitmapHelpers.kt b/ui/ui-test/src/main/java/androidx/ui/test/BitmapHelpers.kt
index 822aeb2..6f2b904 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/BitmapHelpers.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/BitmapHelpers.kt
@@ -43,9 +43,9 @@
import kotlin.math.roundToInt
/**
- * Captures the underlying component's surface into bitmap.
+ * Captures the underlying semantics node's surface into bitmap.
*
- * This has a limitation that if there is another window covering part of this component, such a
+ * This has a limitation that if there is another window covering part of this node, such a
* window won't occur in this bitmap.
*/
@RequiresApi(Build.VERSION_CODES.O)
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt b/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
index eba23b0..fb073fa 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
@@ -28,7 +28,7 @@
import androidx.ui.util.fastAny
/**
- * Returns whether the component is enabled.
+ * Returns whether the node is enabled.
*
* @see SemanticsProperties.Enabled
*/
@@ -36,7 +36,7 @@
SemanticsMatcher.expectValue(SemanticsProperties.Enabled, true)
/**
- * Returns whether the component is not enabled.
+ * Returns whether the node is not enabled.
*
* @see SemanticsProperties.Enabled
*/
@@ -44,7 +44,7 @@
SemanticsMatcher.expectValue(SemanticsProperties.Enabled, false)
/**
- * Return whether the component is checkable.
+ * Return whether the node is checkable.
*
* @see FoundationSemanticsProperties.ToggleableState
*/
@@ -52,7 +52,7 @@
SemanticsMatcher.keyIsDefined(FoundationSemanticsProperties.ToggleableState)
/**
- * Returns whether the component is toggled.
+ * Returns whether the node is toggled.
*
* @see FoundationSemanticsProperties.ToggleableState
*/
@@ -60,7 +60,7 @@
FoundationSemanticsProperties.ToggleableState, ToggleableState.On)
/**
- * Returns whether the component is not toggled.
+ * Returns whether the node is not toggled.
*
* @see FoundationSemanticsProperties.ToggleableState
*/
@@ -68,7 +68,7 @@
FoundationSemanticsProperties.ToggleableState, ToggleableState.Off)
/**
- * Return whether the component is selectable.
+ * Return whether the node is selectable.
*
* @see FoundationSemanticsProperties.Selected
*/
@@ -76,7 +76,7 @@
SemanticsMatcher.keyIsDefined(FoundationSemanticsProperties.Selected)
/**
- * Returns whether the component is selected.
+ * Returns whether the node is selected.
*
* @see FoundationSemanticsProperties.Selected
*/
@@ -84,7 +84,7 @@
SemanticsMatcher.expectValue(FoundationSemanticsProperties.Selected, true)
/**
- * Returns whether the component is not selected.
+ * Returns whether the node is not selected.
*
* @see FoundationSemanticsProperties.Selected
*/
@@ -92,7 +92,7 @@
SemanticsMatcher.expectValue(FoundationSemanticsProperties.Selected, false)
/**
- * Return whether the component has a semantics click action defined.
+ * Return whether the node has a semantics click action defined.
*
* @see SemanticsActions.OnClick
*/
@@ -100,7 +100,7 @@
SemanticsMatcher.keyIsDefined(SemanticsActions.OnClick)
/**
- * Return whether the component has no semantics click action defined.
+ * Return whether the node has no semantics click action defined.
*
* @see SemanticsActions.OnClick
*/
@@ -108,7 +108,7 @@
SemanticsMatcher.keyNotDefined(SemanticsActions.OnClick)
/**
- * Return whether the component has a semantics scrollable action defined.
+ * Return whether the node has a semantics scrollable action defined.
*
* @see SemanticsActions.ScrollTo
*/
@@ -116,7 +116,7 @@
SemanticsMatcher.keyIsDefined(SemanticsActions.ScrollTo)
/**
- * Return whether the component has no semantics scrollable action defined.
+ * Return whether the node has no semantics scrollable action defined.
*
* @see SemanticsActions.ScrollTo
*/
@@ -124,7 +124,7 @@
SemanticsMatcher.keyNotDefined(SemanticsActions.ScrollTo)
/**
- * Returns whether the component's label matches exactly to the given text.
+ * Returns whether the node's label matches exactly to the given text.
*
* @param label Text to match.
* @param ignoreCase Whether case should be ignored.
@@ -140,7 +140,7 @@
}
/**
- * Returns whether the component's text matches exactly to the given text.
+ * Returns whether the node's text matches exactly to the given text.
*
* @param text Text to match.
* @param ignoreCase Whether case should be ignored.
@@ -157,7 +157,7 @@
}
/**
- * Returns whether the component's text contains the given substring.
+ * Returns whether the node's text contains the given substring.
*
* @param substring Substring to check.
* @param ignoreCase Whether case should be ignored.
@@ -176,7 +176,7 @@
}
/**
- * Returns whether the component's value matches exactly to the given accessibility value.
+ * Returns whether the node's value matches exactly to the given accessibility value.
*
* @param value Value to match.
*
@@ -186,7 +186,7 @@
SemanticsProperties.AccessibilityValue, value)
/**
- * Returns whether the component's range info matches exactly to the given accessibility range info.
+ * Returns whether the node's range info matches exactly to the given accessibility range info.
*
* @param rangeInfo range info to match.
*
@@ -196,7 +196,7 @@
.expectValue(SemanticsProperties.AccessibilityRangeInfo, rangeInfo)
/**
- * Returns whether the component is annotated by the given test tag.
+ * Returns whether the node is annotated by the given test tag.
*
* @param testTag Value to match.
*
@@ -207,7 +207,7 @@
// TODO(ryanmentley/pavlis): Do we want these convenience functions?
/**
- * Verifies that the component is in a mutually exclusive group - that is,
+ * Verifies that the node is in a mutually exclusive group - that is,
* that [FoundationSemanticsProperties.InMutuallyExclusiveGroup] is set to true
*
*/
@@ -215,9 +215,9 @@
SemanticsMatcher.expectValue(FoundationSemanticsProperties.InMutuallyExclusiveGroup, true)
/**
- * Returns whether the component is hidden.
+ * Returns whether the node is hidden.
*
- * This checks only the property of the component itself. Ignoring parents visibility.
+ * This checks only the property of the node itself. Ignoring parents visibility.
*
* @see SemanticsProperties.Hidden
*/
@@ -225,9 +225,9 @@
SemanticsMatcher.expectValue(SemanticsProperties.Hidden, true)
/**
- * Returns whether the component is not hidden.
+ * Returns whether the node is not hidden.
*
- * This checks only the property of the component itself. Ignoring parents visibility.
+ * This checks only the property of the node itself. Ignoring parents visibility.
*
* @see SemanticsProperties.Hidden
*/
@@ -235,9 +235,9 @@
SemanticsMatcher.expectValue(SemanticsProperties.Hidden, false)
/**
- * Returns whether the component is a dialog.
+ * Returns whether the node is a dialog.
*
- * This only checks if the component itself is a dialog, not if it is _part of_ a dialog. Use
+ * This only checks if the node itself is a dialog, not if it is _part of_ a dialog. Use
* `hasAnyAncestorThat(isDialog())` for that.
*
* @see FoundationSemanticsProperties.IsDialog
@@ -245,9 +245,9 @@
fun isDialog(): SemanticsMatcher =
SemanticsMatcher.keyIsDefined(FoundationSemanticsProperties.IsDialog)
-/** Returns whether the component is a popup.
+/** Returns whether the node is a popup.
*
- * This only checks if the component itself is a popup, not if it is _part of_ a popup. Use
+ * This only checks if the node itself is a popup, not if it is _part of_ a popup. Use
* `hasAnyAncestorThat(isPopup())` for that.
*
* @see SemanticsProperties.IsPopup
@@ -256,7 +256,7 @@
SemanticsMatcher.keyIsDefined(SemanticsProperties.IsPopup)
/**
- * Returns whether the component defines the given IME action.
+ * Returns whether the node defines the given IME action.
*
* @param actionType the action to match.
*/
@@ -264,30 +264,30 @@
SemanticsMatcher.expectValue(TextSemanticsProperties.ImeAction, actionType)
/**
- * Return whether the component supports input methods.
+ * Return whether the node supports input methods.
*
- * Supporting input methods means that the component provides a connection to IME (keyboard) and is
- * able to accept input from it. This is however not enforced and relies on the components to
+ * Supporting input methods means that the node provides a connection to IME (keyboard) and is
+ * able to accept input from it. This is however not enforced and relies on the nodes to
* properly add this to semantics when they provide input. Note that this is not related to
* gestures input but only to IME. This can be used to for instance filter out all text fields.
*/
fun hasInputMethodsSupport() =
SemanticsMatcher.expectValue(TextSemanticsProperties.SupportsInputMethods, true)
-/*
- * Return whether the component is the root semantics node.
+/**
+ * Return whether the node is the root semantics node.
*
- * There is always one root in every component tree, added implicitly by Compose.
+ * There is always one root in every node tree, added implicitly by Compose.
*/
fun isRoot() =
SemanticsMatcher("isRoot") { it.isRoot }
/**
- * Returns whether the component's parent satisfies the given matcher.
+ * Returns whether the node's parent satisfies the given matcher.
*
* Returns false if no parent exists.
*/
-fun hasParentThat(matcher: SemanticsMatcher): SemanticsMatcher {
+fun hasParent(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the parent's node semantics
// in the error message or say that no parent was found.
return SemanticsMatcher("hasParentThat(${matcher.description})") {
@@ -296,9 +296,9 @@
}
/**
- * Returns whether the component has at least one child that satisfies the given matcher.
+ * Returns whether the node has at least one child that satisfies the given matcher.
*/
-fun hasAnyChildThat(matcher: SemanticsMatcher): SemanticsMatcher {
+fun hasAnyChild(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the children nodes semantics
// in the error message or say that no children were found.
return SemanticsMatcher("hasAnyChildThat(${matcher.description})") {
@@ -307,11 +307,11 @@
}
/**
- * Returns whether the component has at least one sibling that satisfies the given matcher.
+ * Returns whether the node has at least one sibling that satisfies the given matcher.
*
* Sibling is defined as a any other node that shares the same parent.
*/
-fun hasAnySiblingThat(matcher: SemanticsMatcher): SemanticsMatcher {
+fun hasAnySibling(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the sibling nodes semantics
// in the error message or say that no siblings were found.
return SemanticsMatcher("hasAnySiblingThat(${matcher.description})"
@@ -323,7 +323,7 @@
}
/**
- * Returns whether the component has at least one ancestor that satisfies the given matcher.
+ * Returns whether the node has at least one ancestor that satisfies the given matcher.
*
* Example: For the following tree
* |-X
@@ -333,7 +333,7 @@
* |-C2
* In case of C1, we would check the matcher against A and B
*/
-fun hasAnyAncestorThat(matcher: SemanticsMatcher): SemanticsMatcher {
+fun hasAnyAncestor(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we should print the ancestor nodes semantics
// in the error message or say that no ancestors were found.
return SemanticsMatcher("hasAnyAncestorThat(${matcher.description})") {
@@ -342,7 +342,7 @@
}
/**
- * Returns whether the component has at least one descendant that satisfies the given matcher.
+ * Returns whether the node has at least one descendant that satisfies the given matcher.
*
* Example: For the following tree
* |-X
@@ -352,7 +352,7 @@
* |-C2
* In case of A, we would check the matcher against B,C1 and C2
*/
-fun hasAnyDescendantThat(matcher: SemanticsMatcher): SemanticsMatcher {
+fun hasAnyDescendant(matcher: SemanticsMatcher): SemanticsMatcher {
// TODO(b/150292800): If this is used in assert we could consider printing the whole subtree but
// it might be too much to show. But we could at least warn if there were no ancestors found.
fun checkIfSubtreeMatches(matcher: SemanticsMatcher, node: SemanticsNode): Boolean {
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt b/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt
index fd37af3..95650cb 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Finders.kt
@@ -17,18 +17,170 @@
package androidx.ui.test
/**
+ * Finds a semantics node identified by the given tag.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ *
+ * @see onNode for general find method.
+ */
+fun onNodeWithTag(
+ testTag: String,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteraction = onNode(hasTestTag(testTag), useUnmergedTree)
+
+/**
+ * Finds all semantics nodes identified by the given tag.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ *
+ * @see onAllNodes for general find method.
+ */
+fun onAllNodesWithTag(
+ testTag: String,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteractionCollection = onAllNodes(hasTestTag(testTag), useUnmergedTree)
+
+/**
+ * Finds a semantics node with the given label as its accessibilityLabel.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ *
+ * @see onNode for general find method.
+ */
+fun onNodeWithLabel(
+ label: String,
+ ignoreCase: Boolean = false,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteraction = onNode(hasLabel(label, ignoreCase), useUnmergedTree)
+
+/**
+ * Finds a semantincs node with the given text.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ * @see onNodeWithSubstring to search by substring instead of via exact match.
+ * @see onNode for general find method.
+ */
+fun onNodeWithText(
+ text: String,
+ ignoreCase: Boolean = false,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteraction = onNode(hasText(text, ignoreCase), useUnmergedTree)
+
+/**
+ * Finds a semantics node with text that contains the given substring.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ * @see onNodeWithText to perform exact matches.
+ * @see onNode for general find method.
+ */
+fun onNodeWithSubstring(
+ text: String,
+ ignoreCase: Boolean = false,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteraction = onNode(hasSubstring(text, ignoreCase), useUnmergedTree)
+
+/**
+ * Finds all semantics nodes with the given text.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ */
+fun onAllNodesWithText(
+ text: String,
+ ignoreCase: Boolean = false,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteractionCollection = onAllNodes(hasText(text, ignoreCase), useUnmergedTree)
+
+/**
+ * Finds all semantics nodes with the given label as AccessibilityLabel.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ */
+fun onAllNodesWithLabel(
+ label: String,
+ ignoreCase: Boolean = false,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteractionCollection = onAllNodes(hasLabel(label, ignoreCase), useUnmergedTree)
+
+/**
+ * Finds the root semantics node of the Compose tree.
+ *
+ * Useful for example for screenshot tests of the entire scene.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ */
+fun onRoot(useUnmergedTree: Boolean = false): SemanticsNodeInteraction =
+ onNode(isRoot(), useUnmergedTree)
+
+/**
+ * Finds a semantics node that matches the given condition.
+ *
+ * Any subsequent operation on its result will expect exactly one element found (unless
+ * [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
+ * none or more than one element is found.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ * @see onAllNodes to work with multiple elements
+ */
+fun onNode(
+ matcher: SemanticsMatcher,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteraction {
+ return SemanticsNodeInteraction(useUnmergedTree, SemanticsSelector(matcher))
+}
+
+/**
+ * Finds all semantics nodes that match the given condition.
+ *
+ * If you are working with elements that are not supposed to occur multiple times use [onNode]
+ * instead.
+ *
+ * For usage patterns and semantics concepts see [SemanticsNodeInteraction]
+ *
+ * @param useUnmergedTree Find within merged composables like Buttons.
+ * @see onNode
+ */
+fun onAllNodes(
+ matcher: SemanticsMatcher,
+ useUnmergedTree: Boolean = false
+): SemanticsNodeInteractionCollection {
+ return SemanticsNodeInteractionCollection(useUnmergedTree, SemanticsSelector(matcher))
+}
+
+// DEPRECATED APIs SECTION
+
+/**
* Finds a component identified by the given tag.
*
* For usage patterns and semantics concepts see [SemanticsNodeInteraction]
*
* @param useUnmergedTree Find within merged composables like Buttons.
*
- * @see find for general find method.
+ * @see onNode for general find method.
*/
+@Deprecated("Renamed to onNodeWithTag",
+ replaceWith = ReplaceWith("onNodeWithTag(testTag, useUnmergedTree)"))
fun findByTag(
testTag: String,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteraction = find(hasTestTag(testTag), useUnmergedTree)
+): SemanticsNodeInteraction = onNodeWithTag(testTag, useUnmergedTree)
/**
* Finds all components identified by the given tag.
@@ -37,12 +189,14 @@
*
* @param useUnmergedTree Find within merged composables like Buttons.
*
- * @see findAll for general find method.
+ * @see onAllNodes for general find method.
*/
+@Deprecated("Renamed to onAllNodesWithTag",
+ replaceWith = ReplaceWith("onAllNodesWithTag(testTag, useUnmergedTree)"))
fun findAllByTag(
testTag: String,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteractionCollection = findAll(hasTestTag(testTag), useUnmergedTree)
+): SemanticsNodeInteractionCollection = onAllNodesWithTag(testTag, useUnmergedTree)
/**
* Finds a component with the given label as its accessibilityLabel.
@@ -51,13 +205,15 @@
*
* @param useUnmergedTree Find within merged composables like Buttons.
*
- * @see find for general find method.
+ * @see onNode for general find method.
*/
+@Deprecated("Renamed to onNodeWithLabel",
+ replaceWith = ReplaceWith("onNodeWithLabel(label, ignoreCase, useUnmergedTree)"))
fun findByLabel(
label: String,
ignoreCase: Boolean = false,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteraction = find(hasLabel(label, ignoreCase), useUnmergedTree)
+): SemanticsNodeInteraction = onNodeWithLabel(label, ignoreCase, useUnmergedTree)
/**
* Finds a component with the given text.
@@ -65,14 +221,16 @@
* For usage patterns and semantics concepts see [SemanticsNodeInteraction]
*
* @param useUnmergedTree Find within merged composables like Buttons.
- * @see findBySubstring to search by substring instead of via exact match.
- * @see find for general find method.
+ * @see onNodeWithSubstring to search by substring instead of via exact match.
+ * @see onNode for general find method.
*/
+@Deprecated("Renamed to onNodeWithText",
+ replaceWith = ReplaceWith("onNodeWithText(text, ignoreCase, useUnmergedTree)"))
fun findByText(
text: String,
ignoreCase: Boolean = false,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteraction = find(hasText(text, ignoreCase), useUnmergedTree)
+): SemanticsNodeInteraction = onNodeWithText(text, ignoreCase, useUnmergedTree)
/**
* Finds a component with text that contains the given substring.
@@ -80,14 +238,16 @@
* For usage patterns and semantics concepts see [SemanticsNodeInteraction]
*
* @param useUnmergedTree Find within merged composables like Buttons.
- * @see findByText to perform exact matches.
- * @see find for general find method.
+ * @see onNodeWithText to perform exact matches.
+ * @see onNode for general find method.
*/
+@Deprecated("Renamed to onNodeWithSubstring",
+ replaceWith = ReplaceWith("onNodeWithSubstring(text, ignoreCase, useUnmergedTree)"))
fun findBySubstring(
text: String,
ignoreCase: Boolean = false,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteraction = find(hasSubstring(text, ignoreCase), useUnmergedTree)
+): SemanticsNodeInteraction = onNodeWithSubstring(text, ignoreCase, useUnmergedTree)
/**
* Finds all components with the given text.
@@ -96,11 +256,13 @@
*
* @param useUnmergedTree Find within merged composables like Buttons.
*/
+@Deprecated("Renamed to onAllNodesWithText",
+ replaceWith = ReplaceWith("onAllNodesWithText(text, ignoreCase, useUnmergedTree)"))
fun findAllByText(
text: String,
ignoreCase: Boolean = false,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteractionCollection = findAll(hasText(text, ignoreCase), useUnmergedTree)
+): SemanticsNodeInteractionCollection = onAllNodesWithText(text, ignoreCase, useUnmergedTree)
/**
* Finds all components with the given label as AccessibilityLabel.
@@ -109,11 +271,13 @@
*
* @param useUnmergedTree Find within merged composables like Buttons.
*/
+@Deprecated("Renamed to onAllNodesWithLabel",
+ replaceWith = ReplaceWith("onAllNodesWithLabel(label, ignoreCase, useUnmergedTree)"))
fun findAllByLabel(
label: String,
ignoreCase: Boolean = false,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteractionCollection = findAll(hasLabel(label, ignoreCase), useUnmergedTree)
+): SemanticsNodeInteractionCollection = onAllNodesWithLabel(label, ignoreCase, useUnmergedTree)
/**
* Finds the root semantics node of the Compose tree. Useful for example for screenshot tests
@@ -123,8 +287,10 @@
*
* @param useUnmergedTree Find within merged composables like Buttons.
*/
+@Deprecated("Renamed to onRoot",
+ replaceWith = ReplaceWith("onRoot(useUnmergedTree)"))
fun findRoot(useUnmergedTree: Boolean = false): SemanticsNodeInteraction =
- find(isRoot(), useUnmergedTree)
+ onRoot(useUnmergedTree)
/**
* Finds a component that matches the given condition.
@@ -136,14 +302,14 @@
* For usage patterns and semantics concepts see [SemanticsNodeInteraction]
*
* @param useUnmergedTree Find within merged composables like Buttons.
- * @see findAll to work with multiple elements
+ * @see onAllNodes to work with multiple elements
*/
+@Deprecated("Renamed to onNode",
+ replaceWith = ReplaceWith("onNode(matcher, useUnmergedTree)"))
fun find(
matcher: SemanticsMatcher,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteraction {
- return SemanticsNodeInteraction(useUnmergedTree, SemanticsSelector(matcher))
-}
+): SemanticsNodeInteraction = onNode(matcher, useUnmergedTree)
/**
* Finds all components that match the given condition.
@@ -154,11 +320,11 @@
* For usage patterns and semantics concepts see [SemanticsNodeInteraction]
*
* @param useUnmergedTree Find within merged composables like Buttons.
- * @see find
+ * @see onNode
*/
+@Deprecated("Renamed to onAllNodes",
+ replaceWith = ReplaceWith("onAllNodes(matcher, useUnmergedTree)"))
fun findAll(
matcher: SemanticsMatcher,
useUnmergedTree: Boolean = false
-): SemanticsNodeInteractionCollection {
- return SemanticsNodeInteractionCollection(useUnmergedTree, SemanticsSelector(matcher))
-}
+): SemanticsNodeInteractionCollection = onAllNodes(matcher, useUnmergedTree)
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt b/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt
index 40f5775..560b917 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/GestureScope.kt
@@ -78,7 +78,7 @@
}
/**
- * Returns the size of the component we're interacting with
+ * Returns the size of the node we're interacting with
*/
val BaseGestureScope.size: IntSize
get() = semanticsNode.size
@@ -96,38 +96,38 @@
get() = size.height
/**
- * Returns the x-coordinate for the left edge of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the x-coordinate for the left edge of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
*/
@Suppress("unused")
inline val BaseGestureScope.left: Float
get() = 0f
/**
- * Returns the y-coordinate for the bottom of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the y-coordinate for the bottom of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
*/
@Suppress("unused")
inline val BaseGestureScope.top: Float
get() = 0f
/**
- * Returns the x-coordinate for the center of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the x-coordinate for the center of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
*/
inline val BaseGestureScope.centerX: Float
get() = width / 2f
/**
- * Returns the y-coordinate for the center of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the y-coordinate for the center of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
*/
inline val BaseGestureScope.centerY: Float
get() = height / 2f
/**
- * Returns the x-coordinate for the right edge of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the x-coordinate for the right edge of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
* Note that, unless `width == 0`, `right != width`. In particular, `right == width - 1f`, because
* pixels are 0-based. If `width == 0`, `right == 0` too.
*/
@@ -135,8 +135,8 @@
get() = width.let { if (it == 0) 0f else it - 1f }
/**
- * Returns the y-coordinate for the bottom of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the y-coordinate for the bottom of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
* Note that, unless `height == 0`, `bottom != height`. In particular, `bottom == height - 1f`,
* because pixels are 0-based. If `height == 0`, `bottom == 0` too.
*/
@@ -144,76 +144,76 @@
get() = height.let { if (it == 0) 0f else it - 1f }
/**
- * Returns the top left corner of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the top left corner of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node.
*/
@Suppress("unused")
val BaseGestureScope.topLeft: Offset
get() = Offset(left, top)
/**
- * Returns the center of the top edge of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the center of the top edge of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node.
*/
val BaseGestureScope.topCenter: Offset
get() = Offset(centerX, top)
/**
- * Returns the top right corner of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component. Note that
+ * Returns the top right corner of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node. Note that
* `topRight.x != width`, see [right].
*/
val BaseGestureScope.topRight: Offset
get() = Offset(right, top)
/**
- * Returns the center of the left edge of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the center of the left edge of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
*/
val BaseGestureScope.centerLeft: Offset
get() = Offset(left, centerY)
/**
- * Returns the center of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the center of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node.
*/
val BaseGestureScope.center: Offset
get() = Offset(centerX, centerY)
/**
- * Returns the center of the right edge of the component we're interacting with, in the
- * component's local coordinate system, where (0, 0) is the top left corner of the component.
+ * Returns the center of the right edge of the node we're interacting with, in the
+ * node's local coordinate system, where (0, 0) is the top left corner of the node.
* Note that `centerRight.x != width`, see [right].
*/
val BaseGestureScope.centerRight: Offset
get() = Offset(right, centerY)
/**
- * Returns the bottom left corner of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component. Note that
+ * Returns the bottom left corner of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node. Note that
* `bottomLeft.y != height`, see [bottom].
*/
val BaseGestureScope.bottomLeft: Offset
get() = Offset(left, bottom)
/**
- * Returns the center of the bottom edge of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component. Note that
+ * Returns the center of the bottom edge of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node. Note that
* `bottomCenter.y != height`, see [bottom].
*/
val BaseGestureScope.bottomCenter: Offset
get() = Offset(centerX, bottom)
/**
- * Returns the bottom right corner of the component we're interacting with, in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component. Note that
+ * Returns the bottom right corner of the node we're interacting with, in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node. Note that
* `bottomRight.x != width` and `bottomRight.y != height`, see [right] and [bottom].
*/
val BaseGestureScope.bottomRight: Offset
get() = Offset(right, bottom)
/**
- * Creates an [Offset] relative to the size of the component we're interacting with. [x] and [y]
+ * Creates an [Offset] relative to the size of the node we're interacting with. [x] and [y]
* are fractions of the [width] and [height]. Note that `percentOffset(1f, 1f) != bottomRight`,
* see [right] and [bottom].
*
@@ -230,7 +230,7 @@
}
/**
- * Returns the global bounds of the component we're interacting with
+ * Returns the global bounds of the node we're interacting with
*/
val BaseGestureScope.globalBounds: PxBounds
get() = semanticsNode.globalBounds
@@ -248,13 +248,13 @@
/**
* The receiver scope for injecting gestures on the [semanticsNode] identified by the
* corresponding [SemanticsNodeInteraction]. Gestures can be injected by calling methods defined
- * on [GestureScope], such as [sendSwipeUp]. The [SemanticsNodeInteraction] can be found by one
- * of the finder methods such as [findByTag].
+ * on [GestureScope], such as [swipeUp]. The [SemanticsNodeInteraction] can be found by one
+ * of the finder methods such as [onNodeWithTag].
*
* Example usage:
* ```
- * findByTag("myWidget")
- * .doGesture {
+ * onNodeWithTag("myWidget")
+ * .performGesture {
* sendSwipeUp()
* }
* ```
@@ -264,50 +264,50 @@
) : BaseGestureScope(semanticsNode)
/**
- * Performs a click gesture at the given [position] on the associated component, or in the center
- * if the [position] is omitted. The [position] is in the component's local coordinate system,
- * where (0, 0) is the top left corner of the component. The default [position] is the
- * center of the component.
+ * Performs a click gesture at the given [position] on the associated node, or in the center
+ * if the [position] is omitted. The [position] is in the node's local coordinate system,
+ * where (0, 0) is the top left corner of the node. The default [position] is the
+ * center of the node.
*
- * @param position The position where to click, in the component's local coordinate system. If
+ * @param position The position where to click, in the node's local coordinate system. If
* omitted, the center position will be used.
*/
-fun GestureScope.sendClick(position: Offset = center) {
+fun GestureScope.click(position: Offset = center) {
inputDispatcher.sendClick(localToGlobal(position))
}
/**
- * Performs a long click gesture at the given [position] on the associated component, or in the
+ * Performs a long click gesture at the given [position] on the associated node, or in the
* center if the [position] is omitted. By default, the [duration] of the press is
- * [LongPressTimeout] + 100 milliseconds. The [position] is in the component's local coordinate
- * system, where (0, 0) is the top left corner of the component.
+ * [LongPressTimeout] + 100 milliseconds. The [position] is in the node's local coordinate
+ * system, where (0, 0) is the top left corner of the node.
*
- * @param position The position of the long click, in the component's local coordinate system. If
+ * @param position The position of the long click, in the node's local coordinate system. If
* omitted, the center position will be used.
* @param duration The time between the down and the up event
*/
-fun GestureScope.sendLongClick(
+fun GestureScope.longClick(
position: Offset = center,
duration: Duration = LongPressTimeout + 100.milliseconds
) {
require(duration >= LongPressTimeout) {
"Long click must have a duration of at least ${LongPressTimeout.inMilliseconds()}ms"
}
- sendSwipe(position, position, duration)
+ swipe(position, position, duration)
}
/**
- * Performs a double click gesture at the given [position] on the associated component, or in the
+ * Performs a double click gesture at the given [position] on the associated node, or in the
* center if the [position] is omitted. By default, the [delay] between the first and the second
- * click is 145 milliseconds (empirically established). The [position] is in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component.
+ * click is 145 milliseconds (empirically established). The [position] is in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node.
*
- * @param position The position of the double click, in the component's local coordinate system.
+ * @param position The position of the double click, in the node's local coordinate system.
* If omitted, the center position will be used.
* @param delay The time between the up event of the first click and the down event of the second
* click
*/
-fun GestureScope.sendDoubleClick(
+fun GestureScope.doubleClick(
position: Offset = center,
delay: Duration = doubleClickDelay
) {
@@ -321,16 +321,16 @@
}
/**
- * Performs the swipe gesture on the associated component. The motion events are linearly
- * interpolated between [start] and [end]. The coordinates are in the component's local
- * coordinate system, where (0, 0) is the top left corner of the component. The default
+ * Performs the swipe gesture on the associated node. The motion events are linearly
+ * interpolated between [start] and [end]. The coordinates are in the node's local
+ * coordinate system, where (0, 0) is the top left corner of the node. The default
* duration is 200 milliseconds.
*
- * @param start The start position of the gesture, in the component's local coordinate system
- * @param end The end position of the gesture, in the component's local coordinate system
+ * @param start The start position of the gesture, in the node's local coordinate system
+ * @param end The end position of the gesture, in the node's local coordinate system
* @param duration The duration of the gesture
*/
-fun GestureScope.sendSwipe(
+fun GestureScope.swipe(
start: Offset,
end: Offset,
duration: Duration = 200.milliseconds
@@ -341,19 +341,19 @@
}
/**
- * Performs a pinch gesture on the associated component.
+ * Performs a pinch gesture on the associated node.
*
* For each pair of start and end [Offset]s, the motion events are linearly interpolated. The
- * coordinates are in the component's local coordinate system where (0, 0) is the top left
- * corner of the component. The default duration is 400 milliseconds.
+ * coordinates are in the node's local coordinate system where (0, 0) is the top left
+ * corner of the node. The default duration is 400 milliseconds.
*
- * @param start0 The start position of the first gesture in the component's local coordinate system
- * @param end0 The end position of the first gesture in the component's local coordinate system
- * @param start1 The start position of the second gesture in the component's local coordinate system
- * @param end1 The end position of the second gesture in the component's local coordinate system
+ * @param start0 The start position of the first gesture in the node's local coordinate system
+ * @param end0 The end position of the first gesture in the node's local coordinate system
+ * @param start1 The start position of the second gesture in the node's local coordinate system
+ * @param end1 The end position of the second gesture in the node's local coordinate system
* @param duration the duration of the gesture
*/
-fun GestureScope.sendPinch(
+fun GestureScope.pinch(
start0: Offset,
end0: Offset,
start1: Offset,
@@ -376,22 +376,22 @@
}
/**
- * Performs the swipe gesture on the associated component, such that the velocity when the
+ * Performs the swipe gesture on the associated node, such that the velocity when the
* gesture is finished is roughly equal to [endVelocity]. The MotionEvents are linearly
- * interpolated between [start] and [end]. The coordinates are in the component's
- * local coordinate system, where (0, 0) is the top left corner of the component. The
+ * interpolated between [start] and [end]. The coordinates are in the node's
+ * local coordinate system, where (0, 0) is the top left corner of the node. The
* default duration is 200 milliseconds.
*
* Note that due to imprecisions, no guarantees can be made on the precision of the actual
* velocity at the end of the gesture, but generally it is within 0.1% of the desired velocity.
*
- * @param start The start position of the gesture, in the component's local coordinate system
- * @param end The end position of the gesture, in the component's local coordinate system
+ * @param start The start position of the gesture, in the node's local coordinate system
+ * @param end The end position of the gesture, in the node's local coordinate system
* @param endVelocity The velocity of the gesture at the moment it ends. Must be positive.
* @param duration The duration of the gesture. Must be long enough that at least 3 input events
* are generated, which happens with a duration of 25ms or more.
*/
-fun GestureScope.sendSwipeWithVelocity(
+fun GestureScope.swipeWithVelocity(
start: Offset,
end: Offset,
@FloatRange(from = 0.0) endVelocity: Float,
@@ -436,55 +436,55 @@
}
/**
- * Performs a swipe up gesture on the associated component. The gesture starts slightly above the
- * bottom of the component and ends at the top.
+ * Performs a swipe up gesture on the associated node. The gesture starts slightly above the
+ * bottom of the node and ends at the top.
*/
-fun GestureScope.sendSwipeUp() {
+fun GestureScope.swipeUp() {
val x = center.x
val y0 = (size.height * (1 - edgeFuzzFactor)).roundToInt().toFloat()
val y1 = 0.0f
val start = Offset(x, y0)
val end = Offset(x, y1)
- sendSwipe(start, end, 200.milliseconds)
+ swipe(start, end, 200.milliseconds)
}
/**
- * Performs a swipe down gesture on the associated component. The gesture starts slightly below the
- * top of the component and ends at the bottom.
+ * Performs a swipe down gesture on the associated node. The gesture starts slightly below the
+ * top of the node and ends at the bottom.
*/
-fun GestureScope.sendSwipeDown() {
+fun GestureScope.swipeDown() {
val x = center.x
val y0 = (size.height * edgeFuzzFactor).roundToInt().toFloat()
val y1 = size.height.toFloat()
val start = Offset(x, y0)
val end = Offset(x, y1)
- sendSwipe(start, end, 200.milliseconds)
+ swipe(start, end, 200.milliseconds)
}
/**
- * Performs a swipe left gesture on the associated component. The gesture starts slightly left of
- * the right side of the component and ends at the left side.
+ * Performs a swipe left gesture on the associated node. The gesture starts slightly left of
+ * the right side of the node and ends at the left side.
*/
-fun GestureScope.sendSwipeLeft() {
+fun GestureScope.swipeLeft() {
val x0 = (size.width * (1 - edgeFuzzFactor)).toFloat()
val x1 = 0.0f
val y = center.y
val start = Offset(x0, y)
val end = Offset(x1, y)
- sendSwipe(start, end, 200.milliseconds)
+ swipe(start, end, 200.milliseconds)
}
/**
- * Performs a swipe right gesture on the associated component. The gesture starts slightly right of
- * the left side of the component and ends at the right side.
+ * Performs a swipe right gesture on the associated node. The gesture starts slightly right of
+ * the left side of the node and ends at the right side.
*/
-fun GestureScope.sendSwipeRight() {
+fun GestureScope.swipeRight() {
val x0 = (size.width * edgeFuzzFactor).roundToInt().toFloat()
val x1 = size.width.toFloat()
val y = center.y
val start = Offset(x0, y)
val end = Offset(x1, y)
- sendSwipe(start, end, 200.milliseconds)
+ swipe(start, end, 200.milliseconds)
}
/**
@@ -552,16 +552,16 @@
/**
* The receiver scope for injecting partial gestures on the [semanticsNode] identified by the
* corresponding [SemanticsNodeInteraction]. Gestures can be injected by calling methods defined
- * on [PartialGestureScope], such as [sendDown]. The [SemanticsNodeInteraction] can be found by
- * one of the finder methods such as [findByTag].
+ * on [PartialGestureScope], such as [down]. The [SemanticsNodeInteraction] can be found by
+ * one of the finder methods such as [onNodeWithTag].
*
* Example usage:
* ```
* val position = Offset(10.px, 10.px)
- * findByTag("myWidget")
- * .doPartialGesture { sendDown(position) }
+ * onNodeWithTag("myWidget")
+ * .performPartialGesture { sendDown(position) }
* .assertIsDisplayed()
- * .doPartialGesture { sendUp(position) }
+ * .performPartialGesture { sendUp(position) }
* ```
*/
class PartialGestureScope internal constructor(
@@ -570,20 +570,20 @@
/**
* Sends a down event for the pointer with the given [pointerId] at [position] on the associated
- * component. The [position] is in the component's local coordinate system, where (0, 0) is
- * the top left corner of the component.
+ * node. The [position] is in the node's local coordinate system, where (0, 0) is
+ * the top left corner of the node.
*
* If no pointers are down yet, this will start a new partial gesture. If a partial gesture is
* already in progress, this event is sent with at the same timestamp as the last event. If the
* given pointer is already down, an [IllegalArgumentException] will be thrown.
*
* This gesture is considered _partial_, because the entire gesture can be spread over several
- * invocations of [doPartialGesture]. An entire gesture starts with a [down][sendDown] event,
- * followed by several down, move or up events, and ends with an [up][sendUp] or a
- * [cancel][sendCancel] event. Movement can be expressed with [sendMoveTo] and [sendMoveBy] to
+ * invocations of [performPartialGesture]. An entire gesture starts with a [down][down] event,
+ * followed by several down, move or up events, and ends with an [up][up] or a
+ * [cancel][cancel] event. Movement can be expressed with [moveTo] and [moveBy] to
* move a single pointer at a time, or [movePointerTo] and [movePointerBy] to move multiple
* pointers at a time. The `movePointer[To|By]` methods do not send the move event directly, use
- * [sendMove] to send the move event. Some other methods can send a move event as well. All
+ * [move] to send the move event. Some other methods can send a move event as well. All
* events, regardless the method used, will always contain the current position of _all_ pointers.
*
* Down and up events are sent at the same time as the previous event, but will send an extra
@@ -592,7 +592,7 @@
* cancel event will contain the up to date position of all pointers. Move and cancel events will
* advance the event time by 10 milliseconds.
*
- * Because partial gestures don't have to be defined all in the same [doPartialGesture] block,
+ * Because partial gestures don't have to be defined all in the same [performPartialGesture] block,
* keep in mind that while the gesture is not complete, all code you execute in between
* blocks that progress the gesture, will be executed while imaginary fingers are actively
* touching the screen.
@@ -601,66 +601,66 @@
* event, if the test ends before it expects the finger to be lifted from the screen.
*
* @param pointerId The id of the pointer, can be any number not yet in use by another pointer
- * @param position The position of the down event, in the component's local coordinate system
+ * @param position The position of the down event, in the node's local coordinate system
*/
-fun PartialGestureScope.sendDown(pointerId: Int, position: Offset) {
+fun PartialGestureScope.down(pointerId: Int, position: Offset) {
val globalPosition = localToGlobal(position)
inputDispatcher.sendDown(pointerId, globalPosition)
}
/**
- * Sends a down event for the default pointer at [position] on the associated component. The
- * [position] is in the component's local coordinate system, where (0, 0) is the top left
- * corner of the component. The default pointer has `pointerId = 0`.
+ * Sends a down event for the default pointer at [position] on the associated node. The
+ * [position] is in the node's local coordinate system, where (0, 0) is the top left
+ * corner of the node. The default pointer has `pointerId = 0`.
*
* If no pointers are down yet, this will start a new partial gesture. If a partial gesture is
* already in progress, this event is sent with at the same timestamp as the last event. If the
* default pointer is already down, an [IllegalArgumentException] will be thrown.
*
- * @param position The position of the down event, in the component's local coordinate system
+ * @param position The position of the down event, in the node's local coordinate system
*/
-fun PartialGestureScope.sendDown(position: Offset) {
- sendDown(0, position)
+fun PartialGestureScope.down(position: Offset) {
+ down(0, position)
}
/**
- * Sends a move event on the associated component, with the position of the pointer with the
- * given [pointerId] updated to [position]. The [position] is in the component's local coordinate
- * system, where (0, 0) is the top left corner of the component.
+ * Sends a move event on the associated node, with the position of the pointer with the
+ * given [pointerId] updated to [position]. The [position] is in the node's local coordinate
+ * system, where (0, 0) is the top left corner of the node.
*
* If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
*
- * @param pointerId The id of the pointer to move, as supplied in [sendDown]
- * @param position The new position of the pointer, in the component's local coordinate system
+ * @param pointerId The id of the pointer to move, as supplied in [down]
+ * @param position The new position of the pointer, in the node's local coordinate system
*/
-fun PartialGestureScope.sendMoveTo(pointerId: Int, position: Offset) {
+fun PartialGestureScope.moveTo(pointerId: Int, position: Offset) {
movePointerTo(pointerId, position)
- sendMove()
+ move()
}
/**
- * Sends a move event on the associated component, with the position of the default pointer
- * updated to [position]. The [position] is in the component's local coordinate system, where
- * (0, 0) is the top left corner of the component. The default pointer has `pointerId = 0`.
+ * Sends a move event on the associated node, with the position of the default pointer
+ * updated to [position]. The [position] is in the node's local coordinate system, where
+ * (0, 0) is the top left corner of the node. The default pointer has `pointerId = 0`.
*
* If the default pointer is not yet down, an [IllegalArgumentException] will be thrown.
*
- * @param position The new position of the pointer, in the component's local coordinate system
+ * @param position The new position of the pointer, in the node's local coordinate system
*/
-fun PartialGestureScope.sendMoveTo(position: Offset) {
- sendMoveTo(0, position)
+fun PartialGestureScope.moveTo(position: Offset) {
+ moveTo(0, position)
}
/**
* Updates the position of the pointer with the given [pointerId] to the given [position], but
- * does not send a move event. The move event can be sent with [sendMove]. The [position] is in
- * the component's local coordinate system, where (0.px, 0.px) is the top left corner of the
- * component.
+ * does not send a move event. The move event can be sent with [move]. The [position] is in
+ * the node's local coordinate system, where (0.px, 0.px) is the top left corner of the
+ * node.
*
* If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
*
- * @param pointerId The id of the pointer to move, as supplied in [sendDown]
- * @param position The new position of the pointer, in the component's local coordinate system
+ * @param pointerId The id of the pointer to move, as supplied in [down]
+ * @param position The new position of the pointer, in the node's local coordinate system
*/
fun PartialGestureScope.movePointerTo(pointerId: Int, position: Offset) {
val globalPosition = localToGlobal(position)
@@ -668,23 +668,23 @@
}
/**
- * Sends a move event on the associated component, with the position of the pointer with the
+ * Sends a move event on the associated node, with the position of the pointer with the
* given [pointerId] moved by the given [delta].
*
* If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
*
- * @param pointerId The id of the pointer to move, as supplied in [sendDown]
+ * @param pointerId The id of the pointer to move, as supplied in [down]
* @param delta The position for this move event, relative to the last sent position of the
* pointer. For example, `delta = Offset(10.px, -10.px) will add 10.px to the pointer's last
* x-position, and subtract 10.px from the pointer's last y-position.
*/
-fun PartialGestureScope.sendMoveBy(pointerId: Int, delta: Offset) {
+fun PartialGestureScope.moveBy(pointerId: Int, delta: Offset) {
movePointerBy(pointerId, delta)
- sendMove()
+ move()
}
/**
- * Sends a move event on the associated component, with the position of the default pointer
+ * Sends a move event on the associated node, with the position of the default pointer
* moved by the given [delta]. The default pointer has `pointerId = 0`.
*
* If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
@@ -693,17 +693,17 @@
* pointer. For example, `delta = Offset(10.px, -10.px) will add 10.px to the pointer's last
* x-position, and subtract 10.px from the pointer's last y-position.
*/
-fun PartialGestureScope.sendMoveBy(delta: Offset) {
- sendMoveBy(0, delta)
+fun PartialGestureScope.moveBy(delta: Offset) {
+ moveBy(0, delta)
}
/**
* Moves the position of the pointer with the given [pointerId] by the given [delta], but does
- * not send a move event. The move event can be sent with [sendMove].
+ * not send a move event. The move event can be sent with [move].
*
* If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
*
- * @param pointerId The id of the pointer to move, as supplied in [sendDown]
+ * @param pointerId The id of the pointer to move, as supplied in [down]
* @param delta The position for this move event, relative to the last sent position of the
* pointer. For example, `delta = Offset(10.px, -10.px) will add 10.px to the pointer's last
* x-position, and subtract 10.px from the pointer's last y-position.
@@ -720,26 +720,313 @@
* batching movement of multiple pointers together, which can be done with [movePointerTo] and
* [movePointerBy].
*/
-fun PartialGestureScope.sendMove() {
+fun PartialGestureScope.move() {
inputDispatcher.sendMove()
}
/**
* Sends an up event for the pointer with the given [pointerId], or the default pointer if
+ * [pointerId] is omitted, on the associated node. If any pointers have been moved with
+ * [movePointerTo] or [movePointerBy] and no move event has been sent yet, a move event will be
+ * sent right before the up event.
+ *
+ * @param pointerId The id of the pointer to lift up, as supplied in [down]
+ */
+fun PartialGestureScope.up(pointerId: Int = 0) {
+ inputDispatcher.sendUp(pointerId)
+}
+
+/**
+ * Sends a cancel event to cancel the current partial gesture. The cancel event contains the
+ * current position of all active pointers.
+ */
+fun PartialGestureScope.cancel() {
+ inputDispatcher.sendCancel()
+}
+
+// DEPRECATED APIs SECTION
+
+/**
+ * Performs a click gesture at the given [position] on the associated component, or in the center
+ * if the [position] is omitted. The [position] is in the component's local coordinate system,
+ * where (0, 0) is the top left corner of the component. The default [position] is the
+ * center of the component.
+ *
+ * @param position The position where to click, in the component's local coordinate system. If
+ * omitted, the center position will be used.
+ */
+@Deprecated("Renamed to click",
+ replaceWith = ReplaceWith("click(position)"))
+fun GestureScope.sendClick(position: Offset = center) = click(position)
+
+/**
+ * Performs a long click gesture at the given [position] on the associated component, or in the
+ * center if the [position] is omitted. By default, the [duration] of the press is
+ * [LongPressTimeout] + 100 milliseconds. The [position] is in the component's local coordinate
+ * system, where (0, 0) is the top left corner of the component.
+ *
+ * @param position The position of the long click, in the component's local coordinate system. If
+ * omitted, the center position will be used.
+ * @param duration The time between the down and the up event
+ */
+@Deprecated("Renamed to longClick",
+ replaceWith = ReplaceWith("longClick(position, duration)"))
+fun GestureScope.sendLongClick(
+ position: Offset = center,
+ duration: Duration = LongPressTimeout + 100.milliseconds
+) = longClick(position, duration)
+
+/**
+ * Performs a double click gesture at the given [position] on the associated component, or in the
+ * center if the [position] is omitted. By default, the [delay] between the first and the second
+ * click is 145 milliseconds (empirically established). The [position] is in the component's
+ * local coordinate system, where (0, 0) is the top left corner of the component.
+ *
+ * @param position The position of the double click, in the component's local coordinate system.
+ * If omitted, the center position will be used.
+ * @param delay The time between the up event of the first click and the down event of the second
+ * click
+ */
+@Deprecated("Renamed to doubleClick",
+ replaceWith = ReplaceWith("doubleClick(position, delay)"))
+fun GestureScope.sendDoubleClick(
+ position: Offset = center,
+ delay: Duration = doubleClickDelay
+) = doubleClick(position, delay)
+
+/**
+ * Performs the swipe gesture on the associated component. The motion events are linearly
+ * interpolated between [start] and [end]. The coordinates are in the component's local
+ * coordinate system, where (0, 0) is the top left corner of the component. The default
+ * duration is 200 milliseconds.
+ *
+ * @param start The start position of the gesture, in the component's local coordinate system
+ * @param end The end position of the gesture, in the component's local coordinate system
+ * @param duration The duration of the gesture
+ */
+@Deprecated("Renamed to swipe",
+ replaceWith = ReplaceWith("swipe(start, end, duration)"))
+fun GestureScope.sendSwipe(
+ start: Offset,
+ end: Offset,
+ duration: Duration = 200.milliseconds
+) = swipe(start, end, duration)
+
+/**
+ * Performs a pinch gesture on the associated component.
+ *
+ * For each pair of start and end [Offset]s, the motion events are linearly interpolated. The
+ * coordinates are in the component's local coordinate system where (0, 0) is the top left
+ * corner of the component. The default duration is 400 milliseconds.
+ *
+ * @param start0 The start position of the first gesture in the component's local coordinate system
+ * @param end0 The end position of the first gesture in the component's local coordinate system
+ * @param start1 The start position of the second gesture in the component's local coordinate system
+ * @param end1 The end position of the second gesture in the component's local coordinate system
+ * @param duration the duration of the gesture
+ */
+@Deprecated("Renamed to pinch",
+ replaceWith = ReplaceWith("pinch(start0, end0, start1, end0, duration)"))
+fun GestureScope.sendPinch(
+ start0: Offset,
+ end0: Offset,
+ start1: Offset,
+ end1: Offset,
+ duration: Duration = 400.milliseconds
+) = pinch(start0, end0, start1, end1, duration)
+
+/**
+ * Performs the swipe gesture on the associated component, such that the velocity when the
+ * gesture is finished is roughly equal to [endVelocity]. The MotionEvents are linearly
+ * interpolated between [start] and [end]. The coordinates are in the component's
+ * local coordinate system, where (0, 0) is the top left corner of the component. The
+ * default duration is 200 milliseconds.
+ *
+ * Note that due to imprecisions, no guarantees can be made on the precision of the actual
+ * velocity at the end of the gesture, but generally it is within 0.1% of the desired velocity.
+ *
+ * @param start The start position of the gesture, in the component's local coordinate system
+ * @param end The end position of the gesture, in the component's local coordinate system
+ * @param endVelocity The velocity of the gesture at the moment it ends. Must be positive.
+ * @param duration The duration of the gesture. Must be long enough that at least 3 input events
+ * are generated, which happens with a duration of 25ms or more.
+ */
+@Deprecated("Renamed to swipeWithVelocity",
+ replaceWith = ReplaceWith("swipeWithVelocity(start, end, endVelocity, duration)"))
+fun GestureScope.sendSwipeWithVelocity(
+ start: Offset,
+ end: Offset,
+ @FloatRange(from = 0.0) endVelocity: Float,
+ duration: Duration = 200.milliseconds
+) = swipeWithVelocity(start, end, endVelocity, duration)
+
+/**
+ * Performs a swipe up gesture on the associated component. The gesture starts slightly above the
+ * bottom of the component and ends at the top.
+ */
+@Deprecated("Renamed to swipeUp",
+ replaceWith = ReplaceWith("swipeUp()"))
+fun GestureScope.sendSwipeUp() = swipeUp()
+
+/**
+ * Performs a swipe down gesture on the associated component. The gesture starts slightly below the
+ * top of the component and ends at the bottom.
+ */
+@Deprecated("Renamed to swipeDown",
+ replaceWith = ReplaceWith("swipeDown()"))
+fun GestureScope.sendSwipeDown() = swipeDown()
+
+/**
+ * Performs a swipe left gesture on the associated component. The gesture starts slightly left of
+ * the right side of the component and ends at the left side.
+ */
+@Deprecated("Renamed to swipeLeft",
+ replaceWith = ReplaceWith("swipeLeft()"))
+fun GestureScope.sendSwipeLeft() = swipeLeft()
+
+/**
+ * Performs a swipe right gesture on the associated component. The gesture starts slightly right of
+ * the left side of the component and ends at the right side.
+ */
+@Deprecated("Renamed to swipeRight",
+ replaceWith = ReplaceWith("swipeRight()"))
+fun GestureScope.sendSwipeRight() = swipeRight()
+
+/**
+ * Sends a down event for the pointer with the given [pointerId] at [position] on the associated
+ * component. The [position] is in the component's local coordinate system, where (0, 0) is
+ * the top left corner of the component.
+ *
+ * If no pointers are down yet, this will start a new partial gesture. If a partial gesture is
+ * already in progress, this event is sent with at the same timestamp as the last event. If the
+ * given pointer is already down, an [IllegalArgumentException] will be thrown.
+ *
+ * This gesture is considered _partial_, because the entire gesture can be spread over several
+ * invocations of [performPartialGesture]. An entire gesture starts with a [down][sendDown] event,
+ * followed by several down, move or up events, and ends with an [up][sendUp] or a
+ * [cancel][sendCancel] event. Movement can be expressed with [sendMoveTo] and [sendMoveBy] to
+ * move a single pointer at a time, or [movePointerTo] and [movePointerBy] to move multiple
+ * pointers at a time. The `movePointer[To|By]` methods do not send the move event directly, use
+ * [sendMove] to send the move event. Some other methods can send a move event as well. All
+ * events, regardless the method used, will always contain the current position of _all_ pointers.
+ *
+ * Down and up events are sent at the same time as the previous event, but will send an extra
+ * move event just before the down or up event if [movePointerTo] or [movePointerBy] has been
+ * called and no move event has been sent yet. This does not happen for cancel events, but the
+ * cancel event will contain the up to date position of all pointers. Move and cancel events will
+ * advance the event time by 10 milliseconds.
+ *
+ * Because partial gestures don't have to be defined all in the same [performPartialGesture] block,
+ * keep in mind that while the gesture is not complete, all code you execute in between
+ * blocks that progress the gesture, will be executed while imaginary fingers are actively
+ * touching the screen.
+ *
+ * In the context of testing, it is not necessary to complete a gesture with an up or cancel
+ * event, if the test ends before it expects the finger to be lifted from the screen.
+ *
+ * @param pointerId The id of the pointer, can be any number not yet in use by another pointer
+ * @param position The position of the down event, in the component's local coordinate system
+ */
+@Deprecated("Renamed to down",
+ replaceWith = ReplaceWith("down(pointerId, position)"))
+fun PartialGestureScope.sendDown(pointerId: Int, position: Offset) = down(pointerId, position)
+
+/**
+ * Sends a down event for the default pointer at [position] on the associated component. The
+ * [position] is in the component's local coordinate system, where (0, 0) is the top left
+ * corner of the component. The default pointer has `pointerId = 0`.
+ *
+ * If no pointers are down yet, this will start a new partial gesture. If a partial gesture is
+ * already in progress, this event is sent with at the same timestamp as the last event. If the
+ * default pointer is already down, an [IllegalArgumentException] will be thrown.
+ *
+ * @param position The position of the down event, in the component's local coordinate system
+ */
+@Deprecated("Renamed to down",
+ replaceWith = ReplaceWith("down(position)"))
+fun PartialGestureScope.sendDown(position: Offset) = down(position)
+
+/**
+ * Sends a move event on the associated component, with the position of the pointer with the
+ * given [pointerId] updated to [position]. The [position] is in the component's local coordinate
+ * system, where (0, 0) is the top left corner of the component.
+ *
+ * If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
+ *
+ * @param pointerId The id of the pointer to move, as supplied in [sendDown]
+ * @param position The new position of the pointer, in the component's local coordinate system
+ */
+@Deprecated("Renamed to moveTo",
+ replaceWith = ReplaceWith("moveTo(pointerId, position)"))
+fun PartialGestureScope.sendMoveTo(pointerId: Int, position: Offset) = moveTo(pointerId, position)
+
+/**
+ * Sends a move event on the associated component, with the position of the default pointer
+ * updated to [position]. The [position] is in the component's local coordinate system, where
+ * (0, 0) is the top left corner of the component. The default pointer has `pointerId = 0`.
+ *
+ * If the default pointer is not yet down, an [IllegalArgumentException] will be thrown.
+ *
+ * @param position The new position of the pointer, in the component's local coordinate system
+ */
+@Deprecated("Renamed to moveTo",
+ replaceWith = ReplaceWith("moveTo(position)"))
+fun PartialGestureScope.sendMoveTo(position: Offset) = moveTo(position)
+
+/**
+ * Sends a move event on the associated component, with the position of the pointer with the
+ * given [pointerId] moved by the given [delta].
+ *
+ * If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
+ *
+ * @param pointerId The id of the pointer to move, as supplied in [sendDown]
+ * @param delta The position for this move event, relative to the last sent position of the
+ * pointer. For example, `delta = Offset(10.px, -10.px) will add 10.px to the pointer's last
+ * x-position, and subtract 10.px from the pointer's last y-position.
+ */
+@Deprecated("Renamed to moveBy",
+ replaceWith = ReplaceWith("moveBy(pointerId, delta)"))
+fun PartialGestureScope.sendMoveBy(pointerId: Int, delta: Offset) = moveBy(pointerId, delta)
+
+/**
+ * Sends a move event on the associated component, with the position of the default pointer
+ * moved by the given [delta]. The default pointer has `pointerId = 0`.
+ *
+ * If the pointer is not yet down, an [IllegalArgumentException] will be thrown.
+ *
+ * @param delta The position for this move event, relative to the last sent position of the
+ * pointer. For example, `delta = Offset(10.px, -10.px) will add 10.px to the pointer's last
+ * x-position, and subtract 10.px from the pointer's last y-position.
+ */
+@Deprecated("Renamed to moveBy",
+ replaceWith = ReplaceWith("moveBy(delta)"))
+fun PartialGestureScope.sendMoveBy(delta: Offset) = moveBy(delta)
+
+/**
+ * Sends a move event without updating any of the pointer positions. This can be useful when
+ * batching movement of multiple pointers together, which can be done with [movePointerTo] and
+ * [movePointerBy].
+ */
+@Deprecated("Renamed to move",
+ replaceWith = ReplaceWith("move()"))
+fun PartialGestureScope.sendMove() = move()
+
+/**
+ * Sends an up event for the pointer with the given [pointerId], or the default pointer if
* [pointerId] is omitted, on the associated component. If any pointers have been moved with
* [movePointerTo] or [movePointerBy] and no move event has been sent yet, a move event will be
* sent right before the up event.
*
* @param pointerId The id of the pointer to lift up, as supplied in [sendDown]
*/
-fun PartialGestureScope.sendUp(pointerId: Int = 0) {
- inputDispatcher.sendUp(pointerId)
-}
+@Deprecated("Renamed to up",
+ replaceWith = ReplaceWith("up(pointerId)"))
+fun PartialGestureScope.sendUp(pointerId: Int = 0) = up(pointerId)
/**
* Sends a cancel event to cancel the current partial gesture. The cancel event contains the
* current position of all active pointers.
*/
-fun PartialGestureScope.sendCancel() {
- inputDispatcher.sendCancel()
-}
+@Deprecated("Renamed to cancel",
+ replaceWith = ReplaceWith("cancel()"))
+fun PartialGestureScope.sendCancel() = cancel()
\ No newline at end of file
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt b/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt
index e66e165..b19a2e4 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/InputDispatcher.kt
@@ -133,7 +133,7 @@
* Generates the downTime of the next gesture with the given [duration]. The gesture's
* [duration] is necessary to facilitate chaining of gestures: if another gesture is made
* after the next one, it will start exactly [duration] after the start of the next gesture.
- * Always use this method to determine the downTime of the [down event][sendDown] of a gesture.
+ * Always use this method to determine the downTime of the [down event][down] of a gesture.
*
* If the duration is unknown when calling this method, use a duration of zero and update
* with [moveNextDownTime] when the duration is known, or use [moveNextDownTime]
@@ -174,8 +174,8 @@
* same [InputDispatcher] instance as the one used to end the last gesture.
*
* Note: this does not affect the time of the next event for the _current_ partial gesture,
- * using [sendMove], [sendUp] and [sendCancel], but it will affect the time of the _next_
- * gesture (including partial gestures started with [sendDown]).
+ * using [move], [up] and [cancel], but it will affect the time of the _next_
+ * gesture (including partial gestures started with [down]).
*
* @param duration The duration of the delay. Must be positive
*/
@@ -353,18 +353,18 @@
* for that pointer. Pointer ids may be reused during the same gesture. This method blocks
* until the input event has been dispatched.
*
- * It is possible to mix partial gestures with full gestures (e.g. send a [click][sendClick]
+ * It is possible to mix partial gestures with full gestures (e.g. send a [click][click]
* during a partial gesture), as long as you make sure that the default pointer id (id=0) is
* free to be used by the full gesture.
*
* A full gesture starts with a down event at some position (with this method) that indicates
- * a finger has started touching the screen, followed by zero or more [down][sendDown],
- * [move][sendMove] and [up][sendUp] events that respectively indicate that another finger
+ * a finger has started touching the screen, followed by zero or more [down][down],
+ * [move][move] and [up][up] events that respectively indicate that another finger
* started touching the screen, a finger moved around or a finger was lifted up from the
- * screen. A gesture is finished when [up][sendUp] lifts the last remaining finger from the
- * screen, or when a single [cancel][sendCancel] event is sent.
+ * screen. A gesture is finished when [up][up] lifts the last remaining finger from the
+ * screen, or when a single [cancel][cancel] event is sent.
*
- * Partial gestures don't have to be defined all in the same [doPartialGesture] block, but
+ * Partial gestures don't have to be defined all in the same [performPartialGesture] block, but
* keep in mind that while the gesture is not complete, all code you execute in between
* blocks that progress the gesture, will be executed while imaginary fingers are actively
* touching the screen.
@@ -376,9 +376,9 @@
* @param position The coordinate of the down event
*
* @see movePointer
- * @see sendMove
- * @see sendUp
- * @see sendCancel
+ * @see move
+ * @see up
+ * @see cancel
*/
fun sendDown(pointerId: Int, position: Offset) {
var gesture = partialGesture
@@ -406,18 +406,18 @@
* Updates the position of the pointer with the given [pointerId] to the given [position],
* but does not send a move event. Use this to move multiple pointers simultaneously. To send
* the next move event, which will contain the current position of _all_ pointers (not just
- * the moved ones), call [sendMove] without arguments. If you move one or more pointers and
- * then call [sendDown] or [sendUp], without calling [sendMove] first, a move event will be
- * sent right before that down or up event. See [sendDown] for more information on how to make
+ * the moved ones), call [move] without arguments. If you move one or more pointers and
+ * then call [down] or [up], without calling [move] first, a move event will be
+ * sent right before that down or up event. See [down] for more information on how to make
* complete gestures from partial gestures.
*
- * @param pointerId The id of the pointer to move, as supplied in [sendDown]
+ * @param pointerId The id of the pointer to move, as supplied in [down]
* @param position The position to move the pointer to
*
- * @see sendDown
- * @see sendMove
- * @see sendUp
- * @see sendCancel
+ * @see down
+ * @see move
+ * @see up
+ * @see cancel
*/
fun movePointer(pointerId: Int, position: Offset) {
val gesture = partialGesture
@@ -438,7 +438,7 @@
* Sends a move event [delay] milliseconds after the previous injected event of this gesture,
* without moving any of the pointers. The default [delay] is [10][eventPeriod] milliseconds.
* Use this to commit all changes in pointer location made with [movePointer]. The sent event
- * will contain the current position of all pointers. See [sendDown] for more information on
+ * will contain the current position of all pointers. See [down] for more information on
* how to make complete gestures from partial gestures.
*
* @param delay The time in milliseconds between the previously injected event and the move
@@ -461,16 +461,16 @@
* Sends an up event for the given [pointerId] at the current position of that pointer,
* [delay] milliseconds after the previous injected event of this gesture. The default
* [delay] is 0 milliseconds. This method blocks until the input event has been dispatched.
- * See [sendDown] for more information on how to make complete gestures from partial gestures.
+ * See [down] for more information on how to make complete gestures from partial gestures.
*
- * @param pointerId The id of the pointer to lift up, as supplied in [sendDown]
+ * @param pointerId The id of the pointer to lift up, as supplied in [down]
* @param delay The time in milliseconds between the previously injected event and the move
* event. 0 milliseconds by default.
*
- * @see sendDown
+ * @see down
* @see movePointer
- * @see sendMove
- * @see sendCancel
+ * @see move
+ * @see cancel
*/
fun sendUp(pointerId: Int, delay: Long = 0) {
val gesture = partialGesture
@@ -502,16 +502,16 @@
/**
* Sends a cancel event [delay] milliseconds after the previous injected event of this
* gesture. The default [delay] is [10][eventPeriod] milliseconds. This method blocks until
- * the input event has been dispatched. See [sendDown] for more information on how to make
+ * the input event has been dispatched. See [down] for more information on how to make
* complete gestures from partial gestures.
*
* @param delay The time in milliseconds between the previously injected event and the cancel
* event. [10][eventPeriod] milliseconds by default.
*
- * @see sendDown
+ * @see down
* @see movePointer
- * @see sendMove
- * @see sendUp
+ * @see move
+ * @see up
*/
fun sendCancel(delay: Long = eventPeriod) {
val gesture = checkNotNull(partialGesture) {
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/KeyInputHelpers.kt b/ui/ui-test/src/main/java/androidx/ui/test/KeyInputHelpers.kt
index 44e0e61..c8b1401 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/KeyInputHelpers.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/KeyInputHelpers.kt
@@ -26,7 +26,7 @@
* @return true if the event was consumed. False otherwise.
*/
@OptIn(ExperimentalKeyInput::class)
-fun SemanticsNodeInteraction.doSendKeyEvent(keyEvent: KeyEvent2): Boolean {
+fun SemanticsNodeInteraction.performKeyPress(keyEvent: KeyEvent2): Boolean {
val semanticsNode = fetchSemanticsNode("Failed to send key Event (${keyEvent.key})")
@OptIn(ExperimentalLayoutNodeApi::class)
val owner = semanticsNode.componentNode.owner
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt b/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt
index 8df024c..146fbd4 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/Selectors.kt
@@ -31,7 +31,7 @@
* [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
* none or more than one element is found.
*/
-fun SemanticsNodeInteraction.parent(): SemanticsNodeInteraction {
+fun SemanticsNodeInteraction.onParent(): SemanticsNodeInteraction {
return SemanticsNodeInteraction(
useUnmergedTree,
selector.addSelectionFromSingleNode("parent") { listOfNotNull(it.parent) }
@@ -41,7 +41,7 @@
/**
* Returns children of this node.
*/
-fun SemanticsNodeInteraction.children(): SemanticsNodeInteractionCollection {
+fun SemanticsNodeInteraction.onChildren(): SemanticsNodeInteractionCollection {
return SemanticsNodeInteractionCollection(
useUnmergedTree,
selector.addSelectionFromSingleNode("children") { it.children }
@@ -57,7 +57,7 @@
* [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
* none or more than one element is found.
*/
-fun SemanticsNodeInteraction.child(): SemanticsNodeInteraction {
+fun SemanticsNodeInteraction.onChild(): SemanticsNodeInteraction {
return SemanticsNodeInteraction(
useUnmergedTree,
selector.addSelectionFromSingleNode("child") { it.children }
@@ -69,7 +69,7 @@
*
* This is just a shortcut for "children[index]".
*/
-fun SemanticsNodeInteraction.childAt(index: Int): SemanticsNodeInteraction = children()[index]
+fun SemanticsNodeInteraction.onChildAt(index: Int): SemanticsNodeInteraction = onChildren()[index]
/**
* Returns all siblings of this node.
@@ -83,7 +83,7 @@
* Returns B1, B3
* ```
*/
-fun SemanticsNodeInteraction.siblings(): SemanticsNodeInteractionCollection {
+fun SemanticsNodeInteraction.onSiblings(): SemanticsNodeInteractionCollection {
return SemanticsNodeInteractionCollection(
useUnmergedTree,
selector.addSelectionFromSingleNode("siblings") { it.siblings }
@@ -99,7 +99,7 @@
* [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
* none or more than one element is found.
*/
-fun SemanticsNodeInteraction.sibling(): SemanticsNodeInteraction {
+fun SemanticsNodeInteraction.onSibling(): SemanticsNodeInteraction {
return SemanticsNodeInteraction(
useUnmergedTree,
selector.addSelectionFromSingleNode("sibling") { it.siblings }
@@ -117,7 +117,7 @@
* Returns B, A
* ```
*/
-fun SemanticsNodeInteraction.ancestors(): SemanticsNodeInteractionCollection {
+fun SemanticsNodeInteraction.onAncestors(): SemanticsNodeInteractionCollection {
return SemanticsNodeInteractionCollection(
useUnmergedTree,
selector.addSelectionFromSingleNode("ancestors") { it.ancestors.toList() }
@@ -131,7 +131,7 @@
* [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
* no element is found.
*/
-fun SemanticsNodeInteractionCollection.first(): SemanticsNodeInteraction {
+fun SemanticsNodeInteractionCollection.onFirst(): SemanticsNodeInteraction {
return get(0)
}
@@ -142,7 +142,7 @@
* [SemanticsNodeInteraction.assertDoesNotExist] is used) and will throw [AssertionError] if
* no element is found.
*/
-fun SemanticsNodeInteractionCollection.last(): SemanticsNodeInteraction {
+fun SemanticsNodeInteractionCollection.onLast(): SemanticsNodeInteraction {
return SemanticsNodeInteraction(useUnmergedTree, selector.addLastNodeSelector())
}
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt
index b795657..b5e5289 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/SemanticsNodeInteraction.kt
@@ -21,15 +21,15 @@
/**
* Represents a semantics node and the path to fetch it from the semantics tree. One can interact
- * with this node by performing actions such as [doClick], assertions such as
- * [assertHasClickAction], or navigate to other nodes such as [children].
+ * with this node by performing actions such as [performClick], assertions such as
+ * [assertHasClickAction], or navigate to other nodes such as [onChildren].
*
- * This is usually obtained from methods like [findByTag], [find].
+ * This is usually obtained from methods like [onNodeWithTag], [onNode].
*
* Example usage:
* ```
- * findByTag("myCheckbox")
- * .doClick()
+ * onNodeWithTag("myCheckbox")
+ * .performClick()
* .assertIsOn()
* ````
*
@@ -47,7 +47,7 @@
* // Assert that MyIcon is at the expected position inside the IconButton.
* // Without useUnmergedTree, then the test would check the position of the IconButton (0, 0)
* // instead of the position of the Icon (30, 30).
- * findByTag("icon", useUnmergedTree = true)
+ * onNodeWithTag("icon", useUnmergedTree = true)
* .assertLeftPosition(30.dp)
* .assertTopPosition(30.dp)
* ````
@@ -165,11 +165,11 @@
* One can interact with these nodes by performing assertions such as [assertCountEquals], or
* navigate to other nodes such as [get].
*
- * This is usually obtained from methods like [findAll] or chains of [find].[children].
+ * This is usually obtained from methods like [onAllNodes] or chains of [onNode].[onChildren].
*
* Example usage:
* ```
- * findAll(isClickable())
+ * onAllNodes(isClickable())
* .assertCountEquals(2)
* ````
*/
diff --git a/ui/ui-test/src/main/java/androidx/ui/test/TextActions.kt b/ui/ui-test/src/main/java/androidx/ui/test/TextActions.kt
index ec3b9ab..f9c4c3b 100644
--- a/ui/ui-test/src/main/java/androidx/ui/test/TextActions.kt
+++ b/ui/ui-test/src/main/java/androidx/ui/test/TextActions.kt
@@ -32,9 +32,9 @@
* @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
* clicked on.
*/
-fun SemanticsNodeInteraction.doClearText(alreadyHasFocus: Boolean = false) {
+fun SemanticsNodeInteraction.performTextClearance(alreadyHasFocus: Boolean = false) {
if (!alreadyHasFocus) {
- doClick()
+ performClick()
}
// TODO: There should be some assertion on focus in the future.
@@ -48,9 +48,9 @@
* @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
* clicked on.
*/
-fun SemanticsNodeInteraction.doSendText(text: String, alreadyHasFocus: Boolean = false) {
+fun SemanticsNodeInteraction.performTextInput(text: String, alreadyHasFocus: Boolean = false) {
if (!alreadyHasFocus) {
- doClick()
+ performClick()
}
// TODO: There should be some assertion on focus in the future.
@@ -66,9 +66,12 @@
* @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
* clicked on.
*/
-fun SemanticsNodeInteraction.doReplaceText(text: String, alreadyHasFocus: Boolean = false) {
+fun SemanticsNodeInteraction.performTextReplacement(
+ text: String,
+ alreadyHasFocus: Boolean = false
+) {
if (!alreadyHasFocus) {
- doClick()
+ performClick()
}
// TODO: There should be some assertion on focus in the future.
@@ -88,12 +91,12 @@
* @throws IllegalStateException if tne node did not establish input connection (e.g. is not
* focused)
*/
-fun SemanticsNodeInteraction.doSendImeAction(alreadyHasFocus: Boolean = false) {
+fun SemanticsNodeInteraction.performImeAction(alreadyHasFocus: Boolean = false) {
if (!alreadyHasFocus) {
- doClick()
+ performClick()
}
- val errorOnFail = "Failed to send IME action."
+ val errorOnFail = "Failed to perform IME action."
val node = fetchSemanticsNode(errorOnFail)
assert(hasInputMethodsSupport()) { errorOnFail }
@@ -103,7 +106,7 @@
}
if (actionSpecified == ImeAction.Unspecified) {
throw AssertionError(buildGeneralErrorMessage(
- "Failed to send IME action as current node does not specify any.", selector, node))
+ "Failed to perform IME action as current node does not specify any.", selector, node))
}
@OptIn(ExperimentalLayoutNodeApi::class)
@@ -120,7 +123,7 @@
}
internal fun SemanticsNodeInteraction.sendTextInputCommand(command: List<EditOperation>) {
- val errorOnFail = "Failed to send text input."
+ val errorOnFail = "Failed to perform text input."
val node = fetchSemanticsNode(errorOnFail)
@OptIn(ExperimentalLayoutNodeApi::class)
val owner = node.componentNode.owner as AndroidOwner
@@ -141,4 +144,62 @@
return this.textInputService as TextInputServiceForTests?
?: throw IllegalStateException ("Text input service wrapper not set up! Did you use " +
"ComposeTestRule?")
-}
\ No newline at end of file
+}
+
+// DEPRECATED APIs SECTION
+
+/**
+ * Clears the text in this node in similar way to IME.
+ *
+ * Note performing this operation requires to get a focus.
+ *
+ * @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
+ * clicked on.
+ */
+@Deprecated("Renamed to performTextClearance",
+ replaceWith = ReplaceWith("performTextClearance(alreadyHasFocus)"))
+fun SemanticsNodeInteraction.doClearText(alreadyHasFocus: Boolean = false) =
+ performTextClearance(alreadyHasFocus)
+
+/**
+ * Sends the given text to this node in similar way to IME.
+ *
+ * @param text Text to send.
+ * @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
+ * clicked on.
+ */
+@Deprecated("Renamed to performTextInput",
+ replaceWith = ReplaceWith("performTextInput(text, alreadyHasFocus)"))
+fun SemanticsNodeInteraction.doSendText(text: String, alreadyHasFocus: Boolean = false) =
+ performTextInput(text, alreadyHasFocus)
+
+/**
+ * Replaces existing text with the given text in this node in similar way to IME.
+ *
+ * This does not reflect text selection. All the text gets cleared out and new inserted.
+ *
+ * @param text Text to send.
+ * @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
+ * clicked on.
+ */
+@Deprecated("Renamed to performTextReplacement",
+ replaceWith = ReplaceWith("performTextReplacement(text, alreadyHasFocus)"))
+fun SemanticsNodeInteraction.doReplaceText(text: String, alreadyHasFocus: Boolean = false) =
+ performTextReplacement(text, alreadyHasFocus)
+
+/**
+ * Sends to this node the IME action associated with it in similar way to IME.
+ *
+ * The node needs to define its IME action in semantics.
+ *
+ * @param alreadyHasFocus Whether the node already has a focus and thus does not need to be
+ * clicked on.
+ *
+ * @throws AssertionError if the node does not support input or does not define IME action.
+ * @throws IllegalStateException if tne node did not establish input connection (e.g. is not
+ * focused)
+ */
+@Deprecated("Renamed to performImeAction",
+ replaceWith = ReplaceWith("performImeAction(alreadyHasFocus)"))
+fun SemanticsNodeInteraction.doSendImeAction(alreadyHasFocus: Boolean = false) =
+ performImeAction(alreadyHasFocus)