Exemple #1
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");
  }
Exemple #2
0
  @Test(dataProvider = "getAllRoles", dataProviderClass = DataProviders.class)
  public void testValidLogin(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();
  }
  // 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();
  }