Search in sources :

Example 1 with ImageView

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

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 2 with ImageView

use of com.owncloud.android.test.ui.models.ImageView 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)

Aggregations

FailingTestCategory (com.owncloud.android.test.ui.groups.FailingTestCategory)2 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)2 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)2 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)2 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)2 FileListView (com.owncloud.android.test.ui.models.FileListView)2 GmailEmailListView (com.owncloud.android.test.ui.models.GmailEmailListView)2 GmailEmailView (com.owncloud.android.test.ui.models.GmailEmailView)2 ImageView (com.owncloud.android.test.ui.models.ImageView)2 UploadView (com.owncloud.android.test.ui.models.UploadView)2 Test (org.junit.Test)2 Category (org.junit.experimental.categories.Category)2 NoSuchElementException (org.openqa.selenium.NoSuchElementException)2