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

Fix tests #6263

Merged
merged 4 commits into from
Jul 17, 2024
Merged

Fix tests #6263

merged 4 commits into from
Jul 17, 2024

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Jul 11, 2024

Why is this the best possible solution? Were any other approaches considered?

I've run the tests ~5 times on CIrcleCI and everything seems to work well. The solution with waiting 250ms https://github.com/getodk/collect/pull/6263/files#diff-d01d0d1c510ce76157b059be58bc430ae9005f767acf8a6e7aadbc124a5ca0f3R827 is not what we like but nothing else worked. It looks like espresso needs some time to finish expanding layers. The same is true with changing selection. Those tests failed locally like twice for 100 runs so very rarely. I'm not sure if it was caused by non-responsive UI or maybe it also needs some time between changing selection and checking the state but tryAgainOnFaile fixed the problem,

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

It doesn't require testing.

Do we need any specific form for testing your changes? If so, please attach one.

No.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 marked this pull request as ready for review July 12, 2024 08:40

private fun toggleLayer(position: Int) {
onView(withRecyclerView(R.id.layers).atPositionOnView(position, R.id.arrow)).perform(click())
WaitFor.wait250ms()
Copy link
Member

Choose a reason for hiding this comment

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

Could we not wait for something here (WaitFor.waitFor for example) instead of just waiting a fixed amount of time? That doesn't give us any guarantee that we've waited enough.

Also, did you try things like using the InstantTaskExecutor or maybe even checking if animations are somehow still enabled?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could we not wait for something here (WaitFor.waitFor for example) instead of just waiting a fixed amount of time? That doesn't give us any guarantee that we've waited enough.

Yeah, we can use it.

Also, did you try things like using the InstantTaskExecutor or maybe even checking if animations are somehow still enabled?

I did, but nothing worked.

@seadowg seadowg merged commit accff9e into getodk:master Jul 17, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants