Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PageElementWait<Store, PageElementType>

This class defines all wait functions of PageElement.

template

Store type of the PageNodeStore instance which can be used to retrieve/create PageNodes

template

PageElementType type of the PageElement for which PageElementWait defines all wait functions

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

Protected _node

_node: PageElementType

the PageNode for which PageNodeWait defines all wait functions

Accessors

not

  • get not(): object
  • returns the negated variants of PageElementWait's state check functions

    Returns object

    • containsAttribute: function
      • Waits for the actual value of the specified HTML attribute of PageElement not to contain an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • attribute: IAttribute

          the specified HTML attribute of PageElement, consisting of the attribute's name and the value it is expected not to contain

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • containsClass: function
      • Waits for the actual value of the PageElement's 'class' HTML attribute not to contain an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • className: string

          the expected value which is supposed not to be contained in the actual value of PageElement's 'class' HTML attribute

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • containsDirectText: function
      • containsDirectText(directText: string, opts?: ITimeoutInterval): PageElementType
      • Waits for PageElement's actual direct text not to contain the expected direct text.

        Throws an error if the condition is not met within a specific timeout.

        A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.

        Parameters

        • directText: string
        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • containsHTML: function
      • Waits for PageElement's actual HTML value not to contain the expected HTML value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • html: string

          the expected html which is supposed not to be contained in the actual html

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • containsId: function
      • Waits for the actual value of PageElement's 'id' HTML attribute not to contain an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • id: string

          the expected value which is supposed not to be contained in the actual value of PageElement's HTML 'id' attribute

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • containsName: function
      • Waits for the actual value of PageElement's 'name' HTML attribute not to contain an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • name: string

          the expected value which is supposed not to be contained in the actual value of PageElement's HTML 'name' attribute

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • containsText: function
      • Waits for PageElement's actual text not to contain the expected text.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • text: string

          the expected text which is supposed not to be contained in the actual text

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • exists: function
      • exists(opts?: ITimeout): PageElementType
      • Waits for a PageElement not to exist.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeout

          includes the timeout within which the condition is expected to be met

          If no timeout is specified, PageElement's default timeout is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyAttribute: function
      • hasAnyAttribute(attributeName: string, opts?: ITimeoutInterval): PageElementType
      • Waits for the actual value of the specified HTML attribute of PageElement not to have any value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • attributeName: string

          the name of a PageElement's HTML attribute which is supposed to have any value

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyClass: function
      • Waits for PageElement's 'class' HTML attribute not to have any value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyDirectText: function
      • Waits for PageElement not to have any direct text.

        Throws an error if the condition is not met within a specific timeout.

        A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.

        Parameters

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyHTML: function
      • Waits for PageElement not to have any HTML value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyId: function
      • Waits for PageElement's 'id' HTML attribute not to have any value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyName: function
      • Waits for PageElement's 'name' HTML attribute not to have any value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAnyText: function
      • Waits for PageElement not to have any text.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasAttribute: function
      • Waits for the actual value of the specified HTML attribute of PageElement not to equal an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • attribute: IAttribute

          the specified HTML attribute of PageElement, consisting of the attribute's name and the value it is expected not to have

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasClass: function
      • Waits for the actual value of PageElement's 'class' HTML attribute not to equal an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • className: string

          the expected value which is supposed not to equal the actual value of PageElement's HTML 'class' attribute

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasDirectText: function
      • Waits for PageElement's actual direct text not to equal the expected direct text.

        Throws an error if the condition is not met within a specific timeout.

        A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.

        Parameters

        • directText: string
        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasHTML: function
      • Waits for PageElement's actual HTML value not to equal the expected HTML value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • html: string

          the expected html which is supposed not to equal the actual html

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasHeight: function
      • Waits for the height of PageElement not to equal the expected height.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • height: number

          the not-expected height of PageElement in pixels

        • Default value opts: object & ITimeoutInterval = { tolerance: 0 }

          includes the tolerance used to calculate the maximal allowed deviation from the expected height, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasId: function
      • Waits for the actual value of PageElement's 'id' HTML attribute not to equal an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • id: string

          the expected value which is supposed not to equal the actual value of PageElement's 'id' HTML attribute

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasLocation: function
      • Waits for the location of PageElement not to equal the expected coordinates.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • coordinates: ICoordinates

          the not-expected coordinates of PageElement in pixels

        • Default value opts: object & ITimeoutInterval = { tolerances: { x: 0, y: 0 } }

          includes the tolerances used to calculate the maximal allowed deviations from the expected coordinates, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasName: function
      • Waits for the actual value of PageElement's 'name' HTML attribute not to equal an expected value.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • name: string

          the expected value which is supposed not to equal the actual value of PageElement's HTML 'name' attribute

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasSize: function
      • Waits for the size of PageElement not to equal the expected size.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • size: ISize

          the not-expected size of PageElement in pixels

        • Default value opts: object & ITimeoutInterval = { tolerances: { width: 0, height: 0 } }

          includes the tolerances used to calculate the maximal allowed deviations from the expected size, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasText: function
      • Waits for PageElement's actual text not to equal the expected text.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • text: string

          the expected text which is supposed not to equal the actual text

        • Optional opts: ITimeoutInterval

          includes the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasWidth: function
      • Waits for the width of PageElement not to equal the expected width.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • width: number

          the not-expected width of PageElement in pixels

        • Default value opts: object & ITimeoutInterval = { tolerance: 0 }

          includes the tolerance used to calculate the maximal allowed deviation from the expected width, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasX: function
      • Waits for the x-location of PageElement not to equal the expected x-location.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • x: number

          the not-expected x-location of PageElement in pixels

        • Default value opts: object & ITimeoutInterval = { tolerance: 0 }

          includes the tolerance used to calculate the maximal allowed deviation from the expected x-location, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • hasY: function
      • Waits for the y-location of PageElement not to equal the expected y-location.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • y: number

          the not-expected y-location of PageElement in pixels

        • Default value opts: object & ITimeoutInterval = { tolerance: 0 }

          includes the tolerance used to calculate the maximal allowed deviation from the expected y-location, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • isChecked: function
      • Waits for PageElement not to be checked.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeoutInterval

          includes filterMask which can be used to skip the invocation of the state check function for some or all managed PageElements, the timeout within which the condition is expected to be met and the interval used to check it

          If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

        Returns PageElementType

        this (an instance of PageElement)

    • isEnabled: function
      • isEnabled(opts?: ITimeout): PageElementType
      • Waits for a PageElement not to be enabled.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeout

          includes the timeout within which the condition is expected to be met

          If no timeout is specified, PageElement's default timeout is used.

        Returns PageElementType

        this (an instance of PageElement)

    • isSelected: function
      • isSelected(opts?: ITimeout): PageElementType
      • Waits for a PageElement not to be selected.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeout

          includes the timeout within which the condition is expected to be met

          If no timeout is specified, PageElement's default timeout is used.

        Returns PageElementType

        this (an instance of PageElement)

    • isVisible: function
      • isVisible(opts?: ITimeout): PageElementType
      • Waits for a PageElement not to be visible.

        Throws an error if the condition is not met within a specific timeout.

        Parameters

        • Optional opts: ITimeout

          includes the timeout within which the condition is expected to be met

          If no timeout is specified, PageElement's default timeout is used.

        Returns PageElementType

        this (an instance of PageElement)

Methods

Protected _makeReverseParams

Protected _waitContainsProperty

  • _waitContainsProperty<T>(name: string, expectedValue: T, conditionFunc: function, opts?: ITimeoutReverseInterval): PageElementType
  • This function waits for an actual value to contain an expected value.

    It does so by regularly invoking a condition function until it returns true or until a specific timeout is reached.

    A WaitUntilTimeoutError will be thrown if the condition function's return value does not become true within the specific timeout.

    Type parameters

    • T

    Parameters

    • name: string

      the name of the property for which the wait condition is performed

    • expectedValue: T

      the expected value passed to the conditionFunc

    • conditionFunc: function

      a function which compares the actual and the expected value

        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition function is expected to become true, the interval used to invoke the condition function and a reverse flag which, if set to true, negates the result of the condition function

    Returns PageElementType

Protected _waitHasAnyProperty

  • This function waits for a property to have any value.

    It does so by regularly invoking a condition function until it returns true or until a specific timeout is reached.

    A WaitUntilTimeoutError will be thrown if the condition function's return value does not become true within the specific timeout.

    Type parameters

    • T

    Parameters

    • name: string

      the name of the property for which the wait condition is performed

    • conditionFunc: function

      a function which checks if a property has any value

        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition function is expected to become true, the interval used to invoke the condition function and a reverse flag which, if set to true, negates the result of the condition function

    Returns PageElementType

Protected _waitHasProperty

  • _waitHasProperty<T>(name: string, expectedValue: T, conditionFunc: function, opts?: ITimeoutReverseInterval): PageElementType
  • This function waits for an actual value to have/equal an expected value.

    It does so by regularly invoking a condition function until it returns true or until a specific timeout is reached.

    A WaitUntilTimeoutError will be thrown if the condition function's return value does not become true within the specific timeout.

    Type parameters

    • T

    Parameters

    • name: string

      the name of the property for which the wait condition is performed

    • expectedValue: T

      the expected value passed to the conditionFunc

    • conditionFunc: function

      a function which compares the actual and the expected value

        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition function is expected to become true, the interval used to invoke the condition function and a reverse flag which, if set to true, negates the result of the condition function

    Returns PageElementType

Protected _waitProperty

  • _waitProperty<T>(name: string, conditionType: "has" | "contains" | "any" | "within", conditionFunc: function, __namedParameters?: object, expectedValue?: T): PageElementType
  • This function can be used to assemble and execute a wait state check function to wait for the value of a certain property of an HMTL element to reach an expected state.

    It regularly invokes a condition function until it returns true or until a specific timeout is reached. If an expected value was provided, this value will be passed to the condition function as second parameter.

    A WaitUntilTimeoutError will be thrown if the condition function's return value does not become true within the specific timeout.

    Type parameters

    • T

    Parameters

    • name: string

      the name of the property for which the wait condition is performed

    • conditionType: "has" | "contains" | "any" | "within"

      the type of comparison performed in the conditionFunc

    • conditionFunc: function

      a function which compares an actual with an expected value

    • Default value __namedParameters: object = {}
      • interval: number
      • reverse: boolean
      • timeout: number
    • Optional expectedValue: T

      the expected value passed to the conditionFunc

    Returns PageElementType

Protected _waitUntil

  • _waitUntil<T>(conditionFunc: function, errorMessageFunc: function, __namedParameters?: object): PageElementType
  • This function can be used to assemble and execute a wait state check function to wait for an HMTL element to reach an expected state.

    It regularly invokes a condition function until it returns true or until a specific timeout is reached.

    A WaitUntilTimeoutError will be thrown if the condition function's return value does not become true within the specific timeout.

    Type parameters

    • T

    Parameters

    • conditionFunc: function

      a function which checks if an HTML element has an expected state

        • (): boolean
        • Returns boolean

    • errorMessageFunc: function

      a function that returns an errorMessage if the HTML element didn't reach its expected state

        • (): string
        • Returns string

    • Default value __namedParameters: object = {}
      • interval: number
      • timeout: number

    Returns PageElementType

Protected _waitWdioCheckFunc

  • _waitWdioCheckFunc(checkTypeStr: string, conditionFunc: function, __namedParameters?: object): PageElementType
  • This function wraps webdriverio commands that wait for an HTML element to reach a certain state.

    It does so by invoking a condition function which checks if a certain condition eventually becomes true within a specific timeout.

    A WaitUntilTimeoutError will be thrown and the PageElement's default timeout will be written to _lastdiff if the condition function's return value is false.

    Parameters

    • checkTypeStr: string

      describes what kind of check is performed by the condition function

    • conditionFunc: function

      a function that checks if a certain condition is eventually met within a specific timeout

    • Default value __namedParameters: object = {}
      • interval: number
      • reverse: boolean
      • timeout: number

    Returns PageElementType

Protected _waitWithinProperty

  • _waitWithinProperty<T>(name: string, expectedValue: T, conditionFunc: function, opts?: ITimeoutReverseInterval): PageElementType
  • This function waits for an actual value to lie within a certain range of an expected value.

    It does so by regularly invoking a condition function until it returns true or until a specific timeout is reached.

    A WaitUntilTimeoutError will be thrown if the condition function's return value does not become true within the specific timeout.

    Type parameters

    • T

    Parameters

    • name: string

      the name of the property for which the wait condition is performed

    • expectedValue: T

      the expected value passed to the conditionFunc

    • conditionFunc: function

      a function which compares the actual and the expected value

        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition function is expected to become true, the interval used to invoke the condition function and a reverse flag which, if set to true, negates the result of the condition function

    Returns PageElementType

containsAttribute

  • Waits for the actual value of the specified HTML attribute of PageElement to contain an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • attribute: IAttribute

      the specified HTML attribute of PageElement, consisting of the attribute's name and the value it is expected to contain

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

containsClass

  • Waits for the actual value of the PageElement's 'class' HTML attribute to contain an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • className: string

      the expected value which is supposed to be contained in the actual value of PageElement's HTML 'class' attribute

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

containsDirectText

  • Waits for PageElement's actual direct text to contain the expected direct text.

    Throws an error if the condition is not met within a specific timeout.

    A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.

    Parameters

    • directText: string
    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

containsHTML

  • Waits for PageElement's actual HTML value to contain the expected HTML value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • html: string

      the expected html which is supposed to be contained in the actual html

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

containsId

  • Waits for the actual value of PageElement's 'id' HTML attribute to contain an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • id: string

      the expected value which is supposed to be contained in the actual value of PageElement's HTML 'id' attribute

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

containsName

  • Waits for the actual value of PageElement's 'name' HTML attribute to contain an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • name: string

      the expected value which is supposed to be contained in the actual value of PageElement's HTML 'name' attribute

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

containsText

  • Waits for PageElement's actual text to contain the expected text.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • text: string

      the expected text which is supposed to be contained in the actual text

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

exists

  • Waits for PageElement to exist.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Default value opts: ITimeoutReverse = {}

      includes the timeout within which the condition is expected to be met and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyAttribute

  • Waits for the actual value of the specified HTML attribute of PageElement to have any value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • attributeName: string

      the name of a PageElement's HTML attribute which is supposed to have any value

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyClass

  • Waits for PageElement's 'class' HTML attribute to have any value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyDirectText

  • Waits for PageElement to have any direct text.

    Throws an error if the condition is not met within a specific timeout.

    A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.

    Parameters

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyHTML

  • Waits for PageElement to have any HTML value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyId

  • Waits for PageElement's 'id' HTML attribute to have any value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyName

  • Waits for PageElement's 'name' HTML attribute to have any value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAnyText

  • Waits for PageElement to have any text.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasAttribute

  • Waits for the actual value of the specified HTML attribute of PageElement to equal an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • attribute: IAttribute

      the specified HTML attribute of PageElement, consisting of the attribute's name and the value it is expected to have

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasClass

  • Waits for the actual value of PageElement's 'class' HTML attribute to equal an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • className: string

      the expected value which is supposed to equal the actual value of PageElement's HTML 'class' attribute

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasDirectText

  • Waits for PageElement's actual direct text to equal the expected direct text.

    Throws an error if the condition is not met within a specific timeout.

    A direct text is a text that resides on the level directly below the selected HTML element. It does not include any text of the HTML element's nested children HTML elements.

    Parameters

    • directText: string
    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasHTML

  • Waits for PageElement's actual HTML value to equal the expected HTML value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • html: string

      the expected html which is supposed to equal the actual html

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasHeight

  • Waits for the height of PageElement to equal the expected height or to deviate no more than the specified tolerance from the expected height.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • height: number

      the expected height of PageElement in pixels

    • Default value opts: object & ITimeoutReverseInterval = { tolerance: 0 }

      includes the tolerance used to calculate the maximal allowed deviation from the expected height, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasId

  • Waits for the actual value of PageElement's 'id' HTML attribute to equal an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • id: string

      the expected value which is supposed to equal the actual value of PageElement's 'id' HTML attribute

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasLocation

  • Waits for the location of PageElement to equal the expected coordinates or to deviate no more than the specified tolerances from the expected coordinates.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • coordinates: ICoordinates

      the expected coordinates of PageElement in pixels

    • Default value opts: object & ITimeoutReverseInterval = { tolerances: { x: 0, y: 0 } }

      includes the tolerances used to calculate the maximal allowed deviations from the expected coordinates, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasName

  • Waits for the actual value of PageElement's 'name' HTML attribute to equal an expected value.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • name: string

      the expected value which is supposed to equal the actual value of PageElement's 'name' HTML attribute

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasSize

  • Waits for the size of PageElement to equal the expected size or to deviate no more than the specified tolerances from the expected size.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • size: ISize

      the expected size of PageElement in pixels

    • Default value opts: object & ITimeoutReverseInterval = { tolerances: { width: 0, height: 0 } }

      includes the tolerances used to calculate the maximal allowed deviations from the expected size, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasText

  • Waits for PageElement's actual text to equal the expected text.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • text: string

      the expected text which is supposed to equal the actual text

    • Optional opts: ITimeoutReverseInterval

      includes the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasWidth

  • Waits for the width of PageElement to equal the expected width or to deviate no more than the specified tolerance from the expected width.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • width: number

      the expected width of PageElement in pixels

    • Default value opts: object & ITimeoutReverseInterval = { tolerance: 0 }

      includes the tolerance used to calculate the maximal allowed deviation from the expected width, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasX

  • Waits for the x-location of PageElement to equal the expected x-location or to deviate no more than the specified tolerance from the expected x-location.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • x: number

      the expected x-location of PageElement in pixels

    • Default value opts: object & ITimeoutReverseInterval = { tolerance: 0 }

      includes the tolerance used to calculate the maximal allowed deviation from the expected x-location, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

hasY

  • Waits for the y-location of PageElement to equal the expected y-location or to deviate no more than the specified tolerance from the expected y-location.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • y: number

      the expected y-location of PageElement in pixels

    • Default value opts: object & ITimeoutReverseInterval = { tolerance: 0 }

      includes the tolerance used to calculate the maximal allowed deviation from the expected y-location, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

isChecked

  • Waits for PageElement to be checked.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Default value opts: ITimeoutReverseInterval = {}

      includes filterMask which can be used to skip the invocation of the state check function for some or all managed PageElements, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

isEnabled

  • Waits for PageElement to be enabled.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Default value opts: ITimeoutReverseInterval = {}

      includes filterMask which can be used to skip the invocation of the state check function for some or all managed PageElements, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

isSelected

  • Waits for PageElement to be selected.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Default value opts: ITimeoutReverseInterval = {}

      includes filterMask which can be used to skip the invocation of the state check function for some or all managed PageElements, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

isVisible

  • Waits for PageElement to be visible.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • Default value opts: ITimeoutReverseInterval = {}

      includes filterMask which can be used to skip the invocation of the state check function for some or all managed PageElements, the timeout within which the condition is expected to be met, the interval used to check it and a reverse flag that, if set to true, checks for the condition NOT to be met instead

      If no timeout is specified, PageElement's default timeout is used. If no interval is specified, PageElement's default interval is used.

    Returns PageElementType

    this (an instance of PageElement)

untilElement

  • untilElement(description: string, condition: function, __namedParameters?: object): PageElementType
  • Wait for PageElement to meet a certain condition.

    Throws an error if the condition is not met within a specific timeout.

    Parameters

    • description: string

      describes the condition that the PageElement is expected to meet

    • condition: function

      the function which checks if a certain condition is met

        • (element: PageElementType): boolean
        • Parameters

          • element: PageElementType

          Returns boolean

    • Default value __namedParameters: object = {}
      • interval: number
      • timeout: number

    Returns PageElementType

    this (an instance of PageElement)

Generated using TypeDoc