public static bool VerifyAllButtons(AutomationAgent agent, out string message) { message = string.Empty; bool status = true; if (!agent.IsElementFound(DashboardPage.MakePaymentBtnLabel)) { message = DashboardPage.MakePaymentBtnLabel.ControlName + " Does not exist \n"; status = false; } if (!agent.IsElementFound(DashboardPage.MortgageRequestBtnLabel)) { message = DashboardPage.MortgageRequestBtnLabel.ControlName + " Does not exist \n"; status = false; } if (!agent.IsElementFound(DashboardPage.ExpenseReportBtnLabel)) { message = DashboardPage.ExpenseReportBtnLabel.ControlName + " Does not exist \n"; status = false; } if (!agent.IsElementFound(DashboardPage.LogoutBtnLabel)) { message = DashboardPage.LogoutBtnLabel.ControlName + " Does not exist \n"; status = false; } return status; }
public static bool VerifyAllDefaultControls(AutomationAgent agent, out string message) { message = string.Empty; bool status = true; foreach(Control control in DashboardPage.DefaultControls) { if (!agent.IsElementFound(control)) { message = control.ControlName + " Does not exist \n"; status = false; } } return status; }
public void VerifySuccessfulLogin() { using (loginAutomationAgent = new AutomationAgent("ID:1 - Verifying successful Login with strings")) { try { LoginActions.Login(loginAutomationAgent, "company", "company"); DashboardActions.ClickLogout(loginAutomationAgent); } catch (Exception ex) { loginAutomationAgent.Sleep(2000); loginAutomationAgent.AddSteptoSeeTestReport(ex.Message, false); loginAutomationAgent.ApplicationClose(); loginAutomationAgent.GenerateReportAndReleaseClient(); throw; } } }
public void VerifyLoginObject() { using (loginAutomationAgent = new AutomationAgent("ID:2 - Verifying successful Login with Login Object")) { try { LoginActions.Login(loginAutomationAgent, Login.GetLogin("DefaultUser")); DashboardActions.ClickLogout(loginAutomationAgent); } catch (Exception ex) { loginAutomationAgent.Sleep(2000); loginAutomationAgent.AddSteptoSeeTestReport(ex.Message, false); loginAutomationAgent.ApplicationClose(); loginAutomationAgent.GenerateReportAndReleaseClient(); throw; } } }
public static bool VerifyLogo(AutomationAgent agent) { return agent.IsElementFound(DashboardPage.EriBankLogo); }
public static string GetBalance(AutomationAgent agent) { string fullLabel = agent.GetElementText(DashboardPage.BalanceLabel); string balance = fullLabel.Substring(fullLabel.IndexOf(':') + 1); return balance.Trim(); }
public static void ClickMortgageRequest(AutomationAgent agent) { agent.Click(DashboardPage.MortgageRequestBtnLabel); }
public static void ClickMakePayment(AutomationAgent agent) { agent.Click(DashboardPage.MakePaymentBtnLabel); }
public static void ClickLogout(AutomationAgent agent) { agent.Click(DashboardPage.LogoutBtnLabel); }
public static void ClickExpenseReport(AutomationAgent agent) { agent.Click(DashboardPage.ExpenseReportBtnLabel); }
public static void SetUsername(AutomationAgent agent, string username) { agent.SetText(LoginPage.UserNameTextbox, username); }
public static void SetPassword(AutomationAgent agent, string password) { agent.SetText(LoginPage.PasswordTextbox, password); }
public static void Login(AutomationAgent agent, Login login) { SetUsername(agent, login.UserName); SetPassword(agent, login.Password); ClickLogin(agent); }
public static void Login(AutomationAgent agent, string username, string password) { SetUsername(agent, username); SetPassword(agent, password); ClickLogin(agent); }
public static void ClickLogin(AutomationAgent agent) { agent.Click(LoginPage.LoginButton); }