Class SendKey

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

public class SendKey extends Object implements Act<com.microsoft.playwright.Page, com.microsoft.playwright.Page>

A class that represents an action to send key sequence to a specified locator.

If the key sequence starts with SendKey.MASK_PREFIX, the part after it will be sent to an element specified by a locatorFunction in a given page, while the part before it (i.e., the MASK_PREFIX itselft) will be printed in the log. This feature is useful for secret strings to be sent to elements, but not to be printed such as passwords.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface jp.co.moneyforward.autotest.framework.action.Act

    Act.Func<T,R>, Act.Let<T>, Act.Sink<T>, Act.Source<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A prefix to control a
  • Constructor Summary

    Constructors
    Constructor
    Description
    SendKey(String selector, String keys)
    Creates an instance of this class.
    SendKey(Function<com.microsoft.playwright.Page, com.microsoft.playwright.Locator> locatorFunction, String keys)
    Creates an instance of this class.
    SendKey(Function<com.microsoft.playwright.Page, com.microsoft.playwright.Locator> locatorFunction, Supplier<String> keySequenceGenerator)
    Creates an instance of this class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a name of an instance of this interface.
    com.microsoft.playwright.Page
    perform(com.microsoft.playwright.Page value, ExecutionEnvironment executionEnvironment)
    Applies this function the given argument: value(T) and returns the result (R).

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface jp.co.moneyforward.autotest.framework.action.Act

    andThen, describe
  • Field Details

  • Constructor Details

    • SendKey

      public SendKey(String selector, String keys)
      Creates an instance of this class.
      Parameters:
      selector - A selector string.
      keys - Keys to be sent to a locator chosen by a selector string.
      See Also:
    • SendKey

      public SendKey(Function<com.microsoft.playwright.Page, com.microsoft.playwright.Locator> locatorFunction, String keys)
      Creates an instance of this class.
      Parameters:
      locatorFunction - A function to choose a locator from a given page.
      keys - Keys to be sent to a chosen locator.
    • SendKey

      public SendKey(Function<com.microsoft.playwright.Page, com.microsoft.playwright.Locator> locatorFunction, Supplier<String> keySequenceGenerator)
      Creates an instance of this class.
      Parameters:
      locatorFunction - A function to choose a locator from a given page.
      keySequenceGenerator - A supplier that generates a key sequence to be sent to a chosen locator.
  • 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).
      Specified by:
      perform in interface Act<com.microsoft.playwright.Page, com.microsoft.playwright.Page>
      Parameters:
      value - An argument value.
      executionEnvironment - An environment in which this function is executed.
      Returns:
      the function result.
    • name

      public String name()
      Description copied from interface: Act
      Returns a name of an instance of this interface.
      Specified by:
      name in interface Act<com.microsoft.playwright.Page, com.microsoft.playwright.Page>
      Returns:
      A name of this instance.