コード例 #1
0
 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;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
         }
     }
 }
コード例 #4
0
 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;
         }
     }
 }
コード例 #5
0
 public static bool VerifyLogo(AutomationAgent agent)
 {
     return agent.IsElementFound(DashboardPage.EriBankLogo);
 }
コード例 #6
0
 public static string GetBalance(AutomationAgent agent)
 {
     string fullLabel = agent.GetElementText(DashboardPage.BalanceLabel);
     string balance = fullLabel.Substring(fullLabel.IndexOf(':') + 1);
     return balance.Trim();
 }
コード例 #7
0
 public static void ClickMortgageRequest(AutomationAgent agent)
 {
     agent.Click(DashboardPage.MortgageRequestBtnLabel);
 }
コード例 #8
0
 public static void ClickMakePayment(AutomationAgent agent)
 {
     agent.Click(DashboardPage.MakePaymentBtnLabel);
 }
コード例 #9
0
 public static void ClickLogout(AutomationAgent agent)
 {
     agent.Click(DashboardPage.LogoutBtnLabel);
 }
コード例 #10
0
 public static void ClickExpenseReport(AutomationAgent agent)
 {
     agent.Click(DashboardPage.ExpenseReportBtnLabel);
 }
コード例 #11
0
 public static void SetUsername(AutomationAgent agent, string username)
 {
     agent.SetText(LoginPage.UserNameTextbox, username);
 }
コード例 #12
0
 public static void SetPassword(AutomationAgent agent, string password)
 {
     agent.SetText(LoginPage.PasswordTextbox, password);
 }
コード例 #13
0
 public static void Login(AutomationAgent agent, Login login)
 {
     SetUsername(agent, login.UserName);
     SetPassword(agent, login.Password);
     ClickLogin(agent);
 }
コード例 #14
0
 public static void Login(AutomationAgent agent, string username, string password)
 {
     SetUsername(agent, username);
     SetPassword(agent, password);
     ClickLogin(agent);
 }
コード例 #15
0
 public static void ClickLogin(AutomationAgent agent)
 {
     agent.Click(LoginPage.LoginButton);
 }