}
- public static void deleteAccount (FileListView fileListView) {
+ public static void deleteAccount (int accountPosition,FileListView fileListView) {
MenuList menulist = fileListView.clickOnMenuButton();
SettingsView settingView = menulist.clickOnSettingsButton();
- deleteAccount(settingView);
+ deleteAccount(accountPosition,settingView);
}
- public static void deleteAccount (SettingsView settingsView) {
- settingsView.tapOnAccountElement(1, 1000);
+ public static void deleteAccount (int accountPosition, SettingsView settingsView) {
+ settingsView.tapOnAccountElement(accountPosition,1, 1000);
settingsView.clickOnDeleteAccountElement();
}
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}
- public void tapOnAccountElement (int fingers, int milliSeconds) {
- accountElement.tap(fingers, milliSeconds);
+ public void tapOnAccountElement (int accountPosition, int fingers, int milliSeconds) {
+ if(accountPosition==1)
+ accountElement.tap(fingers, milliSeconds);
+ else
+ accountElement2.tap(fingers, milliSeconds);
}
-
public void tapOnAddAccount (int fingers, int milliSeconds) {
addAccountElement.tap(fingers, milliSeconds);
}
PassCodeView passcodeview = new PassCodeView(driver);
return passcodeview;
}
-
+
public PassCodeView DisablePassCode(){
if(passcodeCheckbox.isSelected()){
passcodeCheckbox.click();
common.assertIsInFileListView();
}
+ @Test
+ @Category({NoIgnoreTestCategory.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());
+ }
+
+
@Test
@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
}
@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());
+ }
+
+ @Test
@Category({NoIgnoreTestCategory.class})
public void test4ExistingAccountRotate () throws Exception {
driver.rotate(ScreenOrientation.PORTRAIT);
common.assertIsInFileListView();
MenuList menu = fileListView.clickOnMenuButton();
SettingsView settingsView = menu.clickOnSettingsButton();
- settingsView.tapOnAccountElement(1, 1000);
+ settingsView.tapOnAccountElement(1,1, 1000);
LoginForm changePasswordForm = settingsView
.clickOnChangePasswordElement();
changePasswordForm.typePassword("WrongPassword");