Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da75c243 authored by Ben Lin's avatar Ben Lin
Browse files

Initial effort toward fixing Suppress tests by integration of Espresso.

Bug: 27533946
Change-Id: I0286ff6d4c53b464180e3100b7219e766ca09de3
(cherry picked from commit 80c050b656030e070f27708bc4da5f5c7fc6cac6)
parent b43b925b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under, src) \
    ../tests/src/com/android/documentsui/StubProvider.java

LOCAL_JAVA_LIBRARIES := android-support-v4 android.test.runner
LOCAL_STATIC_JAVA_LIBRARIES := mockito-target ub-uiautomator ub-janktesthelper
LOCAL_STATIC_JAVA_LIBRARIES := mockito-target ub-uiautomator ub-janktesthelper espresso-core

LOCAL_PACKAGE_NAME := DocumentsUIPerfTests
LOCAL_INSTRUMENTATION_FOR := DocumentsUI
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ LOCAL_MODULE_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_JAVA_LIBRARIES := android-support-v4 android.test.runner
LOCAL_STATIC_JAVA_LIBRARIES := mockito-target ub-uiautomator
LOCAL_STATIC_JAVA_LIBRARIES := mockito-target ub-uiautomator espresso-core

LOCAL_PACKAGE_NAME := DocumentsUITests
LOCAL_INSTRUMENTATION_FOR := DocumentsUI
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
       </provider>
    </application>

    <instrumentation android:name="android.test.InstrumentationTestRunner"
    <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
        android:targetPackage="com.android.documentsui"
        android:label="Tests for DocumentsUI" />

+0 −6
Original line number Diff line number Diff line
@@ -72,16 +72,13 @@ public class RenameDocumentUiTest extends ActivityTest<FilesActivity> {
        device.pressBack();
    }

    @Suppress
    public void testRenameFile_OkButton() throws Exception {
        bots.directory.selectDocument(fileName1);
        bots.main.openOverflowMenu();
        bots.main.menuRename().click();
        bots.main.setDialogText(newName);

        device.waitForIdle(TIMEOUT);
        bots.main.findDialogOkButton().click();
        device.waitForIdle(TIMEOUT);

        bots.directory.assertDocumentsAbsent(fileName1);
        bots.directory.assertDocumentsPresent(newName);
@@ -101,16 +98,13 @@ public class RenameDocumentUiTest extends ActivityTest<FilesActivity> {
        bots.directory.assertDocumentsCount(4);
    }

    @Suppress
    public void testRenameFile_Cancel() throws Exception {
        bots.directory.selectDocument(fileName1);
        bots.main.openOverflowMenu();
        bots.main.menuRename().click();
        bots.main.setDialogText(newName);

        device.waitForIdle(TIMEOUT);
        bots.main.findDialogCancelButton().click();
        device.waitForIdle(TIMEOUT);

        bots.directory.assertDocumentsPresent(fileName1);
        bots.directory.assertDocumentsAbsent(newName);
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class RootsUiTest extends ActivityTest<FilesActivity> {

    public void testRootTapped_GoToRootFromChildDir() throws Exception {
        bots.directory.openDocument(dirName1);
        bots.main.assertWindowTitle(dirName1);
        bots.main.assertBreadcrumbTitle(dirName1);
        bots.roots.openRoot(ROOT_0_ID);
        bots.main.assertWindowTitle(ROOT_0_ID);
        assertDefaultContentOfTestDir0();
Loading