summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2019-06-20 17:52:16 -0700
committervadimt <vadimt@google.com>2019-06-20 17:53:05 -0700
commitd11b604e194489dca0f2e54defab64bff5d47132 (patch)
tree0a2749b8abd4d862e4b4f06f60dd675dcb58e53d /tests
parent715de78e94cf811562a55f7bc341d51f953bd05f (diff)
downloadandroid_packages_apps_Trebuchet-d11b604e194489dca0f2e54defab64bff5d47132.tar.gz
android_packages_apps_Trebuchet-d11b604e194489dca0f2e54defab64bff5d47132.tar.bz2
android_packages_apps_Trebuchet-d11b604e194489dca0f2e54defab64bff5d47132.zip
Converting some tests to TAPL
Change-Id: I1b67f80d9d61792d5795f9638bf9d19919f36d39
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/ui/TestViewHelpers.java15
-rw-r--r--tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java11
2 files changed, 5 insertions, 21 deletions
diff --git a/tests/src/com/android/launcher3/ui/TestViewHelpers.java b/tests/src/com/android/launcher3/ui/TestViewHelpers.java
index a73bde011..d13d31952 100644
--- a/tests/src/com/android/launcher3/ui/TestViewHelpers.java
+++ b/tests/src/com/android/launcher3/ui/TestViewHelpers.java
@@ -54,21 +54,6 @@ public class TestViewHelpers {
return UiDevice.getInstance(getInstrumentation());
}
- /**
- * Opens all apps and returns the recycler view
- */
- public static UiObject2 openAllApps() {
- final UiDevice device = getDevice();
- device.waitForIdle();
- UiObject2 hotseat = device.wait(
- Until.findObject(getSelectorForId(R.id.hotseat)), 2500);
- Point start = hotseat.getVisibleCenter();
- int endY = (int) (device.getDisplayHeight() * 0.1f);
- // 100 px/step
- device.swipe(start.x, start.y, start.x, endY, (start.y - endY) / 100);
- return findViewById(R.id.apps_list_view);
- }
-
public static UiObject2 findViewById(int id) {
return getDevice().wait(Until.findObject(getSelectorForId(id)),
AbstractLauncherUiTest.DEFAULT_UI_TIMEOUT);
diff --git a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
index be27a66a4..e4f9d7889 100644
--- a/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
+++ b/tests/src/com/android/launcher3/ui/widget/RequestPinItemTest.java
@@ -41,7 +41,6 @@ import com.android.launcher3.testcomponent.AppWidgetNoConfig;
import com.android.launcher3.testcomponent.AppWidgetWithConfig;
import com.android.launcher3.testcomponent.RequestPinItemActivity;
import com.android.launcher3.ui.AbstractLauncherUiTest;
-import com.android.launcher3.ui.TestViewHelpers;
import com.android.launcher3.util.Condition;
import com.android.launcher3.util.Wait;
import com.android.launcher3.util.rule.ShellCommandRule;
@@ -149,14 +148,14 @@ public class RequestPinItemTest extends AbstractLauncherUiTest {
clearHomescreen();
mActivityMonitor.startLauncher();
- // Open all apps and wait for load complete
- final UiObject2 appsContainer = TestViewHelpers.openAllApps();
- Wait.atMost(null, Condition.minChildCount(appsContainer, 2), DEFAULT_UI_TIMEOUT);
-
// Open Pin item activity
BlockingBroadcastReceiver openMonitor = new BlockingBroadcastReceiver(
RequestPinItemActivity.class.getName());
- scrollAndFind(appsContainer, By.text("Test Pin Item")).click();
+ mLauncher.
+ getWorkspace().
+ switchToAllApps().
+ getAppIcon("Test Pin Item").
+ launch("com.google.android.apps.nexuslauncher.tests");
assertNotNull(openMonitor.blockingGetExtraIntent());
// Set callback