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

Add example file picker screen and test #514

Closed
wants to merge 4 commits into from
Closed

Conversation

bartekpacia
Copy link
Contributor

@bartekpacia bartekpacia commented Oct 25, 2022

For @fylyppo with 💙

This test assumes that there's a file named download.jpg in the Downloads directory.

Screen.Recording.2022-10-25.at.4.34.07.PM.mov

@github-actions github-actions bot added the package: patrol Related to the patrol package (native automation, test bundling) label Oct 25, 2022
expect($(#image_0), findsNothing);

await $.native.tap(Selector(text: 'download.jpeg'));
await $.pumpAndSettle();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why 2 pumpAndSettle()s?

Well, this is strange.

1 pumpAndSettle() makes the test pass, but the image is not visible to my human eyes. Adding the second pumpAndSettle() makes the image visible.

@bartekpacia
Copy link
Contributor Author

I wonder how tests that depend on a file being present in the device's Downloads directory should signal this dependency. Any ideas? @jakubfijalkowski @pietraniktx @jBorkowska

@jBorkowska
Copy link
Collaborator

I think it is developer's responsibility to have this in mind. There is nothing we can do.

@pietraniktx
Copy link

I'm not sure about the "signaling" part of the question but I understand the problem is - "device needs to have an image in downloads folder, if not, the test will fail", right? So why can't we download the file before the test or put it there some other way programmatically?

@jBorkowska
Copy link
Collaborator

"We" the framework or "we" the testers? :D

@pietraniktx
Copy link

:D I belive in Bartek. And it would be nice for Patrol users to have the recipe for such scenario as it looks like quite common problem and preparing test data inside the test seems like a good practice. Cypress, for example, has a ton of recipes to help testers with cases like this, check out this one about seeding database with node

@bartekpacia
Copy link
Contributor Author

Closing so it doesn't clutter opened PRs.

@bartekpacia bartekpacia deleted the add_file_picker branch November 11, 2022 22:05
@neiljaywarner

This comment was marked as off-topic.

@bartekpacia

This comment was marked as off-topic.

@neiljaywarner

This comment was marked as off-topic.

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.

4 participants