Search in sources :

Example 16 with ScreenshotTest

use of com.owncloud.android.utils.ScreenshotTest in project android by nextcloud.

the class FirstRunActivityIT method open.

@Test
@ScreenshotTest
public void open() {
    Activity sut = activityRule.launchActivity(null);
    screenshot(sut);
}
Also used : FirstRunActivity(com.nextcloud.client.onboarding.FirstRunActivity) Activity(android.app.Activity) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Example 17 with ScreenshotTest

use of com.owncloud.android.utils.ScreenshotTest in project android by nextcloud.

the class SyncedFoldersActivityIT method testSyncedFolderDialog.

@Test
@ScreenshotTest
public void testSyncedFolderDialog() {
    SyncedFolderDisplayItem item = new SyncedFolderDisplayItem(1, "/sdcard/DCIM/", "/InstantUpload/", true, false, false, true, "test@https://nextcloud.localhost", 0, 0, true, 1000, "Name", MediaFolderType.IMAGE, false);
    SyncedFolderPreferencesDialogFragment sut = SyncedFolderPreferencesDialogFragment.newInstance(item, 0);
    Intent intent = new Intent(targetContext, SyncedFoldersActivity.class);
    SyncedFoldersActivity activity = activityRule.launchActivity(intent);
    sut.show(activity.getSupportFragmentManager(), "");
    getInstrumentation().waitForIdleSync();
    shortSleep();
    screenshot(Objects.requireNonNull(sut.requireDialog().getWindow()).getDecorView());
}
Also used : SyncedFoldersActivity(com.owncloud.android.ui.activity.SyncedFoldersActivity) SyncedFolderDisplayItem(com.owncloud.android.datamodel.SyncedFolderDisplayItem) Intent(android.content.Intent) SyncedFolderPreferencesDialogFragment(com.owncloud.android.ui.dialog.SyncedFolderPreferencesDialogFragment) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Example 18 with ScreenshotTest

use of com.owncloud.android.utils.ScreenshotTest in project android by nextcloud.

the class DialogFragmentIT method testOptionalPasswordDialog.

@Test
@ScreenshotTest
public void testOptionalPasswordDialog() {
    if (Looper.myLooper() == null) {
        Looper.prepare();
    }
    SharePasswordDialogFragment sut = SharePasswordDialogFragment.newInstance(new OCFile("/"), true, true);
    showDialog(sut);
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Example 19 with ScreenshotTest

use of com.owncloud.android.utils.ScreenshotTest in project android by nextcloud.

the class DialogFragmentIT method testRemoveFolderDialog.

@Test
@ScreenshotTest
public void testRemoveFolderDialog() {
    RemoveFilesDialogFragment dialog = RemoveFilesDialogFragment.newInstance(new OCFile("/Folder/"));
    showDialog(dialog);
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Example 20 with ScreenshotTest

use of com.owncloud.android.utils.ScreenshotTest in project android by nextcloud.

the class DialogFragmentIT method testProfileBottomSheet.

@Test
@ScreenshotTest
public void testProfileBottomSheet() {
    if (Looper.myLooper() == null) {
        Looper.prepare();
    }
    // Fixed values for HoverCard
    List<Action> actions = new ArrayList<>();
    actions.add(new Action("profile", "View profile", "https://dev.nextcloud.com/core/img/actions/profile.svg", "https://dev.nextcloud.com/index.php/u/christine"));
    actions.add(new Action("core", "christine.scott@nextcloud.com", "https://dev.nextcloud.com/core/img/actions/mail.svg", "mailto:christine.scott@nextcloud.com"));
    actions.add(new Action("spreed", "Talk to Christine", "https://dev.nextcloud.com/apps/spreed/img/app-dark.svg", "https://dev.nextcloud.com/apps/spreed/?callUser=christine"));
    HoverCard hoverCard = new HoverCard("christine", "Christine Scott", actions);
    // show dialog
    Intent intent = new Intent(targetContext, FileDisplayActivity.class);
    FileDisplayActivity fda = activityRule.launchActivity(intent);
    ProfileBottomSheetDialog sut = new ProfileBottomSheetDialog(fda, user, hoverCard);
    fda.runOnUiThread(sut::show);
    waitForIdleSync();
    screenshot(sut.getWindow().getDecorView());
}
Also used : FileDisplayActivity(com.owncloud.android.ui.activity.FileDisplayActivity) Action(com.nextcloud.android.lib.resources.profile.Action) ArrayList(java.util.ArrayList) Intent(android.content.Intent) HoverCard(com.nextcloud.android.lib.resources.profile.HoverCard) ProfileBottomSheetDialog(com.owncloud.android.ui.fragment.ProfileBottomSheetDialog) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Aggregations

ScreenshotTest (com.owncloud.android.utils.ScreenshotTest)26 Test (org.junit.Test)26 OCFile (com.owncloud.android.datamodel.OCFile)15 Intent (android.content.Intent)9 FileDataStorageManager (com.owncloud.android.datamodel.FileDataStorageManager)7 Activity (android.app.Activity)4 OCUpload (com.owncloud.android.db.OCUpload)4 FileDisplayActivity (com.owncloud.android.ui.activity.FileDisplayActivity)4 ArrayList (java.util.ArrayList)4 DialogFragment (androidx.fragment.app.DialogFragment)3 User (com.nextcloud.client.account.User)3 OCCapability (com.owncloud.android.lib.resources.status.OCCapability)3 Account (android.accounts.Account)2 AccountManager (android.accounts.AccountManager)2 RegisteredUser (com.nextcloud.client.account.RegisteredUser)2 Server (com.nextcloud.client.account.Server)2 UserAccountManager (com.nextcloud.client.account.UserAccountManager)2 ChooseAccountDialogFragment (com.nextcloud.ui.ChooseAccountDialogFragment)2 OwnCloudAccount (com.owncloud.android.lib.common.OwnCloudAccount)2 UserInfo (com.owncloud.android.lib.common.UserInfo)2