Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PageElementBaseWait<Store, PageElementType>

This class defines all wait functions of PageElementBase.

template

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

template

PageElementType type of the PageElement for which PageElementBaseWait 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(): __type

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

Generated using TypeDoc