@@ -3,9 +3,11 @@ package com.darkrockstudios.app.securecamera
33import android.Manifest
44import android.os.Build
55import androidx.compose.ui.semantics.Role
6+ import androidx.compose.ui.test.ExperimentalTestApi
67import androidx.compose.ui.test.assertIsDisplayed
78import androidx.compose.ui.test.hasContentDescription
89import androidx.compose.ui.test.hasTestTag
10+ import androidx.compose.ui.test.hasText
911import androidx.compose.ui.test.junit4.ComposeContentTestRule
1012import androidx.compose.ui.test.junit4.createAndroidComposeRule
1113import androidx.compose.ui.test.onNodeWithText
@@ -35,6 +37,7 @@ class SmokeTestUiTest {
3537 @get:Rule
3638 val composeTestRule = createAndroidComposeRule<MainActivity >()
3739
40+ @OptIn(ExperimentalTestApi ::class )
3841 @Test
3942 fun smokeTest () {
4043 composeTestRule.apply {
@@ -53,18 +56,17 @@ class SmokeTestUiTest {
5356 setPinFields(" 3133734" , " 313373" )
5457 onNodeWithText(str(R .string.pin_creation_button)).performClick()
5558 waitForIdle()
56- onNodeWithText(str(R .string.pin_creation_error)).assertExists()
57- // waitUntilTextAppearsAtLeastOnce(str(R.string.pin_creation_error))
59+ waitUntilExactlyOneExists(hasText(str(R .string.pin_creation_error)))
5860
5961 setPinFields(" 123456" , " 123456" )
6062 onNodeWithText(str(R .string.pin_creation_button)).performClick()
6163 waitForIdle()
62- waitUntilTextAppearsAtLeastOnce( str(R .string.pin_creation_error_weak_pin))
64+ waitUntilExactlyOneExists(hasText( str(R .string.pin_creation_error_weak_pin) ))
6365
6466 setPinFields(" 313373" , " 313373" )
6567 onNodeWithText(str(R .string.pin_creation_button)).performClick()
6668 waitForIdle()
67- waitUntilTextAppearsAtLeastOnce( str(R .string.pin_creating_vault))
69+ waitUntilExactlyOneExists(hasText( str(R .string.pin_creating_vault) ))
6870
6971 waitForEitherTree(hasRole(Role .Button ) and hasContentDescription(str(R .string.camera_shutter_button_desc)))
7072 .performClick()
0 commit comments