Search in sources :

Example 21 with FileListView

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

the class CreateFolderTestSuite method tearDown.

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

Example 22 with FileListView

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

the class DeleteFileTestSuite method testDeleteFile.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testDeleteFile() 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(FILE_NAME, fileListView);
    fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
    Common.waitTillElementIsNotPresentWithoutTimeout(fileListViewAfterUploadFile.getProgressCircular(), 1000);
    common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
    Actions.deleteElement(FILE_NAME, fileListViewAfterUploadFile, driver);
    assertFalse(fileListViewAfterUploadFile.getFileElement().isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) Category(org.junit.experimental.categories.Category) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 23 with FileListView

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

the class LoginTestSuite method testLoginAndShowFiles.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testLoginAndShowFiles() throws Exception {
    driver.rotate(ScreenOrientation.PORTRAIT);
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1);
    assertTrue(fileListView.getFileElement().isDisplayed());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) Category(org.junit.experimental.categories.Category) Test(org.junit.Test)

Example 24 with FileListView

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

the class LoginTestSuite method test3MultiAccountRotate.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void test3MultiAccountRotate() throws Exception {
    driver.rotate(ScreenOrientation.LANDSCAPE);
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    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();
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) MenuList(com.owncloud.android.test.ui.models.MenuList) SettingsView(com.owncloud.android.test.ui.models.SettingsView) Category(org.junit.experimental.categories.Category) Test(org.junit.Test)

Example 25 with FileListView

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

the class LoginTestSuite method test5ChangePasswordWrong.

@Test
@Category({ NoIgnoreTestCategory.class })
public void test5ChangePasswordWrong() throws Exception {
    driver.rotate(ScreenOrientation.PORTRAIT);
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    MenuList menu = fileListView.clickOnMenuButton();
    SettingsView settingsView = menu.clickOnSettingsButton();
    settingsView.tapOnAccountElement(1, 1, 1000);
    LoginForm changePasswordForm = settingsView.clickOnChangePasswordElement();
    changePasswordForm.typePassword("WrongPassword");
    changePasswordForm.clickOnConnectButton();
    assertTrue(common.waitForTextPresent("Wrong username or password", changePasswordForm.getAuthStatusText()));
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) MenuList(com.owncloud.android.test.ui.models.MenuList) LoginForm(com.owncloud.android.test.ui.models.LoginForm) SettingsView(com.owncloud.android.test.ui.models.SettingsView) Category(org.junit.experimental.categories.Category) 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