-
Notifications
You must be signed in to change notification settings - Fork 120
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
base: trunk
Are you sure you want to change the base?
Conversation
`pm` is less effective, according to logs
It's default test device on FTL
… assert focus, add a delay, close the keyboard
They seem to interfere with instrumented the tests execution
It'll happen whenever Espresso waited for too long for an input
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() | ||
} |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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.
eh, I don't know, the tests are still flaky on Firebase Test Lab - I can't reproduce the problem locally. |
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.