Exemplo n.º 1
0
  @Test(groups = {"CSR"})
  public void testCSRInvalidSearch() {
    checkOutPage.purchasedCart(cardType, false);
    orderNum = confirmPage.getOrderNum();
    csrLoginPage.logIn(orderNum);

    // Validating error message for invalid email
    csrSearchPage.emailTextField.sendKeys("*****@*****.**");
    csrSearchPage.searchBtn.click();
    Assert.assertTrue(
        csrSearchPage.errorMsg(StringValidation.noResultsFoundErrorMsg).isDisplayed(),
        StringValidation.noResultsFoundErrorMsg + " is not present ");
    csrSearchPage.emailTextField.clear();

    // validating error message for invalid email input with special characters
    csrSearchPage.emailTextField.sendKeys("#@#$%%");
    csrSearchPage.searchBtn.click();
    Assert.assertTrue(
        csrSearchPage.errorMsg(StringValidation.invalidEmailErrorMsg).isDisplayed(),
        StringValidation.invalidEmailErrorMsg + " is not present ");
    csrSearchPage.emailTextField.clear();

    // validating error message for invalid Order Num
    csrSearchPage.orderNumTextField.sendKeys("232323aaaa");
    csrSearchPage.searchBtn.click();
    Assert.assertTrue(
        csrSearchPage.errorMsg(StringValidation.orderNotFoundErrorMsg).isDisplayed(),
        StringValidation.orderNotFoundErrorMsg + " is not present ");
    csrSearchPage.orderNumTextField.clear();
  }
Exemplo n.º 2
0
  @Test(groups = {"Checkout", "CC", "Acquisition", "Payments"})
  public void verifyAcqCheckoutWithJCB() {
    Assert.assertTrue(
        driver.getCurrentUrl().contains("/estore/checkOut"),
        "User is not landing to acquisition page");
    checkOutPage.fillLoginData();
    Assert.assertTrue(
        checkOutPage.welcomeUserText.isDisplayed(), "Welcome user head is not present");
    checkOutPage.fillBillingPaymentInfo(cardType, false, false);
    Assert.assertTrue(checkOutPage.jcbIcon.isDisplayed(), cardType + " Icon is not present");
    Assert.assertTrue(
        checkOutPage.miniPaymentImg(cardType).isDisplayed(),
        cardType + " img in mini cart is not present");
    checkOutPage.nextBtn.click();
    sleep(5000);
    Assert.assertTrue(
        checkOutPage.paymentName(cardType).isDisplayed(),
        cardType + " payment method is not present");
    Assert.assertEquals(
        "Agree and Place Your Order",
        checkOutPage.confirmSubmitBtn.getAttribute("value"),
        "Agree and Place Your Order btn is not present");
    checkOutPage.waitAndClick(checkOutPage.confirmSubmitBtn);
    waitForPageToLoad();
    Assert.assertTrue(
        confirmPage.pageKey.isDisplayed(),
        "User is not landing to confirm order online page : wrong page key ");
    Assert.assertTrue(
        driver.getCurrentUrl().contains("confirmationOrderOnline"),
        "User is not landing to confirm order online page");
    orderNumber = confirmPage.getOrderNum();

    // Login to CSR
    csrSignInPage.logIn(orderNumber);
    csrSearchPage.orderNumTextField.sendKeys(orderNumber);
    csrSearchPage.searchBtn.click();
    Assert.assertTrue(
        viewOrderPage.orderNum(orderNumber).isDisplayed(),
        "View Order : " + orderNumber + " is not in search list");
    Assert.assertTrue(
        viewOrderPage.orderStatus("CLOSED").isDisplayed(),
        "View Order : order status is not CLOSED");
    Assert.assertTrue(
        viewOrderPage.orderSubState("EMPTY").isDisplayed(),
        "View Order : order sub-state is not EMPTY");
  }