Click on an element specified by a locator string.

Hierarchy

  • Action
    • Click

Properties

Methods - Factory

Methods - Other

Methods - called internally

Properties

abilityAlias?: string
callStack?: CallStackInfo[]

Methods - Factory

  • specify which point should be clicked at

    Parameters

    • point: {
          x: number;
          y: number;
      }

      the point representing the coordinates.

      • x: number
      • y: number
    • Optional options: ClickActionOptions

      (optional) options for the click action.

    Returns Click

    new Click instance

    Example

    simple call with just point

    Click.at(
    { x: 100, y: 200 }
    );

    with options

    Click.at(
    { x: 100, y: 200 },
    { timeout: 3000 }
    );
  • specify which element should be clicked on

    Parameters

    • locator: Locator

      the string representing the locator.

    • Optional options: ClickActionOptions

      (optional) options for the click action.

    Returns Click

    new Click instance

    Example

    simple call with just locator

    Click.on(
    page.locator('myLocator')
    );

    with options

    Click.on(
    page.locator('myLocator'),
    { timeout: 3000 }
    );

Methods - Other

  • Parameters

    • entry: CallStackInfo

    Returns void

  • Parameters

    • calledWith: CallStackCalledWith

    Returns void

  • Set the alias which is used for an underlying ability

    Parameters

    • alias: undefined | string

      with which an ability was initialized

    Returns this

    current action

Methods - called internally

  • find the specified locator and click on it.

    Parameters

    • actor: Actor

      Actor performing this action

    Returns Promise<void>

    Returns after clicking the element