Package pages
Class HomePage
java.lang.Object
pages.HomePage
Page Object Class for Home Page
- Author:
- Nayeem John
-
Constructor Summary
ConstructorsConstructorDescriptionHomePage
(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 TypeMethodDescriptionMethod to add a product to the cart.Method to retrieve the Home Page titleMethod to navigate from Homepage to Login pagenavigateToProductsFromMenu
(String productOption) Method to navigate to specific products menu from HomepageMethod to navigate from Homepage to Shopping cart pageboolean
searchProduct
(String productName) Method to search item in the portal for productName
-
Constructor Details
-
HomePage
public HomePage(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
-
getHomePageTitle
Method to retrieve the Home Page title- Returns:
- String - Returns page title
-
searchProduct
Method to search item in the portal for productName- Parameters:
productName
- - Name of the product to search- Returns:
- boolean - Returns true if search found results else false
-
addProductToCart
Method to add a product to the cart. Product will be added to cart and screenshot is taken- Returns:
- String - Returns actual product catalog name
-