Skip to content

Commit 92f2f16

Browse files
authoredFeb 24, 2021
Merge pull request android#407 from android/dev_beta01
Compose beta01
2 parents f1e930d + 0f195d9 commit 92f2f16

File tree

100 files changed

+831
-735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+831
-735
lines changed
 

‎Crane/app/src/androidTest/java/androidx/compose/samples/crane/calendar/CalendarTest.kt

+10-6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import androidx.compose.samples.crane.data.DatesRepository
2727
import androidx.compose.samples.crane.ui.CraneTheme
2828
import androidx.compose.ui.test.SemanticsMatcher
2929
import androidx.compose.ui.test.assertContentDescriptionEquals
30+
import androidx.compose.ui.test.assertIsDisplayed
3031
import androidx.compose.ui.test.junit4.ComposeTestRule
3132
import androidx.compose.ui.test.junit4.createAndroidComposeRule
3233
import androidx.compose.ui.test.onNodeWithContentDescription
@@ -68,16 +69,17 @@ class CalendarTest {
6869
@Ignore("performScrollTo doesn't work with LazyLists: issuetracker.google.com/178483889")
6970
@Test
7071
fun scrollsToTheBottom() {
71-
composeTestRule.onNodeWithContentDescription("January 1").assertExists()
72+
composeTestRule.onNodeWithContentDescription("January 1").assertIsDisplayed()
7273
composeTestRule.onNodeWithContentDescription("December 31").performScrollTo().performClick()
7374
assert(datesRepository.datesSelected.toString() == "Dec 31")
7475
}
7576

7677
@Test
7778
fun onDaySelected() {
78-
composeTestRule.onNodeWithContentDescription("January 1").assertExists()
79-
composeTestRule.onNodeWithContentDescription("January 2").assertExists().performClick()
80-
composeTestRule.onNodeWithContentDescription("January 3").assertExists()
79+
composeTestRule.onNodeWithContentDescription("January 1").assertIsDisplayed()
80+
composeTestRule.onNodeWithContentDescription("January 2")
81+
.assertIsDisplayed().performClick()
82+
composeTestRule.onNodeWithContentDescription("January 3").assertIsDisplayed()
8183

8284
val datesNoSelected = composeTestRule.onDateNodes(NoSelected)
8385
datesNoSelected[0].assertContentDescriptionEquals("January 1")
@@ -88,13 +90,15 @@ class CalendarTest {
8890

8991
@Test
9092
fun twoDaysSelected() {
91-
composeTestRule.onNodeWithContentDescription("January 2").assertExists().performClick()
93+
composeTestRule.onNodeWithContentDescription("January 2")
94+
.assertIsDisplayed().performClick()
9295

9396
val datesNoSelectedOneClick = composeTestRule.onDateNodes(NoSelected)
9497
datesNoSelectedOneClick[0].assertContentDescriptionEquals("January 1")
9598
datesNoSelectedOneClick[1].assertContentDescriptionEquals("January 3")
9699

97-
composeTestRule.onNodeWithContentDescription("January 4").assertExists().performClick()
100+
composeTestRule.onNodeWithContentDescription("January 4")
101+
.assertIsDisplayed().performClick()
98102

99103
composeTestRule.onDateNode(FirstDay).assertContentDescriptionEquals("January 2")
100104
composeTestRule.onDateNode(Selected).assertContentDescriptionEquals("January 3")

‎Crane/app/src/androidTest/java/androidx/compose/samples/crane/home/HomeTest.kt

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@
1616

1717
package androidx.compose.samples.crane.home
1818

19+
import androidx.compose.ui.test.assertIsDisplayed
1920
import androidx.compose.ui.test.junit4.createAndroidComposeRule
2021
import androidx.compose.ui.test.onNodeWithText
2122
import androidx.compose.ui.test.performClick
2223
import dagger.hilt.android.testing.HiltAndroidRule
2324
import dagger.hilt.android.testing.HiltAndroidTest
2425
import org.junit.Before
26+
import org.junit.Ignore
2527
import org.junit.Rule
2628
import org.junit.Test
2729

@@ -41,14 +43,15 @@ class HomeTest {
4143
}
4244
}
4345

46+
@Ignore("Swipeable bug makes the app crash: https://issuetracker.google.com/180488877")
4447
@Test
4548
fun home_navigatesToAllScreens() {
46-
composeTestRule.onNodeWithText("Explore Flights by Destination").assertExists()
49+
composeTestRule.onNodeWithText("Explore Flights by Destination").assertIsDisplayed()
4750
composeTestRule.onNodeWithText("SLEEP").performClick()
48-
composeTestRule.onNodeWithText("Explore Properties by Destination").assertExists()
51+
composeTestRule.onNodeWithText("Explore Properties by Destination").assertIsDisplayed()
4952
composeTestRule.onNodeWithText("EAT").performClick()
50-
composeTestRule.onNodeWithText("Explore Restaurants by Destination").assertExists()
53+
composeTestRule.onNodeWithText("Explore Restaurants by Destination").assertIsDisplayed()
5154
composeTestRule.onNodeWithText("FLY").performClick()
52-
composeTestRule.onNodeWithText("Explore Flights by Destination").assertExists()
55+
composeTestRule.onNodeWithText("Explore Flights by Destination").assertIsDisplayed()
5356
}
5457
}

0 commit comments

Comments
 (0)
Please sign in to comment.