@Test(groups = { "Hybrid" }, dependsOnMethods = "loginAndLogout") public void loginAs() throws Exception { cloudSyncPage = cloudSignInPage.loginAs(cloudUserName, cloudUserPassword).render(); Assert.assertTrue(cloudSyncPage.isDisconnectButtonDisplayed()); cloudSyncPage.disconnectCloudAccount().render(); DocumentLibraryPage documentLibraryPage = openSiteDocumentLibraryFromSearch(drone, siteName); cloudSignInPage = documentLibraryPage.getFileDirectoryInfo(loginTestFile.getName()).selectSyncToCloud().render(); DestinationAndAssigneePage destinationAndAssigneePage = cloudSignInPage.loginAs(cloudUserName, cloudUserPassword).render(); Assert.assertTrue(destinationAndAssigneePage.isNetworkDisplayed(cloudUserName.split("@")[1])); documentLibraryPage = (DocumentLibraryPage) destinationAndAssigneePage.selectCancelButton(); documentLibraryPage.render(); }
public HtmlPage loginAs(final String username, final String password) { WebElement usernameInput = drone.findAndWait(USERNAME_INPUT); usernameInput.clear(); usernameInput.sendKeys(username); WebElement button = drone.findAndWait(CONNECT_BUTTON); String id = button.getAttribute("id"); WebElement passwordInput = drone.findAndWait(PASSWORD_INPUT); passwordInput.clear(); passwordInput.sendKeys(password); button.submit(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForPageLoad(SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); try { if (isDisconnectButtonDisplayed()) { return new CloudSyncPage(drone); } else { return new DestinationAndAssigneePage(drone); } } catch (PageRenderTimeException pte) { throw new PageException("Neither DestinationAndAssigneePage or CloudSyncPage is returned", pte); } }
CloudSignInPage extends ShareDialogue { public HtmlPage loginAs(final String username, final String password) { WebElement usernameInput = drone.findAndWait(USERNAME_INPUT); usernameInput.clear(); usernameInput.sendKeys(username); WebElement button = drone.findAndWait(CONNECT_BUTTON); String id = button.getAttribute("id"); WebElement passwordInput = drone.findAndWait(PASSWORD_INPUT); passwordInput.clear(); passwordInput.sendKeys(password); button.submit(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForPageLoad(SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); try { if (isDisconnectButtonDisplayed()) { return new CloudSyncPage(drone); } else { return new DestinationAndAssigneePage(drone); } } catch (PageRenderTimeException pte) { throw new PageException("Neither DestinationAndAssigneePage or CloudSyncPage is returned", pte); } } }
CloudSignInPage extends ShareDialogue { public HtmlPage loginAs(final String username, final String password) { WebElement usernameInput = drone.findAndWait(USERNAME_INPUT); usernameInput.clear(); usernameInput.sendKeys(username); WebElement button = drone.findAndWait(CONNECT_BUTTON); String id = button.getAttribute("id"); WebElement passwordInput = drone.findAndWait(PASSWORD_INPUT); passwordInput.clear(); passwordInput.sendKeys(password); button.submit(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForPageLoad(SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); try { if (isDisconnectButtonDisplayed()) { return new CloudSyncPage(drone); } else { return new DestinationAndAssigneePage(drone); } } catch (PageRenderTimeException pte) { throw new PageException("Neither DestinationAndAssigneePage or CloudSyncPage is returned", pte); } } CloudSignInPage(WebDrone drone); }
CloudSignInPage extends ShareDialogue { public HtmlPage loginAs(final String username, final String password) { WebElement usernameInput = drone.findAndWait(USERNAME_INPUT); usernameInput.clear(); usernameInput.sendKeys(username); WebElement button = drone.findAndWait(CONNECT_BUTTON); String id = button.getAttribute("id"); WebElement passwordInput = drone.findAndWait(PASSWORD_INPUT); passwordInput.clear(); passwordInput.sendKeys(password); button.submit(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForPageLoad(SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); try { if (isDisconnectButtonDisplayed()) { return new CloudSyncPage(drone); } else { return new DestinationAndAssigneePage(drone); } } catch (PageRenderTimeException pte) { throw new PageException("Neither DestinationAndAssigneePage or CloudSyncPage is returned", pte); } } CloudSignInPage(WebDrone drone); @SuppressWarnings("unchecked") @Override CloudSignInPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override CloudSignInPage render(); @SuppressWarnings("unchecked") @Override CloudSignInPage render(final long time); HtmlPage loginAs(final String username, final String password); boolean isDisconnectButtonDisplayed(); void selectCancelButton(); void selectSignUpLink(); void selectFogotPassordLink(); @Override String getPageTitle(); boolean isForgotPasswordLinkDisplayed(); String getForgotPasswordURL(); }
CloudSignInPage extends ShareDialogue { public HtmlPage loginAs(final String username, final String password) { WebElement usernameInput = drone.findAndWait(USERNAME_INPUT); usernameInput.clear(); usernameInput.sendKeys(username); WebElement button = drone.findAndWait(CONNECT_BUTTON); String id = button.getAttribute("id"); WebElement passwordInput = drone.findAndWait(PASSWORD_INPUT); passwordInput.clear(); passwordInput.sendKeys(password); button.submit(); drone.waitUntilElementDisappears(By.id(id), SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); drone.waitForPageLoad(SECONDS.convert(maxPageLoadingTime, MILLISECONDS)); try { if (isDisconnectButtonDisplayed()) { return new CloudSyncPage(drone); } else { return new DestinationAndAssigneePage(drone); } } catch (PageRenderTimeException pte) { throw new PageException("Neither DestinationAndAssigneePage or CloudSyncPage is returned", pte); } } CloudSignInPage(WebDrone drone); @SuppressWarnings("unchecked") @Override CloudSignInPage render(RenderTime timer); @SuppressWarnings("unchecked") @Override CloudSignInPage render(); @SuppressWarnings("unchecked") @Override CloudSignInPage render(final long time); HtmlPage loginAs(final String username, final String password); boolean isDisconnectButtonDisplayed(); void selectCancelButton(); void selectSignUpLink(); void selectFogotPassordLink(); @Override String getPageTitle(); boolean isForgotPasswordLinkDisplayed(); String getForgotPasswordURL();  }