use of com.owncloud.android.test.ui.models.LoginForm in project android by owncloud.
the class Actions method login.
public static FileListView login(String url, String user, String password, Boolean isTrusted, AndroidDriver driver) throws InterruptedException {
LoginForm loginForm = new LoginForm(driver);
CertificatePopUp certificatePopUp = loginForm.typeHostUrl(url);
if (!isTrusted) {
WebDriverWait wait = new WebDriverWait(driver, 30);
//and it doesn't appear again
try {
wait.until(ExpectedConditions.visibilityOf(certificatePopUp.getOkButtonElement()));
//we need to repaint the screen
//because of some element are misplaced
driver.rotate(ScreenOrientation.LANDSCAPE);
driver.rotate(ScreenOrientation.PORTRAIT);
certificatePopUp.clickOnOkButton();
} catch (NoSuchElementException e) {
}
}
loginForm.typeUserName(user);
loginForm.typePassword(password);
//TODO. Assert related to check the connection?
return loginForm.clickOnConnectButton();
}
use of com.owncloud.android.test.ui.models.LoginForm 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()));
}
use of com.owncloud.android.test.ui.models.LoginForm 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()));
}
use of com.owncloud.android.test.ui.models.LoginForm in project android by nextcloud.
the class Actions method login.
public static FileListView login(String url, String user, String password, Boolean isTrusted, AndroidDriver driver) throws InterruptedException {
LoginForm loginForm = new LoginForm(driver);
CertificatePopUp certificatePopUp = loginForm.typeHostUrl(url);
if (!isTrusted) {
WebDriverWait wait = new WebDriverWait(driver, 30);
// and it doesn't appear again
try {
wait.until(ExpectedConditions.visibilityOf(certificatePopUp.getOkButtonElement()));
// we need to repaint the screen
// because of some element are misplaced
driver.rotate(ScreenOrientation.LANDSCAPE);
driver.rotate(ScreenOrientation.PORTRAIT);
certificatePopUp.clickOnOkButton();
} catch (NoSuchElementException e) {
}
}
loginForm.typeUserName(user);
loginForm.typePassword(password);
// TODO. Assert related to check the connection?
return loginForm.clickOnConnectButton();
}
use of com.owncloud.android.test.ui.models.LoginForm 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()));
}
Aggregations