Skip to content

A solution to record gestures and using the record for tests#60741

Closed
CareF wants to merge 15 commits intoflutter:masterfrom
CareF:record_gesture
Closed

A solution to record gestures and using the record for tests#60741
CareF wants to merge 15 commits intoflutter:masterfrom
CareF:record_gesture

Conversation

@CareF
Copy link
Contributor

@CareF CareF commented Jul 2, 2020

Description

For the test purposes sometimes we want the input to be as close as possible to real world input, e.g. for making a test case for #19222 . To achieve this we want a way to record the input events and use the record to make test cases.

Related Issues

Closes #60650, closes #60649

Tests

I added the following tests:

TBD

A use case can be seen in https://github.com/CareF/scroll_test :

flutter drive -t test_driver/scroll_perf.dart --driver=test_driver/waiting.dart -d [device name] --trace-startup
# generate a record for physical input
cp build/scrollingRecord.dart lib/
flutter drive -t test/using_record.dart --driver test_driver/scrolling_test_e2e_test.dart -d pixel --trace-startup 
# use the generated record

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 self-assigned this Jul 2, 2020
@fluttergithubbot fluttergithubbot added the a: tests "flutter test", flutter_test, or one of our tests label Jul 2, 2020
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 2, 2020
@CareF CareF marked this pull request as draft July 2, 2020 04:17
Copy link
Contributor Author

@CareF CareF Jul 2, 2020

Choose a reason for hiding this comment

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

This assert doesn't take into consideration multiple input events at the same time. This often happen for PointerAddedEvent and PointerDownEvent

@CareF
Copy link
Contributor Author

CareF commented Jul 2, 2020

This PR is serving as an overview of motivation for multiple smaller PRs.

@CareF CareF mentioned this pull request Jul 2, 2020
9 tasks
@Piinks Piinks added f: gestures flutter/packages/flutter/gestures repository. a: animation Animation APIs labels Jul 6, 2020
@CareF
Copy link
Contributor Author

CareF commented Jul 8, 2020

Close for now because it may be able to be implemented outside the framework.

@CareF CareF closed this Jul 8, 2020
@CareF CareF deleted the record_gesture branch August 10, 2020 14:46
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using array of input events in TestWidgetsFlutterBinding as inputs An input event recorder

4 participants