// Select 10 servers public ShoppingCartPage selectAllServersShareBackup(WebDriver driver) { // WaitTool.isElementPresentAndDisplay(driver, sharedBackupLabel); sharedBackupDropDown.click(); input100GBradioButton.click(); Constants.setTotalMes((PageUtils.getTotal(price100GBLabel) * 10) + Constants.TOTALMES); selectServersButton.click(); WaitTool.waitForElementPresentAndVisible(driver, checkAllservers); checkAllservers.click(); WebElement element = driver.findElement(By.xpath("//button[@class='action--click--add btn btn--large']")); JavascriptExecutor executor = (JavascriptExecutor) driver; executor.executeScript("arguments[0].click();", element); return PageFactory.initElements(driver, ShoppingCartPage.class); }
public AccountPage selectOptionShareBackupAgressiveCrossSell(WebDriver driver, String space) { WaitTool.isElementPresentAndDisplay(driver, sharedBackupLabel); optionList.click(); WebElement option = driver.findElement( By.xpath("//div[@class='optionsList-item-name'][text()='" + space + " Backup']")); WebElement priceLabel = driver.findElement( By.xpath( "//div[@class='optionsList-item-name'][text()='" + space + " Backup']/../div[2]/span[1]")); Constants.setTotalMes(PageUtils.getTotal(priceLabel) + Constants.TOTALMES); option.click(); addCartButton.click(); return PageFactory.initElements(driver, AccountPage.class); }
public ShoppingCartPage clickCancel(WebDriver driver) { cancelButton.click(); return PageFactory.initElements(driver, ShoppingCartPage.class); }
public ShoppingCartPage addSharedBackupServers(WebDriver driver) { allServersCheckButtonClick(); addCartButtonClick(driver); return PageFactory.initElements(driver, ShoppingCartPage.class); }
public AccountPage goToCheckOut(WebDriver driver) { goToCheckoutLink.click(); return PageFactory.initElements(driver, AccountPage.class); }
public ShoppingCartPage clickX(WebDriver driver) { WaitTool.waitForElementPresentAndVisible(driver, xToClose); xToClose.click(); return PageFactory.initElements(driver, ShoppingCartPage.class); }