Skip to content

Commit

Permalink
test: check if TopAppBar and BottomNavigationBar are properly displayed
Browse files Browse the repository at this point in the history
Added checks for the presence of the TopAppBar and BottomNavigationBar, as well as a check to see that the goBack button is not present.
  • Loading branch information
charliemangano committed Oct 28, 2024
1 parent 296a867 commit fd34993
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fd34993

Please sign in to comment.