Object representing a context menu

Hierarchy (view full)

Properties

contextView$: ChainablePromiseElement<Element>
contextView$$: ChainablePromiseArray<Element[]>
elem$: ChainablePromiseElement<Element>
elem$$: ChainablePromiseArray<Element[]>
itemConstructor$: ((...args) => ChainablePromiseElement<Element>)

Type declaration

    • (...args): ChainablePromiseElement<Element>
    • Parameters

      • Rest ...args: [label: string]

      Returns ChainablePromiseElement<Element>

itemConstructor$$: ((...args) => ChainablePromiseArray<Element[]>)

Type declaration

    • (...args): ChainablePromiseArray<Element[]>
    • Parameters

      • Rest ...args: [label: string]

      Returns ChainablePromiseArray<Element[]>

itemElement$: ChainablePromiseElement<Element>
itemElement$$: ChainablePromiseArray<Element[]>
itemLabel$: ChainablePromiseElement<Element>
itemLabel$$: ChainablePromiseArray<Element[]>
itemNesting$: ChainablePromiseElement<Element>
itemNesting$$: ChainablePromiseArray<Element[]>
itemText$: ChainablePromiseElement<Element>
itemText$$: ChainablePromiseArray<Element[]>
viewBlock$: ChainablePromiseElement<Element>
viewBlock$$: ChainablePromiseArray<Element[]>

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

  • Get context menu item by name

    Parameters

    • name: string

      name of the item to search by

    Returns Promise<undefined | MenuItem<{
        contextView: string;
        elem: string;
        itemConstructor: ((label) => string);
        itemElement: string;
        itemLabel: string;
        itemNesting: string;
        itemText: string;
        viewBlock: string;
    }>>

    Promise resolving to ContextMenuItem object

  • 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<ContextMenu>

    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<{
        contextView: string;
        elem: string;
        itemConstructor: ((label) => string);
        itemElement: string;
        itemLabel: string;
        itemNesting: string;
        itemText: string;
        viewBlock: string;
    }>>

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

Generated using TypeDoc