Commit 2018771d authored by Clemens Arbesser's avatar Clemens Arbesser Committed by Chromium LUCI CQ

[Autofill Assistant] Fix several integration tests.

This CL (hopefully) fixes several flakily failing integration tests.

- In one case, the translate popup could block the tap on a website
element. Furthermore, possibly related to crbug.com/1140957, tapping
some of the elements did not reliably work. The workaround is to disable
translate and tap a different element.

- In two other cases, tests were flaky because espresso timed out
waiting for the UI to be idle. I was not able to reproduce, but since we
have had similar issues in the past who were related to animations, I
have removed the progress bar from those tests. We will have to monitor
the builders to confirm that this fixes the flakes.

Bug: 1149965
Change-Id: I149b7c930d6e57f496ab4c1f0991c34aac04b578
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567393
Commit-Queue: Clemens Arbesser <arbesser@google.com>
Commit-Queue: Sandro Maggi <sandromaggi@google.com>
Auto-Submit: Clemens Arbesser <arbesser@google.com>
Reviewed-by: default avatarSandro Maggi <sandromaggi@google.com>
Cr-Commit-Position: refs/heads/master@{#832323}
parent 1dccbc81
...@@ -34,7 +34,6 @@ import org.junit.Test; ...@@ -34,7 +34,6 @@ import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.chromium.base.test.util.CommandLineFlags; 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.autofill_assistant.R;
import org.chromium.chrome.browser.autofill_assistant.proto.ActionProto; import org.chromium.chrome.browser.autofill_assistant.proto.ActionProto;
import org.chromium.chrome.browser.autofill_assistant.proto.ChipIcon; import org.chromium.chrome.browser.autofill_assistant.proto.ChipIcon;
...@@ -264,9 +263,11 @@ public class AutofillAssistantTriggerScriptIntegrationTest { ...@@ -264,9 +263,11 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
@Test @Test
@MediumTest @MediumTest
@Features.EnableFeatures(ChromeFeatureList.AUTOFILL_ASSISTANT_PROACTIVE_HELP) @Features.EnableFeatures(ChromeFeatureList.AUTOFILL_ASSISTANT_PROACTIVE_HELP)
// Disable translate to prevent the popup from covering part of the website.
@Features.DisableFeatures("Translate")
public void elementCondition() throws Exception { public void elementCondition() throws Exception {
SelectorProto.Builder touch_area_four = SelectorProto.newBuilder().addFilters( SelectorProto.Builder touch_area_four = SelectorProto.newBuilder().addFilters(
SelectorProto.Filter.newBuilder().setCssSelector("#touch_area_four")); SelectorProto.Filter.newBuilder().setCssSelector("#touch_area_one"));
TriggerScriptProto.Builder buttonVisibleTriggerScript = TriggerScriptProto.Builder buttonVisibleTriggerScript =
TriggerScriptProto.newBuilder() TriggerScriptProto.newBuilder()
.setTriggerCondition(TriggerScriptConditionProto.newBuilder().setSelector( .setTriggerCondition(TriggerScriptConditionProto.newBuilder().setSelector(
...@@ -296,7 +297,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest { ...@@ -296,7 +297,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
onView(withId(R.id.progress_bar)).check(matches(not(isDisplayed()))); onView(withId(R.id.progress_bar)).check(matches(not(isDisplayed())));
onView(withId(R.id.step_progress_bar)).check(matches(isDisplayed())); onView(withId(R.id.step_progress_bar)).check(matches(isDisplayed()));
tapElement(mTestRule, "touch_area_four"); tapElement(mTestRule, "touch_area_one");
waitUntilViewMatchesCondition(withText("Area invisible"), isCompletelyDisplayed()); waitUntilViewMatchesCondition(withText("Area invisible"), isCompletelyDisplayed());
onView(withId(R.id.progress_bar)).check(matches(not(isDisplayed()))); onView(withId(R.id.progress_bar)).check(matches(not(isDisplayed())));
onView(withId(R.id.step_progress_bar)).check(matches(not(isDisplayed()))); onView(withId(R.id.step_progress_bar)).check(matches(not(isDisplayed())));
...@@ -357,7 +358,6 @@ public class AutofillAssistantTriggerScriptIntegrationTest { ...@@ -357,7 +358,6 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
@Test @Test
@MediumTest @MediumTest
@Features.EnableFeatures(ChromeFeatureList.AUTOFILL_ASSISTANT_PROACTIVE_HELP) @Features.EnableFeatures(ChromeFeatureList.AUTOFILL_ASSISTANT_PROACTIVE_HELP)
@DisabledTest(message = "https://crbug.com/1149965")
public void transitionToRegularScriptWithoutOnboarding() throws Exception { public void transitionToRegularScriptWithoutOnboarding() throws Exception {
TriggerScriptProto.Builder triggerScript = TriggerScriptProto.Builder triggerScript =
TriggerScriptProto TriggerScriptProto
...@@ -365,7 +365,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest { ...@@ -365,7 +365,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
/* no trigger condition */ /* no trigger condition */
.setUserInterface(createDefaultUI("Trigger script", .setUserInterface(createDefaultUI("Trigger script",
/* bubbleMessage = */ "", /* bubbleMessage = */ "",
/* withProgressBar = */ true) /* withProgressBar = */ false)
.setRegularScriptLoadingStatusMessage( .setRegularScriptLoadingStatusMessage(
"Loading regular script")); "Loading regular script"));
...@@ -399,8 +399,6 @@ public class AutofillAssistantTriggerScriptIntegrationTest { ...@@ -399,8 +399,6 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
onView(withText("Continue")).perform(click()); onView(withText("Continue")).perform(click());
waitUntilViewMatchesCondition(withText("Done"), isCompletelyDisplayed()); waitUntilViewMatchesCondition(withText("Done"), isCompletelyDisplayed());
onView(withText("Loading regular script")).check(matches(isDisplayed())); onView(withText("Loading regular script")).check(matches(isDisplayed()));
onView(withId(R.id.progress_bar)).check(matches(not(isDisplayed())));
onView(withId(R.id.step_progress_bar)).check(matches(isDisplayed()));
} }
@Test @Test
...@@ -419,7 +417,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest { ...@@ -419,7 +417,7 @@ public class AutofillAssistantTriggerScriptIntegrationTest {
/* no trigger condition */ /* no trigger condition */
.setUserInterface(createDefaultUI("Trigger script", .setUserInterface(createDefaultUI("Trigger script",
/* bubbleMessage = */ "", /* bubbleMessage = */ "",
/* withProgressBar = */ true)); /* withProgressBar = */ false));
GetTriggerScriptsResponseProto triggerScripts = GetTriggerScriptsResponseProto triggerScripts =
(GetTriggerScriptsResponseProto) GetTriggerScriptsResponseProto.newBuilder() (GetTriggerScriptsResponseProto) GetTriggerScriptsResponseProto.newBuilder()
.addTriggerScripts(triggerScript) .addTriggerScripts(triggerScript)
......
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