Package pages

Class ShoppingCartPage

java.lang.Object
pages.ShoppingCartPage

public class ShoppingCartPage extends Object
Page Object Class for shopping cart Page
Author:
Nayeem John
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShoppingCartPage(com.microsoft.playwright.Page page, com.aventstack.extentreports.ExtentTest extentTest)
    Constructor to initialize the page objects with the Page instance and ExtentTest instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkoutCart(boolean isUserLoggedIn)
    Method to checkout the cart with the product items
    boolean
    Method to verify the product added to cart is available in cart

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShoppingCartPage

      public ShoppingCartPage(com.microsoft.playwright.Page page, com.aventstack.extentreports.ExtentTest extentTest)
      Constructor to initialize the page objects with the Page instance and ExtentTest instance
      Parameters:
      page - - Page
      extentTest - - ExtentTest
  • Method Details

    • checkProductInCart

      public boolean checkProductInCart(List<String> products)
      Method to verify the product added to cart is available in cart
      Parameters:
      products - - List<String> Of products to verify
      Returns:
      boolean - Returns true if all products is available in cart else false if any one product is not available
    • checkoutCart

      public boolean checkoutCart(boolean isUserLoggedIn)
      Method to checkout the cart with the product items
      Parameters:
      isUserLoggedIn - - Boolean - User Login state
      Returns:
      boolean - Returns true if checkout was successful else @throws TimeoutError Exception