Search in sources :

Example 11 with ScreenshotTest

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

the class ConflictsResolveActivityIT method screenshotTextFiles.

@Test
@ScreenshotTest
public void screenshotTextFiles() {
    OCFile newFile = new OCFile("/newFile.txt");
    newFile.setFileLength(56000);
    newFile.setModificationTimestamp(1522019340);
    newFile.setStoragePath(FileStorageUtils.getSavePath(user.getAccountName()) + "/nonEmpty.txt");
    OCFile existingFile = new OCFile("/newFile.txt");
    existingFile.setFileLength(1024000);
    existingFile.setModificationTimestamp(1582019340);
    FileDataStorageManager storageManager = new FileDataStorageManager(user, targetContext.getContentResolver());
    storageManager.saveNewFile(existingFile);
    Intent intent = new Intent(targetContext, ConflictsResolveActivity.class);
    intent.putExtra(ConflictsResolveActivity.EXTRA_FILE, newFile);
    intent.putExtra(ConflictsResolveActivity.EXTRA_EXISTING_FILE, existingFile);
    ConflictsResolveActivity sut = activityRule.launchActivity(intent);
    ConflictsResolveDialog dialog = ConflictsResolveDialog.newInstance(existingFile, newFile, UserAccountManagerImpl.fromContext(targetContext).getUser());
    dialog.showDialog(sut);
    getInstrumentation().waitForIdleSync();
    shortSleep();
    shortSleep();
    shortSleep();
    shortSleep();
    screenshot(Objects.requireNonNull(dialog.requireDialog().getWindow()).getDecorView());
}
Also used : OCFile(com.owncloud.android.datamodel.OCFile) FileDataStorageManager(com.owncloud.android.datamodel.FileDataStorageManager) Intent(android.content.Intent) ConflictsResolveDialog(com.owncloud.android.ui.dialog.ConflictsResolveDialog) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Example 12 with ScreenshotTest

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

the class ManageAccountsActivityIT method userInfoDetail.

@Test
@ScreenshotTest
public void userInfoDetail() {
    ManageAccountsActivity sut = activityRule.launchActivity(null);
    User user = sut.accountManager.getUser();
    UserInfo userInfo = new UserInfo("test", true, "Test User", "test@nextcloud.com", "+49 123 456", "Address 123, Berlin", "https://www.nextcloud.com", "https://twitter.com/Nextclouders", new Quota(), new ArrayList<>());
    sut.showUser(user, userInfo);
    shortSleep();
    shortSleep();
    screenshot(getCurrentActivity());
}
Also used : User(com.nextcloud.client.account.User) Quota(com.owncloud.android.lib.common.Quota) UserInfo(com.owncloud.android.lib.common.UserInfo) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest)

Example 13 with ScreenshotTest

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

the class ManageAccountsActivityIT method open.

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

Example 14 with ScreenshotTest

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

the class CommunityActivityIT method open.

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

Example 15 with ScreenshotTest

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

the class AuthenticatorActivityIT method login.

@Test
@ScreenshotTest
public void login() {
    AuthenticatorActivity sut = activityRule.launchActivity(null);
    ((TextView) sut.findViewById(R.id.host_url_input)).setText(URL);
    sut.runOnUiThread(() -> sut.getAccountSetupBinding().hostUrlInput.clearFocus());
    screenshot(sut);
}
Also used : TextView(android.widget.TextView) AuthenticatorActivity(com.owncloud.android.authentication.AuthenticatorActivity) Test(org.junit.Test) ScreenshotTest(com.owncloud.android.utils.ScreenshotTest) 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