Ejemplo n.º 1
0
 @Test
 public void testEmptyLogin() {
   homePage = new HomePage(driver);
   homePage.clickSubmitButton();
   loggingAssert.assertTrue(
       homePage.isElementDisplayed(HomePageLocators.LOGIN_ERROR_MESSAGE),
       "Error message displayed");
 }
Ejemplo n.º 2
0
  @Test(dataProvider = "getInvalidUsers", dataProviderClass = DataProviders.class)
  public void testInvalidLogin(final String login, final String password) {
    homePage = new HomePage(driver);
    homePage.logIn(login, password);

    loggingAssert.assertTrue(
        homePage.isElementDisplayed(HomePageLocators.LOGIN_ERROR_MESSAGE),
        "Error message displayed");
  }
Ejemplo n.º 3
0
  @Test(dataProvider = "getAllRoles", dataProviderClass = DataProviders.class)
  public void testLogOut(final User user) {
    homePage = new HomePage(driver);
    userInfoPage = homePage.logIn(user.getLogin(), user.getPassword());

    loggingAssert.assertTrue(
        userInfoPage
            .getElementText(UserInfoPageLocators.USER_ROLE_LABEL)
            .equals(Roles.getRoleName(user.getRoleReference())),
        "User roles match");
    userInfoPage.clickLogOutButton();
    loggingAssert.assertTrue(
        homePage.isElementDisplayed(HomePageLocators.LOGIN_USER_INPUT), "User logged out");
  }
  // test fail expected, "Delete" button is not working properly.
  @Test(dataProvider = "getCustomers", dataProviderClass = DataProviders.class)
  public void testOrderDeleting(final User user) {

    final HomePage homePage = new HomePage(driver);
    final UserInfoPage userInfoPage = homePage.logIn(user.getLogin(), user.getPassword());
    final OrderingPage orderingPage = userInfoPage.clickOrderingTab();
    final String orderName = orderingPage.getFirstOrderName();

    orderingPage
        .fillSearchField(DBUtility.getOrderNameByCustomer(user))
        .clickApplyButton()
        .clickDeleteOrder();

    loggingAssert.assertNotEquals(orderName, orderingPage.getFirstOrderName(), "Order is deleted");

    userInfoPage.clickOrderingTab();
  }