use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class RenameFileTestSuite method testRenameFile.
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testRenameFile() throws Exception {
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
// TODO. if the file already exists, do not upload
FileListView fileListViewAfterUploadFile = Actions.uploadFile(OLD_FILE_NAME, fileListView);
// check if the file with the new name already exists, if true delete it
Actions.deleteElement(FILE_NAME, fileListView, driver);
fileListViewAfterUploadFile.scrollTillFindElement(OLD_FILE_NAME);
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
CurrentCreatedFile = OLD_FILE_NAME;
Common.waitTillElementIsNotPresentWithoutTimeout(fileListViewAfterUploadFile.getProgressCircular(), 1000);
common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
ElementMenuOptions menuOptions = fileListViewAfterUploadFile.longPressOnElement(OLD_FILE_NAME);
NewFolderPopUp newFolderPopUp = menuOptions.clickOnRename();
newFolderPopUp.typeNewFolderName(FILE_NAME);
WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp.clickOnNewFolderOkButton();
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertNotNull(fileListViewAfterUploadFile.getFileElement());
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
assertEquals(FILE_NAME, fileListViewAfterUploadFile.getFileElement().getText());
CurrentCreatedFile = FILE_NAME;
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class RenameFileTestSuite method tearDown.
@After
public void tearDown() throws Exception {
common.takeScreenShotOnFailed(name.getMethodName());
if (fileHasBeenCreated) {
FileListView fileListView = new FileListView(driver);
Actions.deleteElement(CurrentCreatedFile, fileListView, driver);
}
driver.removeApp("com.owncloud.android");
driver.quit();
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class ShareLinkFileTestSuite method testShareLinkFileByGmail.
@Test
@Category({ NoIgnoreTestCategory.class })
public void testShareLinkFileByGmail() throws Exception {
AndroidElement sharedElementIndicator;
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
// TODO. if the file already exists, do not upload
FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
sharedElementIndicator = Actions.shareLinkElementByGmail(FILE_NAME, fileListViewAfterUploadFile, driver, common);
assertTrue(sharedElementIndicator.isDisplayed());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class ShareLinkFileTestSuite method testUnshareLinkFile.
@Test
@Category({ IgnoreTestCategory.class, SmokeTestCategory.class })
public void testUnshareLinkFile() throws Exception {
AndroidElement sharedElementIndicator;
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
// TODO. if the file already exists, do not upload
FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME, fileListViewAfterUploadFile, driver, common);
assertTrue(sharedElementIndicator.isDisplayed());
Actions.unshareLinkElement(FILE_NAME, fileListViewAfterUploadFile, driver, common);
assertFalse(sharedElementIndicator.isDisplayed());
}
use of com.owncloud.android.test.ui.models.FileListView 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
}
Aggregations