Allowing both normal-case and uppercase versions of widget prompt
The prompt is "Add automatically" Bug: 138152531 Change-Id: I5f1a15563e1e11768579711108a28070b72b4454
This commit is contained in:
@@ -19,7 +19,11 @@ package com.android.launcher3.tapl;
|
||||
import androidx.test.uiautomator.By;
|
||||
import androidx.test.uiautomator.UiObject2;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class AddToHomeScreenPrompt {
|
||||
private static final Pattern ADD_AUTOMATICALLY =
|
||||
Pattern.compile("ADD AUTOMATICALLY|Add automatically");
|
||||
private final LauncherInstrumentation mLauncher;
|
||||
private final UiObject2 mWidgetCell;
|
||||
|
||||
@@ -33,9 +37,6 @@ public class AddToHomeScreenPrompt {
|
||||
public void addAutomatically() {
|
||||
mLauncher.waitForObjectInContainer(
|
||||
mWidgetCell.getParent().getParent().getParent().getParent(),
|
||||
By.text(LauncherInstrumentation.isAvd()
|
||||
? "ADD AUTOMATICALLY"
|
||||
: "Add automatically")).
|
||||
click();
|
||||
By.text(ADD_AUTOMATICALLY)).click();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user