Search in sources :

Example 1 with GmailEmailView

use of com.owncloud.android.test.ui.models.GmailEmailView 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)1 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)1 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)1 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)1 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)1 FileListView (com.owncloud.android.test.ui.models.FileListView)1 GmailEmailListView (com.owncloud.android.test.ui.models.GmailEmailListView)1 GmailEmailView (com.owncloud.android.test.ui.models.GmailEmailView)1 ImageView (com.owncloud.android.test.ui.models.ImageView)1 UploadView (com.owncloud.android.test.ui.models.UploadView)1 Test (org.junit.Test)1 Category (org.junit.experimental.categories.Category)1 NoSuchElementException (org.openqa.selenium.NoSuchElementException)1