Ejemplo n.º 1
0
        public void ThenClientShouldBeRedirectedToLoginPage()
        {
            LoginPage loginPage = new LoginPage();

            AssertClass.AssertElementIsPresent(loginPage.loginButton);
            DriverClass.CloseTest();
        }
Ejemplo n.º 2
0
 public void GivenUserINavigatedToApplicationUsing(string BaseURL)
 {
     try
     {
         DriverClass.StartTest(TestConfig.clientUrl);
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not load the application : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 3
0
 public void ThenUserShouldBeRedirectedToHomePage()
 {
     try
     {
         HomePage homePage = new HomePage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(homePage.linkHome);
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not verify Home: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 4
0
 public void ThenUserShouldBeAbleToValidateForgotPasswordLink()
 {
     try
     {
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(loginPage.linkForgotPassword);
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not validate : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 5
0
 public void ThenUserShouldBeAbleToSee(string userFullName)
 {
     try
     {
         HomePage homePage = new HomePage(CustomBaseClass.MyDriver);
         AssertClass.ContainsText(homePage.textUserFullName, userFullName);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not verify username: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 6
0
 public void ThenUserShouldBeRedirectedToLoginPage()
 {
     try
     {
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(loginPage.buttonLogin);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not logout : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 7
0
 public void ThenUserShouldBeAbleToLoginSuccesfully(String firstName)
 {
     try
     {
         CustomBaseClass.Thinktime(5);
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         AssertClass.AssertElementIsPresent(CustomBaseClass.MyDriver.FindElement(By.XPath("//div[contains(text(),'" + firstName + "')]")));
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not login to the application : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 8
0
 public void ThenUserShouldGetMessage(string error)
 {
     try
     {
         CustomBaseClass.Thinktime(10);
         LoginPage loginPage = new LoginPage();
         AssertClass.ContainsText(loginPage.invalidUserError, error);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Fail: Error message is incorrect: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 9
0
 public void ThenThenUserShouldGet(String errorMessage)
 {
     try
     {
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         // AssertClass.ContainsText(loginPage.errorMessage, errorMessage);
         AssertClass.AssertElementIsPresent(loginPage.errorMessage);
         DriverClass.CloseTest();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not verify error message: {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 10
0
 public void GivenUserNavigatesToApplicationLoginPage(String site)
 {
     try
     {
         DriverClass.StartTest(TestConfig.externalUrl);
         LoginPage loginPage = new LoginPage(CustomBaseClass.MyDriver);
         //Comment for Applications where default page is Login
         //loginPage.linkLogin.Click();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Failed: could not load the application : {0}", E.Message);
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 11
0
 public void ThenClientShouldBeAbleToLoginSuccessfully()
 {
     try
     {
         LoginPage loginPage = new LoginPage();
         AssertClass.AssertElementIsPresent(loginPage.signOutButton);
         CustomBaseClass.Thinktime(5);
         //LoginPage loginPage = new LoginPage();
         // loginPage.NavigateToAgileBooks();
         //loginPage.linkBooks.Click();
     }
     catch (Exception E)
     {
         Console.WriteLine("Test Fail: did not landed to Welcome Page  : {0}", E.Message);
         ScreenShotsClass.FailedTestCaptureScreenShot("Login");
         DriverClass.CloseTest();
         throw;
     }
 }
Ejemplo n.º 12
0
 public void ThenTestCompletedSuccesfully()
 {
     DriverClass.CloseTest();
 }