@@ -5,6 +5,7 @@ package com.softartdev.notedelight.ui.settings.detail
55import androidx.compose.ui.test.ExperimentalTestApi
66import androidx.compose.ui.test.assertIsDisplayed
77import androidx.compose.ui.test.assertTextContains
8+ import androidx.compose.ui.test.hasTestTag
89import androidx.compose.ui.test.onNodeWithTag
910import androidx.compose.ui.test.performClick
1011import androidx.compose.ui.test.v2.runComposeUiTest
@@ -28,15 +29,25 @@ abstract class ConsoleScreenTest {
2829 }
2930 // Open tips menu
3031 onNodeWithTag(CONSOLE_TIPS_BUTTON_TAG ).assertIsDisplayed().performClick()
31- waitForIdle()
32+ waitUntil(
33+ conditionDescription = " tip buttons exist" ,
34+ timeoutMillis = 10_000 ,
35+ ) {
36+ onAllNodes(hasTestTag(" ${CONSOLE_TIP_COPY_PREFIX } 0" )).fetchSemanticsNodes().isNotEmpty() &&
37+ onAllNodes(hasTestTag(" ${CONSOLE_TIP_AUTOFILL_PREFIX } 0" )).fetchSemanticsNodes().isNotEmpty()
38+ }
3239 // Verify copy and autofill buttons exist for first tip
3340 onNodeWithTag(" ${CONSOLE_TIP_COPY_PREFIX } 0" ).assertIsDisplayed()
3441 onNodeWithTag(" ${CONSOLE_TIP_AUTOFILL_PREFIX } 0" ).assertIsDisplayed()
3542 // Tap autofill on first tip (PRAGMA cipher_version;)
3643 onNodeWithTag(" ${CONSOLE_TIP_AUTOFILL_PREFIX } 0" ).performClick()
37- waitForIdle()
44+ waitUntil(
45+ conditionDescription = " autofill action was dispatched" ,
46+ timeoutMillis = 10_000 ,
47+ ) {
48+ actions.isNotEmpty()
49+ }
3850 // Verify autofill action was dispatched
39- assertTrue(actions.isNotEmpty())
4051 val autofillAction = actions.last()
4152 assertTrue(autofillAction is ConsoleAction .UpdateInput )
4253 assertEquals(" PRAGMA cipher_version;" , autofillAction.text)
@@ -48,7 +59,12 @@ abstract class ConsoleScreenTest {
4859 }
4960 // Open tips menu
5061 onNodeWithTag(CONSOLE_TIPS_BUTTON_TAG ).assertIsDisplayed().performClick()
51- waitForIdle()
62+ waitUntil(
63+ conditionDescription = " tip copy button exists" ,
64+ timeoutMillis = 10_000 ,
65+ ) {
66+ onAllNodes(hasTestTag(" ${CONSOLE_TIP_COPY_PREFIX } 1" )).fetchSemanticsNodes().isNotEmpty()
67+ }
5268 // Tap copy on second tip (SELECT sqlite3mc_version();)
5369 onNodeWithTag(" ${CONSOLE_TIP_COPY_PREFIX } 1" ).assertIsDisplayed().performClick()
5470 waitForIdle()
0 commit comments