Browse Source

use screenshotViaName

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 10 months ago
parent
commit
9929f3084f

+ 6 - 0
app/src/androidTest/java/com/owncloud/android/AbstractIT.java

@@ -457,6 +457,12 @@ public abstract class AbstractIT {
         screenshot(view, "");
     }
 
+    protected void screenshotViaName(Activity activity, String name) {
+        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
+            Screenshot.snapActivity(activity).setName(name).record();
+        }
+    }
+
     protected void screenshot(View view, String prefix) {
         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) {
             Screenshot.snap(view).setName(createName(prefix)).record();

+ 6 - 6
app/src/androidTest/java/com/owncloud/android/ui/trashbin/TrashbinActivityIT.kt

@@ -47,7 +47,7 @@ class TrashbinActivityIT : AbstractIT() {
                 sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
                 onIdleSync {
                     sut.runOnUiThread { sut.loadFolder() }
-                    screenshot(sut)
+                    screenshotViaName(sut, "TrashbinActivity_error")
                 }
             }
         }
@@ -62,7 +62,7 @@ class TrashbinActivityIT : AbstractIT() {
                 sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
                 onIdleSync {
                     sut.runOnUiThread { sut.loadFolder() }
-                    screenshot(sut)
+                    screenshotViaName(sut, "TrashbinActivity_files")
                 }
             }
         }
@@ -77,7 +77,7 @@ class TrashbinActivityIT : AbstractIT() {
                 sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
                 onIdleSync {
                     sut.runOnUiThread { sut.loadFolder() }
-                    screenshot(sut)
+                    screenshotViaName(sut, "TrashbinActivity_empty")
                 }
             }
         }
@@ -92,7 +92,7 @@ class TrashbinActivityIT : AbstractIT() {
                 sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
                 onIdleSync {
                     sut.runOnUiThread { sut.showInitialLoading() }
-                    screenshot(sut)
+                    screenshotViaName(sut, "TrashbinActivity_loading")
                 }
             }
         }
@@ -107,7 +107,7 @@ class TrashbinActivityIT : AbstractIT() {
                 sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
                 onIdleSync {
                     sut.runOnUiThread { sut.showUser() }
-                    screenshot(sut)
+                    screenshotViaName(sut, "TrashbinActivity_normalUser")
                 }
             }
         }
@@ -134,7 +134,7 @@ class TrashbinActivityIT : AbstractIT() {
                 sut.trashbinPresenter = TrashbinPresenter(trashbinRepository, sut)
                 onIdleSync {
                     sut.runOnUiThread { sut.showUser() }
-                    screenshot(sut)
+                    screenshotViaName(sut, "TrashbinActivity_differentUser")
                 }
             }
         }