Pārlūkot izejas kodu

Add screenshot tests

Signed-off-by: alperozturk <alper_ozturk@proton.me>
alperozturk 1 gadu atpakaļ
vecāks
revīzija
af3e88fb01

+ 24 - 0
app/src/androidTest/java/com/owncloud/android/ui/activity/FolderPickerActivityIT.java

@@ -21,6 +21,9 @@ package com.owncloud.android.ui.activity;
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
  */
 
+import android.content.Intent;
+import android.view.View;
+
 import com.owncloud.android.AbstractIT;
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.OCFile;
@@ -135,4 +138,25 @@ public class FolderPickerActivityIT extends AbstractIT {
         waitForIdleSync();
         screenshot(sut);
     }
+
+    @Test
+    @ScreenshotTest
+    public void testMoveOrCopy() {
+        Intent intent = new Intent();
+        FolderPickerActivity targetActivity = activityRule.launchActivity(intent);
+
+        waitForIdleSync();
+        screenshot(targetActivity);
+    }
+
+    @Test
+    @ScreenshotTest
+    public void testChooseLocationAction() {
+        Intent intent = new Intent();
+        intent.putExtra(FolderPickerActivity.EXTRA_ACTION, FolderPickerActivity.CHOOSE_LOCATION);
+        FolderPickerActivity targetActivity = activityRule.launchActivity(intent);
+
+        waitForIdleSync();
+        screenshot(targetActivity);
+    }
 }

+ 3 - 3
app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt

@@ -76,9 +76,9 @@ open class FolderPickerActivity :
         private set
 
     private var mCancelBtn: MaterialButton? = null
-    private var mCopyBtn: MaterialButton? = null
-    private var mChooseBtn: MaterialButton? = null
-    private var mMoveBtn: MaterialButton? = null
+    var mCopyBtn: MaterialButton? = null
+    var mChooseBtn: MaterialButton? = null
+    var mMoveBtn: MaterialButton? = null
 
     private var caption: String? = null