Package pages
Class ShoppingCartPage
java.lang.Object
pages.ShoppingCartPage
Page Object Class for shopping cart Page
- Author:
- Nayeem John
-
Constructor Summary
ConstructorsConstructorDescriptionShoppingCartPage
(com.microsoft.playwright.Page page, com.aventstack.extentreports.ExtentTest extentTest) Constructor to initialize the page objects with thePage
instance andExtentTest
instance -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkoutCart
(boolean isUserLoggedIn) Method to checkout the cart with the product itemsboolean
checkProductInCart
(List<String> products) Method to verify the product added to cart is available in cart
-
Constructor Details
-
ShoppingCartPage
public ShoppingCartPage(com.microsoft.playwright.Page page, com.aventstack.extentreports.ExtentTest extentTest) Constructor to initialize the page objects with thePage
instance andExtentTest
instance- Parameters:
page
- -Page
extentTest
- -ExtentTest
-
-
Method Details
-
checkProductInCart
Method to verify the product added to cart is available in cart -
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
-