Commit 7e17cf35 authored by Ioana Pandele's avatar Ioana Pandele Committed by Commit Bot

[Android] Unflake automatic password generation integration tests

This CL disables waiting for server predictions in tests and makes
sure to wait for the text field to be filled before comparing the
generated password to the text in the field.

A previous attempt at unflaking the entire test suite was made at
crrev.com/c/1995273, but the fix uncovered other flakes for the
manual generation tests. This is why this CL is only scoped to the
automatic generation cases, which are simpler.

Bug: 1064960
Change-Id: I3c4c60cebbeef0ce73f4e3dddbd4747b89e5f61f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2132248Reviewed-by: default avatarFriedrich [CET] <fhorschig@chromium.org>
Commit-Queue: Ioana Pandele <ioanap@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755351}
parent b87c3ab1
......@@ -66,6 +66,7 @@ public class PasswordGenerationIntegrationTest {
@Before
public void setUp() throws InterruptedException {
mSyncTestRule.setUpTestAccountAndSignIn();
ManualFillingTestHelper.disableServerPredictions();
mHelper.loadTestPage(FORM_URL, false);
}
......@@ -109,7 +110,6 @@ public class PasswordGenerationIntegrationTest {
@Test
@IntegrationTest
@DisabledTest(message = "crbug.com/1010344")
public void testAutomaticGenerationUsePassword() throws InterruptedException, TimeoutException {
waitForGenerationLabel();
focusField(PASSWORD_NODE_ID);
......@@ -123,6 +123,8 @@ public class PasswordGenerationIntegrationTest {
waitForGenerationDialog();
String generatedPassword = getTextFromTextView(R.id.generated_password);
onView(withId(R.id.positive_button)).perform(click());
CriteriaHelper.pollInstrumentationThread(
() -> !mHelper.getFieldText(PASSWORD_NODE_ID).isEmpty());
assertPasswordText(PASSWORD_NODE_ID, generatedPassword);
clickNode(SUBMIT_NODE_ID);
mHelper.waitForViewOnActivityRoot(withId(R.id.infobar_message))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment