Search in sources :

Example 11 with UiScrollable

use of android.support.test.uiautomator.UiScrollable in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class GestureSettingsTest method navigateToMovesSetting.

private void navigateToMovesSetting(String title) throws Exception {
    launchMoves();
    UiScrollable moves = new UiScrollable(new UiSelector().packageName(mTargetPackage).scrollable(true));
    moves.scrollTextIntoView(title);
}
Also used : UiSelector(android.support.test.uiautomator.UiSelector) UiScrollable(android.support.test.uiautomator.UiScrollable)

Example 12 with UiScrollable

use of android.support.test.uiautomator.UiScrollable in project android_frameworks_base by crdroidandroid.

the class RootsListBot method findRoot.

private UiObject findRoot(String label) throws UiObjectNotFoundException {
    final UiSelector rootsList = new UiSelector().resourceId("com.android.documentsui:id/container_roots").childSelector(new UiSelector().resourceId(ROOTS_LIST_ID));
    // We might need to expand drawer if not visible
    if (!new UiObject(rootsList).waitForExists(mTimeout)) {
        Log.d(TAG, "Failed to find roots list; trying to expand");
        final UiSelector hamburger = new UiSelector().resourceId("com.android.documentsui:id/toolbar").childSelector(new UiSelector().className("android.widget.ImageButton").clickable(true));
        new UiObject(hamburger).click();
    }
    // Wait for the first list item to appear
    new UiObject(rootsList.childSelector(new UiSelector())).waitForExists(mTimeout);
    // Now scroll around to find our item
    new UiScrollable(rootsList).scrollIntoView(new UiSelector().text(label));
    return new UiObject(rootsList.childSelector(new UiSelector().text(label)));
}
Also used : UiObject(android.support.test.uiautomator.UiObject) UiSelector(android.support.test.uiautomator.UiSelector) UiScrollable(android.support.test.uiautomator.UiScrollable)

Example 13 with UiScrollable

use of android.support.test.uiautomator.UiScrollable in project cw-omnibus by commonsguy.

the class ListTests method openActivity.

private void openActivity() throws UiObjectNotFoundException {
    device.pressHome();
    UiObject allAppsButton = device.findObject(new UiSelector().description("Apps"));
    allAppsButton.clickAndWaitForNewWindow();
    UiObject appsTab = device.findObject(new UiSelector().text("Apps"));
    appsTab.click();
    UiScrollable appViews = new UiScrollable(new UiSelector().scrollable(true));
    appViews.setAsHorizontalList();
    UiObject ourApp = appViews.getChildByText(new UiSelector().className("android.widget.TextView"), "Action Bar Fragment Demo");
    ourApp.clickAndWaitForNewWindow();
    UiObject appValidation = device.findObject(new UiSelector().packageName("com.commonsware.android.abf"));
    Assert.assertTrue("Could not open test app", appValidation.exists());
}
Also used : UiObject(android.support.test.uiautomator.UiObject) UiSelector(android.support.test.uiautomator.UiSelector) UiScrollable(android.support.test.uiautomator.UiScrollable)

Example 14 with UiScrollable

use of android.support.test.uiautomator.UiScrollable in project platform_frameworks_base by android.

the class FilesJankPerfTest method testFlingJankPerformance.

@JankTest(expectedFrames = 0, beforeLoop = "setupAndOpenInLoop", afterLoop = "tearDownInLoop")
@GfxMonitor(processName = DOCUMENTSUI_PACKAGE)
public void testFlingJankPerformance() throws Exception {
    new UiScrollable(mDirListBot.findDocumentsList().getSelector()).flingToEnd(MAX_FLINGS);
    getInstrumentation().waitForIdleSync();
}
Also used : UiScrollable(android.support.test.uiautomator.UiScrollable) JankTest(android.support.test.jank.JankTest) GfxMonitor(android.support.test.jank.GfxMonitor)

Example 15 with UiScrollable

use of android.support.test.uiautomator.UiScrollable in project platform_frameworks_base by android.

the class RootsListBot method findRoot.

private UiObject findRoot(String label) throws UiObjectNotFoundException {
    final UiSelector rootsList = new UiSelector().resourceId("com.android.documentsui:id/container_roots").childSelector(new UiSelector().resourceId(ROOTS_LIST_ID));
    // We might need to expand drawer if not visible
    if (!new UiObject(rootsList).waitForExists(mTimeout)) {
        Log.d(TAG, "Failed to find roots list; trying to expand");
        final UiSelector hamburger = new UiSelector().resourceId("com.android.documentsui:id/toolbar").childSelector(new UiSelector().className("android.widget.ImageButton").clickable(true));
        new UiObject(hamburger).click();
    }
    // Wait for the first list item to appear
    new UiObject(rootsList.childSelector(new UiSelector())).waitForExists(mTimeout);
    // Now scroll around to find our item
    new UiScrollable(rootsList).scrollIntoView(new UiSelector().text(label));
    return new UiObject(rootsList.childSelector(new UiSelector().text(label)));
}
Also used : UiObject(android.support.test.uiautomator.UiObject) UiSelector(android.support.test.uiautomator.UiSelector) UiScrollable(android.support.test.uiautomator.UiScrollable)

Aggregations

UiScrollable (android.support.test.uiautomator.UiScrollable)22 UiSelector (android.support.test.uiautomator.UiSelector)17 UiObject (android.support.test.uiautomator.UiObject)13 GfxMonitor (android.support.test.jank.GfxMonitor)5 JankTest (android.support.test.jank.JankTest)5 UiObjectNotFoundException (android.support.test.uiautomator.UiObjectNotFoundException)5 Test (org.junit.Test)2 RelativeLayout (android.widget.RelativeLayout)1