Focus on an element specified by a locator string.

Hierarchy

  • Action
    • Focus

Properties

Methods - Factory

Methods - Other

Methods - called internally

Properties

abilityAlias?: string
callStack?: CallStackInfo[]

Methods - Factory

  • specify which element should be focused on

    Parameters

    • locator: Locator

      the string representing the locator.

    • Optional options: {
          timeout?: number;
      }

      (optional) options for the focus action.

      • Optional timeout?: number

    Returns Focus

    new Focus 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 focusing the element

Generated using TypeDoc