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

Update test reports to show all exceptions thrown in flutter #2362

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

karolinaoparczyk
Copy link
Collaborator

@karolinaoparczyk karolinaoparczyk commented Oct 8, 2024

Issue: Test reports don't contain useful info ("Multiple exceptions were thrown") #951

The first version (without calling previousOnError in our onError) didn't work with Patrol's finders. A test tapping on a widget that is not on a screen would hang without any logs instead of failing (maybe it has something to do with using async guards, not sure).
Right now (with calling previousOnError in our onError) we don't catch all errors in onError, but we do avoid the Multiple exceptions were thrown message.

Because we're intercepting the errors in onError, overriding reportTestException is not needed. Moreover, it would collect the Multiple exceptions were thrown message that can be created when we call previousOnError ourselves.
Probably the exceptions are thrown so close to each other, that us calling previousOnError makes them go through its code and we miss them.

Original onError saves the error in a variable and when another one comes, it saves Multiple exceptions were thrown message to this variable. There is a method takeException() that assigns null to this variable, but trying to do it in our onError before calling previousOnError doesn't work as expected (we do not take it out, so that the Multiple exceptions were thrown is not saved and dumped to console).

The conclusion is that we successfully show real exception descriptions instead of a general Multiple exceptions were thrown message. Although we get only two out of four known exceptions that should be caught in overflow_test.dart, this is still progress. The exceptions shown are the first ones to be thrown.

Copy link

docs-page bot commented Oct 8, 2024

To view this pull requests documentation preview, visit the following URL:

docs.page/leancodepl/patrol~2362

Documentation is deployed and generated using docs.page.

@github-actions github-actions bot added the package: patrol Related to the patrol package (native automation, test bundling) label Oct 8, 2024
@pdenert pdenert mentioned this pull request Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: patrol Related to the patrol package (native automation, test bundling)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant