mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 06:35:48 +03:00
test: favorite + refresh
This commit is contained in:
parent
8386357e68
commit
d9a541d32a
3 changed files with 66 additions and 2 deletions
|
@ -0,0 +1,5 @@
|
|||
package com.owncloud.android.test.ui.groups;
|
||||
|
||||
public interface InProgressCategory extends IgnoreTestCategory{
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.owncloud.android.test.ui.testSuites;
|
||||
|
||||
import org.junit.experimental.categories.Categories.IncludeCategory;
|
||||
import org.junit.runner.RunWith;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories;
|
||||
import com.owncloud.android.test.ui.groups.InProgressCategory;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix;
|
||||
import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage;
|
||||
|
||||
|
||||
@RunWith(FlexibleCategories.class)
|
||||
@IncludeCategory(InProgressCategory.class)
|
||||
@TestScanPackage("com.owncloud.android.test.ui.testSuites")
|
||||
@TestClassPrefix("")
|
||||
@TestClassSuffix("TestSuite")
|
||||
public class RunInProgressTest {
|
||||
|
||||
}
|
|
@ -40,7 +40,9 @@ import org.openqa.selenium.support.ui.ExpectedConditions;
|
|||
import com.owncloud.android.test.ui.actions.Actions;
|
||||
import com.owncloud.android.test.ui.groups.FailingTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.IgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.InProgressCategory;
|
||||
import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.SmokeTestCategory;
|
||||
import com.owncloud.android.test.ui.groups.UnfinishedTestCategory;
|
||||
import com.owncloud.android.test.ui.models.FileDetailsView;
|
||||
import com.owncloud.android.test.ui.models.ElementMenuOptions;
|
||||
|
@ -72,7 +74,7 @@ public class UploadTestSuite{
|
|||
}
|
||||
|
||||
@Test
|
||||
@Category(NoIgnoreTestCategory.class)
|
||||
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
|
||||
public void testUploadFile () throws Exception {
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
|
@ -151,7 +153,8 @@ public class UploadTestSuite{
|
|||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
|
||||
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
ElementMenuOptions menuOptions = fileListViewAfterUploadFile
|
||||
.longPressOnElement(FILE_NAME);
|
||||
|
@ -166,6 +169,43 @@ public class UploadTestSuite{
|
|||
.findElement(By.id(FileListView.getFavoriteFileIndicator()))
|
||||
.isDisplayed());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Category({NoIgnoreTestCategory.class})
|
||||
public void testKeepFileUpToDateAndRefresh () throws Exception {
|
||||
|
||||
FileListView fileListView = Actions.login(Config.URL, Config.user,
|
||||
Config.password, Config.isTrusted, driver);
|
||||
common.assertIsInFileListView();
|
||||
|
||||
Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(),
|
||||
1000);
|
||||
|
||||
FileListView fileListViewAfterUploadFile = Actions
|
||||
.uploadFile(FILE_NAME, fileListView);
|
||||
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
|
||||
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile
|
||||
.getFileElement().isDisplayed());
|
||||
|
||||
ElementMenuOptions menuOptions = fileListViewAfterUploadFile
|
||||
.longPressOnElement(FILE_NAME);
|
||||
FileDetailsView fileDetailsView = menuOptions.clickOnDetails();
|
||||
fileDetailsView.checkKeepFileUpToDateCheckbox();
|
||||
Thread.sleep(3000);
|
||||
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
|
||||
|
||||
fileListViewAfterUploadFile.pulldownToRefresh();
|
||||
//assertTrue(fileListView.getProgressCircular().isDisplayed());
|
||||
Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(),
|
||||
100);
|
||||
|
||||
assertTrue(common.isElementPresent(
|
||||
fileListViewAfterUploadFile.getFileElementLayout(),
|
||||
MobileBy.id(FileListView.getFavoriteFileIndicator())));
|
||||
assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
|
||||
.findElement(By.id(FileListView.getFavoriteFileIndicator()))
|
||||
.isDisplayed());
|
||||
}
|
||||
|
||||
|
||||
@After
|
||||
|
|
Loading…
Reference in a new issue