Search in sources :

Example 1 with SettingsView

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

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)

Example 2 with SettingsView

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

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)

Example 3 with SettingsView

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

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 4 with SettingsView

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

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 5 with SettingsView

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

the class Actions method deleteAccount.

public static void deleteAccount(int accountPosition, FileListView fileListView) {
    MenuList menulist = fileListView.clickOnMenuButton();
    SettingsView settingView = menulist.clickOnSettingsButton();
    deleteAccount(accountPosition, settingView);
}
Also used : MenuList(com.owncloud.android.test.ui.models.MenuList) SettingsView(com.owncloud.android.test.ui.models.SettingsView)

Aggregations

MenuList (com.owncloud.android.test.ui.models.MenuList)7 SettingsView (com.owncloud.android.test.ui.models.SettingsView)7 FileListView (com.owncloud.android.test.ui.models.FileListView)6 Test (org.junit.Test)6 Category (org.junit.experimental.categories.Category)6 LoginForm (com.owncloud.android.test.ui.models.LoginForm)3 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)2 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)1 PassCodeRequestView (com.owncloud.android.test.ui.models.PassCodeRequestView)1 PassCodeView (com.owncloud.android.test.ui.models.PassCodeView)1