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

Improve error messages from Patrol methods #1044

Open
2 tasks
jBorkowska opened this issue Mar 6, 2023 · 6 comments
Open
2 tasks

Improve error messages from Patrol methods #1044

jBorkowska opened this issue Mar 6, 2023 · 6 comments
Labels
bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling)

Comments

@jBorkowska
Copy link
Collaborator

jBorkowska commented Mar 6, 2023

Here will be listed issues with Patrol error messages.

  • when scrollTo() hasn't found any widget that matches provided finder within a timeout:
    obraz

  • When first/last/at() is called on a finder that doesn't find any widgets:

    $(Button).first, findsNothing); // "StateError (Bad state: no element)" instead of passing expect()
@bartekpacia
Copy link
Contributor

bartekpacia commented Mar 6, 2023

I'd prefer to create separate issues for specific errors, and have a milestone called e.g. "Better logging". But feel free to comment anyway, we'll can do that afterward.

See also:

@jBorkowska
Copy link
Collaborator Author

Separate issues will be created later.

@bartekpacia bartekpacia added package: patrol Related to the patrol package (native automation, test bundling) bug Something isn't working labels Mar 6, 2023
@bartekpacia
Copy link
Contributor

This PR is about improving error messages from Custom Finders-related functionality only. I'm afraid there's not much we can do without sacrificing the safety checks we currently get by using functions from TestAsyncUtils class from flutter_test.

More context: There's an open Flutter issue about this problem, which is essentially a bug the core Dart package called stack_trace.

In Patrol, there are also issues/PRs that are about improving error messages from Native Automation-related functionality. See:

@bartekpacia
Copy link
Contributor

@jBorkowska
Copy link
Collaborator Author

jBorkowska commented Jun 1, 2023

First problem will be fixed with scrolling rework (see #1325), second one is not very important right now

@bartekpacia
Copy link
Contributor

bartekpacia commented Aug 16, 2023

Possibly related: dart-lang/sdk#46318

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

No branches or pull requests

2 participants