Package pages

Class ProductPage

java.lang.Object
pages.ProductPage

public class ProductPage extends Object
Page Object Class for Product Page
Author:
Nayeem John
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProductPage(com.microsoft.playwright.Page page, com.aventstack.extentreports.ExtentTest extentTest)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Method to sort the products by price from UI and verify the sorting from code Using playwright selectOption to select drop down.
    boolean
    shareProductToSocialPlatform(String socialPlatformName, int retryAttempt)
    Method to share the product to the social platform and verify the share count is incremented
    void
    viewProduct(String productName)
    Method to click and view the product item from product list

    Methods inherited from class java.lang.Object

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

    • ProductPage

      public ProductPage(com.microsoft.playwright.Page page, com.aventstack.extentreports.ExtentTest extentTest)
  • Method Details

    • checkProductSortedByPrice

      public boolean checkProductSortedByPrice()
      Method to sort the products by price from UI and verify the sorting from code Using playwright selectOption to select drop down. The value from drop down is selected based on elementHandle of text locator
      Returns:
      boolean - Returns the verification of result of sorting - Boolean
    • viewProduct

      public void viewProduct(String productName)
      Method to click and view the product item from product list
      Parameters:
      productName - - String
    • shareProductToSocialPlatform

      public boolean shareProductToSocialPlatform(String socialPlatformName, int retryAttempt)
      Method to share the product to the social platform and verify the share count is incremented
      Parameters:
      socialPlatformName - - String
      Returns:
      - Returns true of product share count is incremented else false