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

Support mouse interaction in tests utils #80857

Open
canastro opened this issue Apr 21, 2021 · 5 comments
Open

Support mouse interaction in tests utils #80857

canastro opened this issue Apr 21, 2021 · 5 comments
Labels
a: desktop Running on desktop a: mouse Issues related to using a mouse or mouse support a: tests "flutter test", flutter_test, or one of our tests c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team

Comments

@canastro
Copy link
Contributor

canastro commented Apr 21, 2021

Use case

As flutter's desktop app developer
I want to be able to mimic mouse interactions
So that I'm able to confidently test my application

Proposal

Support mouse interaction in tests utils.

Some public test utils do not expose the possibility of defining the PointerDeviceKind, eg.

We're missing a way to use mimic mouse wheel scroll, and the only scroll related method assumes that the device uses drag to scroll (see scrollUntilVisible).

@TahaTesser TahaTesser added in triage Presently being triaged by the triage team a: mouse Issues related to using a mouse or mouse support a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. passed first triage c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability and removed in triage Presently being triaged by the triage team labels Apr 21, 2021
@Hixie
Copy link
Contributor

Hixie commented Apr 21, 2021

It would make sense to add a pointer type argument to those methods, yeah.

@canastro
Copy link
Contributor Author

canastro commented Apr 21, 2021

I did a quick attempt at that, and I had to return the Pointer so that I could call .removePointer manually on my tests. Personally it felt like an unnecessary hurdle for the end-user (in this case a developer creating tests) and it would be nice to have done automatically by the framework.

@Hixie
Copy link
Contributor

Hixie commented Apr 21, 2021

Can you elaborate on that? Why do you need to call removePointer?

@Hixie
Copy link
Contributor

Hixie commented Apr 21, 2021

Another option would be to have a TestMouse object exposed as tester.mouse which has things like "moveTo", "click", "dragTo", "down", "up", etc.

@goderbauer goderbauer added a: desktop Running on desktop P3 Issues that are less important to the Flutter project labels May 4, 2022
@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-desktop Owned by Desktop platforms team triaged-desktop Triaged by Desktop platforms team labels Jul 7, 2023
@cbracken cbracken added team-framework Owned by Framework team and removed team-desktop Owned by Desktop platforms team labels Jun 7, 2024
@flutter-triage-bot
Copy link

The triaged-desktop label is irrelevant if there is no team-desktop label or fyi-desktop label.

@flutter-triage-bot flutter-triage-bot bot removed the triaged-desktop Triaged by Desktop platforms team label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: desktop Running on desktop a: mouse Issues related to using a mouse or mouse support a: tests "flutter test", flutter_test, or one of our tests c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project team-framework Owned by Framework team
Projects
None yet
Development

No branches or pull requests

5 participants