Class Menu<T>Abstract

Abstract element representing a menu

Type Parameters

  • T

Hierarchy (view full)

Accessors

  • get elem(): ChainablePromiseElement<Element>
  • Base element of given page object

    Returns ChainablePromiseElement<Element>

  • get parent(): ChainablePromiseElement<Element>
  • Parent element of given page object

    Returns ChainablePromiseElement<Element>

Methods

  • Return a menu item of a given name, undefined if not found

    Parameters

    • name: string

      name of the item to search for

    Returns Promise<undefined | MenuItem<T>>

  • Find whether the menu has an item of a given name

    Parameters

    • name: string

      name of the item to search for

    Returns Promise<boolean>

    true if menu has an item with the given name, false otherwise

  • Poll for the element to become visible

    Parameters

    • timeout: number = 10000

      custom timeout for the wait

    • interval: number = 2000

      custom interval to control polling

    Returns Promise<Menu<T>>

    thenable self reference

  • Recursively select an item with a given path.

    E.g. calling select('File', 'Preferences', 'Settings') will open the 'File' -> 'Preferences' submenus and then click on 'Settings'.

    Selection happens in order of the arguments, if one of the items in the middle of the path has no children, the consequent path arguments will be ignored.

    Parameters

    • Rest ...path: string[]

      path to the item to select, represented by a sequence of strings

    Returns Promise<undefined | Menu<T>>

    void if the last clicked item is a leaf, Menu item representing its submenu otherwise

  • Wait for the element to become visible

    Parameters

    • timeout: number = 5000

      custom timeout for the wait

    Returns Promise<Menu<T>>

    thenable self reference

Generated using TypeDoc