Search in sources :

Example 26 with FileListView

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

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());
}
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 27 with FileListView

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

the class LoginTestSuite method test4ExistingAccountRotate.

@Test
@Category({ NoIgnoreTestCategory.class })
public void test4ExistingAccountRotate() throws Exception {
    driver.rotate(ScreenOrientation.PORTRAIT);
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    driver.rotate(ScreenOrientation.LANDSCAPE);
    MenuList menu = fileListView.clickOnMenuButton();
    SettingsView settingsView = menu.clickOnSettingsButton();
    settingsView.tapOnAddAccount(1, 1000);
    LoginForm loginForm = new LoginForm(driver);
    fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    assertTrue(common.waitForTextPresent("An account for the same user and" + " server already exists in the device", loginForm.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)

Example 28 with FileListView

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

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());
}
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) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 29 with FileListView

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

the class MoveFileTestSuite method testMoveFile.

@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testMoveFile() throws Exception {
    WaitAMomentPopUp waitAMomentPopUp;
    FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
    common.assertIsInFileListView();
    // Common.waitTillElementIsNotPresentWithoutTimeout(
    // fileListView.getProgressCircular(), 1000);
    // check if the folder already exists and if true, delete them
    Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
    Actions.deleteElement(FILE_NAME, fileListView, driver);
    // Create the folder where the other is gone to be moved
    waitAMomentPopUp = Actions.createFolder(FOLDER_WHERE_MOVE, fileListView);
    Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
    fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE);
    assertTrue(fileListView.getFileElement().isDisplayed());
    FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
    fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
    assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
    // select to move the file
    ElementMenuOptions menuOptions = fileListView.longPressOnElement(FILE_NAME);
    MoveView moveView = menuOptions.clickOnMove();
    // to move to a folder
    moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1, 1);
    waitAMomentPopUp = moveView.clickOnChoose();
    Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
    // check that the folder moved is inside the other
    fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1, 1);
    Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
    Thread.sleep(1000);
    fileListView.scrollTillFindElement(FILE_NAME);
    assertEquals(FILE_NAME, fileListView.getFileElement().getText());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) MoveView(com.owncloud.android.test.ui.models.MoveView) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) 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 30 with FileListView

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

the class PasscodeTestSuite method testPincodeEnable.

@Test
@Category({ NoIgnoreTestCategory.class })
public void testPincodeEnable() 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();
    PassCodeView passCodeview = settingsView.EnablePassCode();
    PassCodeView passCodeview2 = passCodeview.enterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
    passCodeview2.reenterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
    driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
    // TO DO. Open the app instead of start an activity
    driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
    // here we check that we are not in the fileDisplayActivity,
    // because pincode is asked
    common.assertIsNotInFileListView();
    common.assertIsPasscodeRequestView();
    PassCodeRequestView passCodeReequestView = new PassCodeRequestView(driver);
    passCodeReequestView.enterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
    common.assertIsInFileListView();
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) MenuList(com.owncloud.android.test.ui.models.MenuList) PassCodeView(com.owncloud.android.test.ui.models.PassCodeView) PassCodeRequestView(com.owncloud.android.test.ui.models.PassCodeRequestView) SettingsView(com.owncloud.android.test.ui.models.SettingsView) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) 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