Skip to content

Conversation

@CareF
Copy link
Contributor

@CareF CareF commented Jul 23, 2020

Description

This is an equivalence for FlutterDriver.scrollUntilVisible, to find the widgets long below a scrollable, that's not built yet.

It's necessary for migrating tests like #62064

Related Issues

Fixes #61458

Tests

I added the following tests:

  • 'scrollUntilVisible: scrolls to make unbuilt widget visible' group in packages/flutter_test/test/controller_test.dart

Checklist

Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.

@CareF CareF requested a review from liyuqian July 23, 2020 04:20
@CareF CareF self-assigned this Jul 23, 2020
@fluttergithubbot fluttergithubbot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. labels Jul 23, 2020
@CareF CareF requested a review from dnfield July 23, 2020 04:22
@CareF CareF requested a review from dnfield July 23, 2020 12:57
@CareF
Copy link
Contributor Author

CareF commented Jul 25, 2020

@dnfield PTAL

@CareF
Copy link
Contributor Author

CareF commented Jul 25, 2020

I should have used TestAsyncUtils.guard. Added now.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fluttergithubbot fluttergithubbot merged commit 6d07b1b into flutter:master Jul 28, 2020
@CareF CareF deleted the scroll_until_visible branch July 28, 2020 18:27
@CareF
Copy link
Contributor Author

CareF commented Jul 29, 2020

I realize one problem with this design. In many widgets, Scrollable is not exposed but berried in the build function of other widgets, in which cases users are not able to point to a specific Scrollable by a key or other parameters.
I added in #62097

mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WidgetTester.ensureVisible cannot find widgets in a long list

4 participants