diff --git a/app/src/androidTest/java/com/example/androidtestingsdgku/ShopAppTest.kt b/app/src/androidTest/java/com/example/androidtestingsdgku/ShopAppTest.kt index 3898c84..6371718 100644 --- a/app/src/androidTest/java/com/example/androidtestingsdgku/ShopAppTest.kt +++ b/app/src/androidTest/java/com/example/androidtestingsdgku/ShopAppTest.kt @@ -17,6 +17,18 @@ class ShopAppTest { @get:Rule val composeRule = createAndroidComposeRule() + @Test + fun shoppingCartShowsAllElements() { + composeRule.onNodeWithTag("shop_title").assertIsDisplayed() + composeRule.onNodeWithTag("cart_item_count", useUnmergedTree = true) + .assertTextEquals("Cart (0)") + + composeRule.onNodeWithTag("go_to_cart_button").performClick() + + composeRule.onNodeWithTag("cart_title").assertIsDisplayed() + composeRule.onNodeWithTag("empty_cart").assertIsDisplayed() + } + @Test fun shopStartsWithEmptyCart() { composeRule.onNodeWithTag("shop_title").assertIsDisplayed()