Skip to content

Fix instrumentation tests execution #1105

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

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from
Open

Fix instrumentation tests execution #1105

wants to merge 10 commits into from

Conversation

wzieba
Copy link
Contributor

@wzieba wzieba commented Jun 12, 2025

Description

This PR fixes instrumented tests execution by updating model to the new default.

Previously used, Pixel 2, has been decommissioned.

To check all available devices, you can use gcloud firebase test android models list

Testing

Green CI means we're good to go.

Or, if you wish, you can run .buildkite/commands/connected-tests.sh locally (apply secrets before) and wait for the result.

After the latest changes, I've run tests 3 times on Firebase, and they passed each time.

@wzieba wzieba changed the title Fix ci Fix instrumentation tests execution Jun 13, 2025
Comment on lines +36 to +46
threadSleep(2000L) // Wait for the page to load
try {
urlField.perform(click())
urlField.perform(replaceText(url), ViewActions.closeSoftKeyboard())
} catch (e: RuntimeException) {
// If the URL field is not visible, it might be because the keyboard is open.
// Close the keyboard and try again.
urlField.perform(ViewActions.closeSoftKeyboard())
urlField.perform(replaceText(url), ViewActions.closeSoftKeyboard())
e.printStackTrace()
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the core change: a few of additional safety checks and delays to make UI tests not flaky on CI.

@@ -46,7 +45,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top|start"
android:hint="@string/source_hint"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The android:hint looked quite strange on the device when running tests: almost like a normal test. After removing them, tests started to pass. I'm not entirely sure why (as they were flaky and the failure was not reproducible locally), so here's my best guess.

I think that's fair as it only affects the test app.

@wzieba wzieba marked this pull request as ready for review June 13, 2025 12:25
@wzieba
Copy link
Contributor Author

wzieba commented Jun 17, 2025

eh, I don't know, the tests are still flaky on Firebase Test Lab - I can't reproduce the problem locally.

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.

1 participant