Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for wait operation #31

Closed
Vacxe opened this issue Jun 26, 2022 · 1 comment
Closed

Add support for wait operation #31

Vacxe opened this issue Jun 26, 2022 · 1 comment
Assignees

Comments

@Vacxe
Copy link
Member

Vacxe commented Jun 26, 2022

ComposeTestRule can provide functionality for awaiting views what can be useful for many test cases. However code below don't looks great to me.

fun BaseNode<*>.waitFor(composeTestRule: ComposeTestRule, timeoutMillis: Long = 1_000) {
    composeTestRule.waitUntil(timeoutMillis) {
        try {
            this.delegate.interaction.semanticsNodeInteraction.assertExists()
            true
        } catch (e: AssertionError) {
            false
        }
    }
}

Want to find a way how to do the same way but without composeTestRule reinjection to the function

At the end wanna have something like

ComposeScreen.onComposeScreen<MyScreen>(composeTestRule) {
  waitFor()
      heading {
        waitFor()
        hasText(it)
      }
}
@matzuk
Copy link
Contributor

matzuk commented Jul 20, 2022

As we have discussed earlier, there is the same functionality in Kaspresso. Do we need to duplicate it here?

@Vacxe Vacxe closed this as completed Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants