Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IPageElementMapIdentifier<K>

Describes the identifier property of the opts parameter passed to PageElementMap's constructor function.

It provides a mappingObject and a mappingFunc which are used to constrain the "base" XPath selector of PageElementMap using XPath modification functions in order to statically identify a PageElementMap's managed PageElements when the PageElementMap is initially created.

template

K the key names of mappingObject's properties

Type parameters

  • K: string

Hierarchy

  • IPageElementMapIdentifier

Index

Properties

mappingFunc

mappingFunc: function

mappingFunc constrains the XPath baseSelector of a PageElementMap by invoking XPath modification functions with a mappingValue taken from the property values of mappingObject.

example

// returns '//nav/a[.="Dashboard"]' for {baseSelector: "//nav/a", mappingValue: "Dashboard"} ( baseSelector, mappingValue ) => xpath( baseSelector ).text( mappingValue )

param

the XPath "base" selector of a PageElementMap

param

a property value taken from the mappingObject of IPageElementMapIdentifier

returns

the constrained XPath expression

Type declaration

    • (baseSelector: string, mappingValue: string): XPathBuilder | string
    • Parameters

      • baseSelector: string
      • mappingValue: string

      Returns XPathBuilder | string

mappingObject

mappingObject: Record<K, string>

An object which provides the key names used to access PageElements via PageElementMap's $ accessor and the values passed to XPath modification functions in order to constrain the map's "base" XPath selector.

Generated using TypeDoc