mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
Add testOnlyOnServer function inside AbstractIT
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
887c197287
commit
b853dce389
1 changed files with 10 additions and 0 deletions
|
@ -37,7 +37,9 @@ import com.owncloud.android.lib.common.OwnCloudClientFactory;
|
|||
import com.owncloud.android.lib.common.accounts.AccountUtils;
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.lib.resources.status.CapabilityBooleanType;
|
||||
import com.owncloud.android.lib.resources.status.GetCapabilitiesRemoteOperation;
|
||||
import com.owncloud.android.lib.resources.status.OCCapability;
|
||||
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
||||
import com.owncloud.android.operations.CreateFolderOperation;
|
||||
import com.owncloud.android.operations.UploadFileOperation;
|
||||
import com.owncloud.android.utils.FileStorageUtils;
|
||||
|
@ -71,6 +73,7 @@ import static androidx.test.espresso.Espresso.onView;
|
|||
import static androidx.test.espresso.matcher.ViewMatchers.withId;
|
||||
import static com.owncloud.android.lib.common.accounts.AccountUtils.Constants.KEY_USER_ID;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assume.assumeTrue;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -187,6 +190,13 @@ public abstract class AbstractIT {
|
|||
}
|
||||
}
|
||||
|
||||
protected void testOnlyOnServer(OwnCloudVersion version) {
|
||||
OCCapability ocCapability = (OCCapability) new GetCapabilitiesRemoteOperation()
|
||||
.execute(nextcloudClient)
|
||||
.getSingleData();
|
||||
assumeTrue(ocCapability.getVersion().isNewerOrEqual(version));
|
||||
}
|
||||
|
||||
@Before
|
||||
public void enableAccessibilityChecks() {
|
||||
androidx.test.espresso.accessibility.AccessibilityChecks.enable().setRunChecksFromRootView(true);
|
||||
|
|
Loading…
Reference in a new issue