Search in sources :

Example 41 with FileListView

use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.

the class ShareLinkFileTestSuite method tearDown.

@After
public void tearDown() throws Exception {
    common.takeScreenShotOnFailed(name.getMethodName());
    if (fileHasBeenCreated) {
        FileListView fileListView = new FileListView(driver);
        Actions.deleteElement(FILE_NAME, fileListView, driver);
    }
    driver.removeApp("com.owncloud.android");
    driver.quit();
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) After(org.junit.After)

Example 42 with FileListView

use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.

the class UploadTestSuite method testUploadFile.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testUploadFile() throws Exception {
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    //check if the file already exists and if true, delete it
    Actions.deleteElement(FILE_NAME, fileListView, driver);
    FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
    fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
    assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
    Common.waitTillElementIsNotPresentWithoutTimeout(fileListViewAfterUploadFile.getProgressCircular(), 1000);
    common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
    assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator())).isDisplayed());
    fileListView = new FileListView(driver);
    fileListView.scrollTillFindElement(FILE_NAME);
    assertTrue(fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) UnfinishedTestCategory(com.owncloud.android.test.ui.groups.UnfinishedTestCategory) FailingTestCategory(com.owncloud.android.test.ui.groups.FailingTestCategory) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 43 with FileListView

use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.

the class UploadTestSuite method testUploadFromGmail.

@Test
@Category(UnfinishedTestCategory.class)
public void testUploadFromGmail() throws Exception {
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    driver.startActivity("com.google.android.gm", ".ConversationListActivityGmail");
    GmailEmailListView gmailEmailListView = new GmailEmailListView(driver);
    Thread.sleep(3000);
    GmailEmailView gmailEmailView = gmailEmailListView.clickOnEmail();
    ImageView imageView = gmailEmailView.clickOnfileButton();
    imageView.clickOnOptionsButton();
    imageView.clickOnShareButton();
    imageView.clickOnOwnCloudButton();
    //justonce button do not appear always
    try {
        imageView.clickOnJustOnceButton();
    } catch (NoSuchElementException e) {
    }
    UploadView uploadView = new UploadView(driver);
    uploadView.clickOUploadButton();
    driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
    driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
    common.wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.name(FILE_GMAIL_NAME)));
    assertEquals(Config.fileToTestSendByEmailName, driver.findElementByName(FILE_GMAIL_NAME).getText());
    fileListView = new FileListView(driver);
    fileListView.scrollTillFindElement(FILE_GMAIL_NAME);
    assertTrue(fileHasBeenUploadedFromGmail = fileListView.getFileElement().isDisplayed());
//TODO. correct assert if fileListView is shown in grid mode
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) UploadView(com.owncloud.android.test.ui.models.UploadView) GmailEmailView(com.owncloud.android.test.ui.models.GmailEmailView) GmailEmailListView(com.owncloud.android.test.ui.models.GmailEmailListView) ImageView(com.owncloud.android.test.ui.models.ImageView) NoSuchElementException(org.openqa.selenium.NoSuchElementException) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) UnfinishedTestCategory(com.owncloud.android.test.ui.groups.UnfinishedTestCategory) FailingTestCategory(com.owncloud.android.test.ui.groups.FailingTestCategory) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 44 with FileListView

use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.

the class UploadTestSuite method testKeepFileUpToDate.

@Test
@Category({ FailingTestCategory.class })
public void testKeepFileUpToDate() throws Exception {
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    Common.waitTillElementIsNotPresentWithoutTimeout(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);
    assertTrue(common.isElementPresent(fileListViewAfterUploadFile.getFileElementLayout(), MobileBy.id(FileListView.getFavoriteFileIndicator())));
    assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getFavoriteFileIndicator())).isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) FileDetailsView(com.owncloud.android.test.ui.models.FileDetailsView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) UnfinishedTestCategory(com.owncloud.android.test.ui.groups.UnfinishedTestCategory) FailingTestCategory(com.owncloud.android.test.ui.groups.FailingTestCategory) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 45 with FileListView

use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.

the class UploadTestSuite method testKeepFileUpToDateAndRefresh.

@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.waitTillElementIsNotPresentWithoutTimeout(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.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 100);
    assertTrue(common.isElementPresent(fileListViewAfterUploadFile.getFileElementLayout(), MobileBy.id(FileListView.getFavoriteFileIndicator())));
    assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getFavoriteFileIndicator())).isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) FileDetailsView(com.owncloud.android.test.ui.models.FileDetailsView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) UnfinishedTestCategory(com.owncloud.android.test.ui.groups.UnfinishedTestCategory) FailingTestCategory(com.owncloud.android.test.ui.groups.FailingTestCategory) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Aggregations

FileListView (com.owncloud.android.test.ui.models.FileListView)64 Test (org.junit.Test)46 Category (org.junit.experimental.categories.Category)46 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)34 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)32 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)16 After (org.junit.After)16 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)12 ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)12 MenuList (com.owncloud.android.test.ui.models.MenuList)12 SettingsView (com.owncloud.android.test.ui.models.SettingsView)12 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)12 FailingTestCategory (com.owncloud.android.test.ui.groups.FailingTestCategory)10 IgnoreTestCategory (com.owncloud.android.test.ui.groups.IgnoreTestCategory)6 LoginForm (com.owncloud.android.test.ui.models.LoginForm)6 AndroidElement (io.appium.java_client.android.AndroidElement)6 FileDetailsView (com.owncloud.android.test.ui.models.FileDetailsView)4 MoveView (com.owncloud.android.test.ui.models.MoveView)4 NewFolderPopUp (com.owncloud.android.test.ui.models.NewFolderPopUp)4 NoSuchElementException (org.openqa.selenium.NoSuchElementException)4