Commit 88762694 authored by Michele Mancina's avatar Michele Mancina Committed by Commit Bot

[Autofill Assistant] Add integration test for standalone error_state bit

Bug: b/169042549
Change-Id: Ie69d4306bc055278c344fc4de8decf46d8a287c5

Change-Id: Ie69d4306bc055278c344fc4de8decf46d8a287c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421451
Commit-Queue: Michele Mancina <micantox@google.com>
Reviewed-by: default avatarSandro Maggi <sandromaggi@google.com>
Cr-Commit-Position: refs/heads/master@{#808887}
parent b5f2fd98
......@@ -346,6 +346,74 @@ public class AutofillAssistantProgressBarIntegrationTest {
.check(matches(allOf(not(isEnabled()), hasTintColor(R.color.default_red))));
}
@Test
@MediumTest
public void testStepProgressBarErrorOnlyAction() {
ArrayList<ActionProto> list = new ArrayList<>();
list.add((ActionProto) ActionProto.newBuilder()
.setShowProgressBar(
ShowProgressBarProto.newBuilder().setStepProgressBarConfiguration(
getDefaultStepProgressBarConfiguration()))
.build());
list.add((ActionProto) ActionProto.newBuilder()
.setPrompt(PromptProto.newBuilder()
.setMessage("Initial Step")
.addChoices(Choice.newBuilder().setChip(
ChipProto.newBuilder().setText("Next"))))
.build());
list.add((ActionProto) ActionProto.newBuilder()
.setShowProgressBar(ShowProgressBarProto.newBuilder().setActiveStep(3))
.build());
list.add((ActionProto) ActionProto.newBuilder()
.setShowProgressBar(ShowProgressBarProto.newBuilder().setErrorState(true))
.build());
list.add((ActionProto) ActionProto.newBuilder()
.setPrompt(PromptProto.newBuilder()
.setMessage("Error State")
.addChoices(Choice.newBuilder().setChip(
ChipProto.newBuilder().setText("Next"))))
.build());
AutofillAssistantTestScript script = new AutofillAssistantTestScript(
(SupportedScriptProto) SupportedScriptProto.newBuilder()
.setPath("form_target_website.html")
.setPresentation(PresentationProto.newBuilder().setAutostart(true).setChip(
ChipProto.newBuilder().setText("Autostart")))
.build(),
list);
runScript(script);
waitUntilViewMatchesCondition(withText("Initial Step"), isCompletelyDisplayed());
for (int i = 0; i < 4; ++i) {
onView(withTagValue(is(String.format(
Locale.getDefault(), AssistantTagsForTesting.PROGRESSBAR_ICON_TAG, i))))
.check(matches(isDisplayed()));
onView(allOf(isDescendantOfA(withTagValue(is(String.format(Locale.getDefault(),
AssistantTagsForTesting.PROGRESSBAR_ICON_TAG, i)))),
withClassName(is(ChromeImageView.class.getName()))))
.check(matches(allOf(
not(isEnabled()), hasTintColor(R.color.modern_grey_800_alpha_38))));
}
for (int i = 0; i < 3; ++i) {
onView(withTagValue(is(String.format(
Locale.getDefault(), AssistantTagsForTesting.PROGRESSBAR_LINE_TAG, i))))
.check(matches(isDisplayed()));
}
onView(withText("Next")).perform(click());
waitUntilViewMatchesCondition(withText("Error State"), isCompletelyDisplayed());
for (int i = 0; i < 3; ++i) {
onView(allOf(isDescendantOfA(withTagValue(is(String.format(Locale.getDefault(),
AssistantTagsForTesting.PROGRESSBAR_ICON_TAG, i)))),
withClassName(is(ChromeImageView.class.getName()))))
.check(matches(allOf(isEnabled(), hasTintColor(R.color.modern_blue_600))));
}
onView(allOf(isDescendantOfA(withTagValue(is(String.format(Locale.getDefault(),
AssistantTagsForTesting.PROGRESSBAR_ICON_TAG, 3)))),
withClassName(is(ChromeImageView.class.getName()))))
.check(matches(allOf(not(isEnabled()), hasTintColor(R.color.default_red))));
}
@Test
@MediumTest
public void testStepProgressBarErrorAfterCompletion() {
......
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