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

Use flutter test instead of flutter drive #421

Closed
mateuszwojtczak opened this issue Oct 7, 2022 · 6 comments
Closed

Use flutter test instead of flutter drive #421

mateuszwojtczak opened this issue Oct 7, 2022 · 6 comments
Assignees
Labels
blocked Blocked by external factors package: patrol_cli Related to the patrol_cli package

Comments

@mateuszwojtczak
Copy link
Contributor

No description provided.

@bartekpacia
Copy link
Contributor

bartekpacia commented Oct 7, 2022

flutter test currently doesn't allow for using custom bindings. See flutter/flutter#113097.

We have our own custom binding – PatrolBinding. The only things it does is setting the source of every pointer event (tap, slide, etc) to test instead of device.

It lets native automators tap on our Flutter app (the most common use case for this is a WebView).

Without our custom bindings, when we $.native.tap() on some widget, no tap is performed, instead we only get the following output in the console:

Some possible finders for the widgets at Offset(195.0, 779.0):
  find.text('Open webview screen')
  find.widgetWithText(Align, 'Open webview screen')
  find.widgetWithText(Padding, 'Open webview screen')
  find.widgetWithText(GestureDetector, 'Open webview screen')
  find.widgetWithText(MouseRegion, 'Open webview screen')
  find.widgetWithText(InkWell, 'Open webview screen')
  find.byType(SliverList)
  find.byType(SliverPadding)
  find.byType(Viewport)
  find.byType(Scrollable)
  find.byKey(const Key('listViewKey'))
  find.byType(NotificationListener<ScrollNotification>)
  find.byKey(const Key('scaffold'))
  find.byElementType(InheritedModelElement<Object>)

@bartekpacia bartekpacia added blocked Blocked by external factors package: patrol_cli Related to the patrol_cli package labels Oct 7, 2022
@bartekpacia
Copy link
Contributor

Replacing flutter drive with flutter test should also fix #425 (source).

@bartekpacia
Copy link
Contributor

bartekpacia commented Oct 7, 2022

We won't need PatrolBinding at all when flutter/flutter#108430 lands on the stable channel. It's currently on beta.

See also:

@bartekpacia
Copy link
Contributor

bartekpacia commented Nov 14, 2022

Homemade dependency graph

Some nodes are clickable

graph TD
  flutter_test[use `flutter test` - it gives us JUnit #495] --> a[stop using custom binding]
  click flutter_test "https://www.github.com/leancodepl/patrol/pull/495"
  a[we need custom binding because #107934] --> b[but it can be done with default binding in Flutter 3.5]
  click a "http://www.github.com/flutter/flutter/issues/107934"
  b --> c[remove custom binding]
  flutter_test --> useappbinary[once we migrate to it, we lose flake detection feature #114541]
  click useappbinary "http://www.github.com/flutter/flutter/issues/114541"

  host_features[screenshots, scripts] --> host_server[vmservice running on host #593]
  click host_server "https://www.github.com/leancodepl/patrol/pull/593"
  host_server --> custom_binding[requires custom binding] --> flutter_test_binding[`flutter test` doesn't support it #113097]
  click flutter_test_binding "http://www.github.com/flutter/flutter/issues/113097"
  host_server --> driver_script[needs driver script] --> flutter_test_driver[`flutter test` doesn't support it #115289]
  click flutter_test_driver "http://www.github.com/flutter/flutter/issues/115289"
  style custom_binding fill:#FF0000
  style c fill:#FF0000

  finder_apis[Improve Finder APIs]
  click finder_apis "https://github.com/flutter/flutter/issues/115874"

  single_test_binary[Single binary for all tests]
  click single_test_binary "https://github.com/flutter/flutter/issues/115751"

Loading

Flutter issue, but listed:

@bartekpacia
Copy link
Contributor

This is superseded by #661.

@bartekpacia bartekpacia closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2022
@bartekpacia bartekpacia unpinned this issue Dec 20, 2022
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocked Blocked by external factors package: patrol_cli Related to the patrol_cli package
Projects
None yet
Development

No branches or pull requests

2 participants