Skip to content

Flutter synchronization support for Espresso/EarlGrey #37409

Closed

Description

@adazh

Use case

Espresso/EarlGrey takes care of synchronization within the testing framework, so that test authors do not have to explicitly wait/sleep in their tests. We are working on providing similar synchronization support for Flutter.

Espresso/EarlGrey currently use Driver extension API to talk into Flutter, and it currently exposes one wait API:

  • waitUntilNoTransientCallbacks, that wait for no transient callbacks on SchedulerBinding.

And we'd like to expose more waiting conditions on the extension APIs. Not an exhaustive list but some of them are:

  • Be able to wait for no pending frames scheduled in SchedulerBinding;
  • Be able to wait for no pending async platform messages.

This list will grow as we understand more on the synchronization conditions that we shall wait on.

Proposal

Thanks to @Hixie @tvolkert @goderbauer 's guidance & suggestions (some of them are commented in this PR), this is the final proposal we arrived at:

  1. A wait API that can support composable wait conditions; Users of this API will be able to specify the conditions that they care about.
  2. For support for platform messages, limit the scope to testing only by creating a ServicesBinding that is used under testing env and provides a BinaryMessenger that can be used to track platform channel/messages.

Activity

  1. self-assigned this
    on Aug 1, 2019
  2. adazh commented on Aug 1, 2019

    @adazh
    ContributorAuthor
  3. adazh commented on Aug 28, 2019

    @adazh
    ContributorAuthor

    All the PRs have been checked in :). Thanks everyone!

    I'll open up other issues if any follow-up is needed.

  4. github-actions commented on Aug 28, 2021

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: API breakBackwards-incompatible API changescustomer: espressoframeworkflutter/packages/flutter repository. See also f: labels.t: flutter driver"flutter driver", flutter_drive, or a driver test

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions