From fd349933c537ec7a4a0334406dfd7127186a60e5 Mon Sep 17 00:00:00 2001 From: charlie mangano Date: Mon, 28 Oct 2024 13:33:58 +0100 Subject: [PATCH] test: check if TopAppBar and BottomNavigationBar are properly displayed Added checks for the presence of the TopAppBar and BottomNavigationBar, as well as a check to see that the goBack button is not present. --- .../com/android/periodpals/ui/alert/AlertScreenTest.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/androidTest/java/com/android/periodpals/ui/alert/AlertScreenTest.kt b/app/src/androidTest/java/com/android/periodpals/ui/alert/AlertScreenTest.kt index afab7b331..42d560f95 100644 --- a/app/src/androidTest/java/com/android/periodpals/ui/alert/AlertScreenTest.kt +++ b/app/src/androidTest/java/com/android/periodpals/ui/alert/AlertScreenTest.kt @@ -1,6 +1,7 @@ package com.android.periodpals.ui.alert import androidx.compose.ui.test.assertIsDisplayed +import androidx.compose.ui.test.assertIsNotDisplayed import androidx.compose.ui.test.assertTextEquals import androidx.compose.ui.test.junit4.createComposeRule import androidx.compose.ui.test.onNodeWithTag @@ -45,10 +46,13 @@ class AlertScreenTest { composeTestRule.onNodeWithTag("alertUrgency").assertIsDisplayed() composeTestRule.onNodeWithTag("alertLocation").assertIsDisplayed() composeTestRule.onNodeWithTag("alertMessage").assertIsDisplayed() + composeTestRule.onNodeWithTag("bottomNavigationMenu").assertIsDisplayed() + composeTestRule.onNodeWithTag("topBar").assertIsDisplayed() + composeTestRule.onNodeWithTag("goBackButton").assertIsNotDisplayed() composeTestRule - .onNodeWithTag("alertSubmit") - .assertIsDisplayed() - .assertTextEquals("Ask for Help") + .onNodeWithTag("alertSubmit") + .assertIsDisplayed() + .assertTextEquals("Ask for Help") } @Test