test: favorite + refresh

This commit is contained in:
purigarcia 2015-05-25 09:15:03 +02:00
parent 8386357e68
commit d9a541d32a
3 changed files with 66 additions and 2 deletions

View file

@ -0,0 +1,5 @@
package com.owncloud.android.test.ui.groups;
public interface InProgressCategory extends IgnoreTestCategory{
}

View file

@ -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 {
}

View file

@ -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);
@ -167,6 +170,43 @@ public class UploadTestSuite{
.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
public void tearDown() throws Exception {