use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
the class UploadTestSuite method testUploadBigFile.
@Test
@Category({ UnfinishedTestCategory.class })
public void testUploadBigFile() 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(BIG_FILE_NAME, fileListView, driver);
FileListView fileListViewAfterUploadFile = Actions.uploadFile(BIG_FILE_NAME, fileListView);
driver.openNotifications();
NotificationView notificationView = new NotificationView(driver);
try {
if (notificationView.getUploadingNotification().isDisplayed()) {
Common.waitTillElementIsPresent(notificationView.getUploadSucceededNotification(), 300000);
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
}
} catch (NoSuchElementException e) {
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
}
fileListViewAfterUploadFile.scrollTillFindElement(BIG_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(BIG_FILE_NAME);
assertTrue(fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
the class CreateFolderTestSuite method testCreateNewFolder.
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testCreateNewFolder() throws Exception {
String NEW_FOLDER_NAME = "testCreateFolder";
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
//check if the folder already exists and if true, delete them
Actions.deleteElement(NEW_FOLDER_NAME, fileListView, driver);
WaitAMomentPopUp waitAMomentPopUp = Actions.createFolder(NEW_FOLDER_NAME, fileListView);
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
fileListView.scrollTillFindElement(FOLDER_NAME);
assertNotNull(fileListView.getFileElement());
assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
CurrentCreatedFolder = FOLDER_NAME;
assertEquals(FOLDER_NAME, fileListView.getFileElement().getText());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
the class DeleteFolderTestSuite method tearDown.
@After
public void tearDown() throws Exception {
common.takeScreenShotOnFailed(name.getMethodName());
if (folderHasBeenCreated) {
FileListView fileListView = new FileListView(driver);
Actions.deleteElement(FOLDER_NAME, fileListView, driver);
}
driver.removeApp("com.owncloud.android");
driver.quit();
}
use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
the class LoginTestSuite method testMultiAccountAndShowFiles.
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testMultiAccountAndShowFiles() throws Exception {
driver.rotate(ScreenOrientation.LANDSCAPE);
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1);
assertTrue(fileListView.getFileElement().isDisplayed());
driver.rotate(ScreenOrientation.PORTRAIT);
MenuList menu = fileListView.clickOnMenuButton();
SettingsView settingsView = menu.clickOnSettingsButton();
settingsView.tapOnAddAccount(1, 1000);
fileListView = Actions.login(Config.URL2, Config.user2, Config.password2, Config.isTrusted2, driver);
common.assertIsInSettingsView();
settingsView.tapOnAccountElement(2, 1, 100);
common.assertIsInFileListView();
fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer2);
assertTrue(fileListView.getFileElement().isDisplayed());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
the class LogoutTestSuite method testLogout.
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testLogout() throws Exception {
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
MenuList menulist = fileListView.clickOnMenuButton();
SettingsView settingsView = menulist.clickOnSettingsButton();
settingsView.tapOnAccountElement(1, 1, 1000);
LoginForm loginForm = settingsView.clickOnDeleteAccountElement();
assertEquals("Server address https://…", loginForm.gethostUrlInput().getText());
assertEquals("Username", loginForm.getUserNameInput().getText());
assertEquals("", loginForm.getPasswordInput().getText());
}
Aggregations