Commit 265127e1 authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Commit Bot

[Autofill Assistant] Close keyboard before closing dialog.

Closing the keyboard before attempting to click the button should
finally fix those flaky tests.

Bug: 1087042
Bug: 1084324
Change-Id: Iae013984e3b844eb665aac7f363f2111f139e378
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218834
Commit-Queue: Sandro Maggi <sandromaggi@google.com>
Reviewed-by: default avatarSandro Maggi <sandromaggi@google.com>
Cr-Commit-Position: refs/heads/master@{#773064}
parent ec3e6d4a
......@@ -50,7 +50,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.chrome.autofill_assistant.R;
import org.chromium.chrome.browser.autofill.PersonalDataManager.CreditCard;
import org.chromium.chrome.browser.autofill_assistant.proto.ActionProto;
......@@ -105,7 +104,6 @@ public class AutofillAssistantPersonalDataManagerTest {
*/
@Test
@MediumTest
@DisabledTest(message = "crbug.com/1087042")
public void testCreateAndEnterProfile() throws Exception {
ArrayList<ActionProto> list = new ArrayList<>();
list.add(
......@@ -164,6 +162,7 @@ public class AutofillAssistantPersonalDataManagerTest {
waitUntilViewMatchesCondition(
withContentDescription("Email*"), allOf(isDisplayed(), isEnabled()));
onView(withContentDescription("Email*")).perform(typeText("johndoe@google.com"));
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
waitUntilViewMatchesCondition(withText("Continue"), isEnabled());
......@@ -181,7 +180,6 @@ public class AutofillAssistantPersonalDataManagerTest {
*/
@Test
@MediumTest
@DisabledTest(message = "crbug.com/1087042")
public void testCreateAndEditProfileMultipleTimes() throws Exception {
ArrayList<ActionProto> list = new ArrayList<>();
list.add(
......@@ -215,6 +213,7 @@ public class AutofillAssistantPersonalDataManagerTest {
waitUntilViewMatchesCondition(
withContentDescription("Email*"), allOf(isDisplayed(), isEnabled()));
onView(withContentDescription("Email*")).perform(typeText("doe@google.com"));
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
waitUntilViewMatchesCondition(withText("Continue"), isEnabled());
......@@ -224,6 +223,7 @@ public class AutofillAssistantPersonalDataManagerTest {
onView(withContentDescription("Edit contact info")).perform(click());
waitUntilViewMatchesCondition(
withContentDescription("Name*"), allOf(isDisplayed(), isEnabled()));
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
......@@ -232,6 +232,7 @@ public class AutofillAssistantPersonalDataManagerTest {
waitUntilViewMatchesCondition(
withContentDescription("Name*"), allOf(isDisplayed(), isEnabled()));
onView(withContentDescription("Name*")).perform(clearText(), typeText("Jane Doe"));
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
......@@ -460,6 +461,7 @@ public class AutofillAssistantPersonalDataManagerTest {
onView(withContentDescription("Email*"))
.perform(clearText())
.perform(typeText("janedoe@google.com"));
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
waitUntilViewMatchesCondition(withText("Contact info"), isDisplayed());
......@@ -540,6 +542,7 @@ public class AutofillAssistantPersonalDataManagerTest {
.atPosition(1 /* address of Adam, 0 is SELECT (empty) */)
.inRoot(withDecorView(withClassName(containsString("Popup"))))
.perform(click());
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
waitUntilViewMatchesCondition(allOf(withId(R.id.credit_card_number),
......@@ -691,6 +694,7 @@ public class AutofillAssistantPersonalDataManagerTest {
.atPosition(3)
.inRoot(withDecorView(withClassName(containsString("Popup"))))
.perform(click());
Espresso.closeSoftKeyboard();
onView(withId(org.chromium.chrome.R.id.editor_dialog_done_button))
.perform(scrollTo(), click());
// Updating the card does not collapse the card section.
......
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