Class ClickIfPresent

java.lang.Object
jp.co.moneyforward.autotest.actions.web.ClickBase
jp.co.moneyforward.autotest.actions.web.ClickIfPresent
All Implemented Interfaces:
Act<com.microsoft.playwright.Page, com.microsoft.playwright.Page>

public class ClickIfPresent extends ClickBase

A class that represents an act, where:

  • Click a specified element exists in a page if it exists.
  • Otherwise, does nothing.

Check for presence is done by Locator#isVisible.

  • Constructor Details

    • ClickIfPresent

      public ClickIfPresent(Function<com.microsoft.playwright.Page, com.microsoft.playwright.Locator> locatorFunction)
      Creates an object of this class.
      Parameters:
      locatorFunction - A function to locate an element to be clicked by this object on perform method's call.
  • Method Details

    • perform

      public com.microsoft.playwright.Page perform(com.microsoft.playwright.Page value, ExecutionEnvironment executionEnvironment)
      Description copied from interface: Act
      Applies this function the given argument: value(T) and returns the result (R).
      Parameters:
      value - An argument value.
      executionEnvironment - An environment in which this function is executed.
      Returns:
      the function result.