Browse Source

Fix DialogFragmentIT

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 4 years ago
parent
commit
d17dd38589

BIN
screenshots/gplay/debug/com.owncloud.android.ui.dialog.DialogFragmentIT_testNewFolderDialog.png


BIN
screenshots/gplay/debug/com.owncloud.android.ui.dialog.DialogFragmentIT_testRenameFileDialog.png


+ 9 - 2
src/androidTest/java/com/owncloud/android/ui/dialog/DialogFragmentIT.java

@@ -26,6 +26,7 @@ import android.Manifest;
 import android.accounts.Account;
 import android.accounts.AccountManager;
 import android.content.Intent;
+import android.os.Looper;
 
 import com.facebook.testing.screenshot.Screenshot;
 import com.nextcloud.client.account.RegisteredUser;
@@ -62,8 +63,11 @@ public class DialogFragmentIT extends AbstractIT {
         Manifest.permission.WRITE_EXTERNAL_STORAGE);
 
     @Test
-//    @ScreenshotTest
+    @ScreenshotTest
     public void testRenameFileDialog() {
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
         RenameFileDialogFragment dialog = RenameFileDialogFragment.newInstance(new OCFile("/Test/"));
         showDialog(dialog);
     }
@@ -112,8 +116,11 @@ public class DialogFragmentIT extends AbstractIT {
     }
 
     @Test
-    // @ScreenshotTest
+    @ScreenshotTest
     public void testNewFolderDialog() {
+        if (Looper.myLooper() == null) {
+            Looper.prepare();
+        }
         CreateFolderDialogFragment sut = CreateFolderDialogFragment.newInstance(new OCFile("/"));
         showDialog(sut);
     }