diff --git a/src/main/java/com/orasi/bluesource/AccountBurnDownDataReportForm.java b/src/main/java/com/orasi/bluesource/AccountBurnDownDataReportForm.java new file mode 100644 index 0000000..fc2ed45 --- /dev/null +++ b/src/main/java/com/orasi/bluesource/AccountBurnDownDataReportForm.java @@ -0,0 +1,46 @@ +package com.orasi.bluesource; + +import com.orasi.web.OrasiDriver; +import com.orasi.web.PageLoaded; +import com.orasi.web.webelements.Element; +import com.orasi.web.webelements.Listbox; +import com.orasi.web.webelements.impl.internal.ElementFactory; +import org.openqa.selenium.support.FindBy; + +public class AccountBurnDownDataReportForm { + private OrasiDriver driver = null; + + /**Page Elements**/ + @FindBy(xpath = "//input[@name='commit']") private Element elmGenerateReport; + @FindBy(xpath = "//select[@id='account_select']") private Listbox lstAccountSelect; + + /** + * Constructor + **/ + public AccountBurnDownDataReportForm(OrasiDriver driver) { + this.driver = driver; + ElementFactory.initElements(driver, this); + } + + /**Page Interactions**/ + + public boolean verifyFormLoaded(){ + return PageLoaded.isElementLoaded(this.getClass(),driver,elmGenerateReport,5) && + PageLoaded.isElementLoaded(this.getClass(),driver,lstAccountSelect,5); + } + + public void clickGenerateReport(){ + if (canInteract(elmGenerateReport)) + elmGenerateReport.click(); + } + + public void selectAccount(String strAccount){ + if (canInteract(lstAccountSelect)){ + lstAccountSelect.select(strAccount); + } + } + + private boolean canInteract(Element elm){ + return elm.syncEnabled(5) && elm.syncVisible(5); + } +} \ No newline at end of file diff --git a/src/main/java/com/orasi/bluesource/Accounts.java b/src/main/java/com/orasi/bluesource/Accounts.java index e24471f..908e017 100644 --- a/src/main/java/com/orasi/bluesource/Accounts.java +++ b/src/main/java/com/orasi/bluesource/Accounts.java @@ -1,10 +1,12 @@ package com.orasi.bluesource; import java.lang.reflect.UndeclaredThrowableException; +import java.util.ArrayList; import java.util.List; import javax.lang.model.util.Elements; +import org.bouncycastle.jce.provider.symmetric.TEA; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.NoSuchElementException; @@ -28,8 +30,7 @@ public class Accounts { private OrasiDriver driver = null; - - + /**Page Elements**/ @FindBy(xpath = "//*[@id='resource-content']/div[2]/p") private Element elmNumberPages; @FindBy(xpath = "//*[@id=\"resource-content\"]/div[1]/table/tbody") private Webtable tblAccounts; @@ -46,6 +47,10 @@ public class Accounts { @FindBy(css = "div.btn.btn-secondary.btn-xs.quick-nav") private Button btnQuickNav; @FindBy(xpath = "//a[contains(@ng-bind, 'n + 1')]") private List