Skip to content

Commit 33acd0e

Browse files
committed
test: Stabilize SettingPasswordTestCase
- Add `waitUntilNotExist` checks after confirming password dialogs to ensure they are closed before proceeding. - Remove an unnecessary `waitUntilDisplayed` call for the "Set password" button. - Update a log message for clarity.
1 parent d92963c commit 33acd0e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ui/test/src/commonMain/kotlin/com/softartdev/notedelight/ui/cases/SettingPasswordTestCase.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import co.touchlab.kermit.Logger
1414
import com.softartdev.notedelight.retryUntilDisplayed
1515
import com.softartdev.notedelight.ui.BaseTestCase
1616
import com.softartdev.notedelight.ui.dialog.security.CHANGE_PASSWORD_DIALOG_TAG
17+
import com.softartdev.notedelight.ui.dialog.security.CONFIRM_PASSWORD_DIALOG_TAG
18+
import com.softartdev.notedelight.ui.dialog.security.ENTER_PASSWORD_DIALOG_TAG
1719
import com.softartdev.notedelight.waitAssert
1820
import com.softartdev.notedelight.waitUntilDisplayed
1921
import com.softartdev.notedelight.waitUntilNotExist
@@ -82,10 +84,10 @@ class SettingPasswordTestCase(
8284

8385
confirmRepeatPasswordSNI.performTextReplacement(text = "1")
8486
confirmDialogButtonSNI.performClick()
87+
composeUiTest.waitUntilNotExist(tag = CONFIRM_PASSWORD_DIALOG_TAG)
8588
}
86-
logger.i { "SettingsTestScreen: Encryption switch is ON, proceeding to change password" }
89+
logger.i { "SettingsTestScreen: proceeding to change password" }
8790
composeUiTest.waitAssert("encryption switch is ON", encryptionSwitchSNI::assertIsOn)
88-
composeUiTest.waitUntilDisplayed("setPassword", blockSNI = ::setPasswordSNI)
8991
setPasswordSNI.performClick()
9092

9193
changePasswordDialog {
@@ -159,6 +161,7 @@ class SettingPasswordTestCase(
159161
}
160162
enterPasswordSNI.performTextReplacement(text = "2")
161163
confirmDialogButtonSNI.performClick()
164+
composeUiTest.waitUntilNotExist(tag = ENTER_PASSWORD_DIALOG_TAG)
162165
}
163166
logger.i { "SettingsTestScreen: Encryption disabled successfully" }
164167
composeUiTest.waitAssert("encryption switch is OFF", encryptionSwitchSNI::assertIsOff)

0 commit comments

Comments
 (0)