Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PageElementCurrently<Store, PageElementType>

This class defines all currently 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 PageElementCurrently defines all currently functions

Type parameters

Hierarchy

Index

Constructors

constructor

Properties

Protected _node

_node: PageElementType

the PageNode for which PageNodeCurrently defines all currently functions

Accessors

element

  • get element(): Client<RawResult<Element>> & RawResult<Element>

not

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

    Returns object

    • containsAttribute: function
      • containsAttribute(attribute: IAttribute): boolean
      • Returns true if the specified HTML attribute of PageElement currently does not contain the expected value.

        Parameters

        • attribute: IAttribute

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

        Returns boolean

    • containsClass: function
      • containsClass(className: string): boolean
      • Returns true if the HTML attribute 'class' of PageElement currently does not contain the specified className.

        Parameters

        • className: string

          the className which the HTML attribute 'class' of PageElement is supposed not to contain

        Returns boolean

    • containsDirectText: function
      • containsDirectText(directText: string): boolean
      • Returns true if the PageElement's actual direct text currently does not contain the expected direct text.

        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

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

        Returns boolean

    • containsHTML: function
      • containsHTML(html: string): boolean
    • containsId: function
      • containsId(id: string): boolean
      • Returns true if the HTML attribute 'id' of PageElement currently does not contain the specified value.

        Parameters

        • id: string

          the value which the HTML attribute 'id' of PageElement is supposed not to contain

        Returns boolean

    • containsName: function
      • containsName(name: string): boolean
      • Returns true if the HTML attribute 'name' of PageElement currently does not contain the specified value.

        Parameters

        • name: string

          the value which the HTML attribute 'name' of PageElement is supposed not to contain

        Returns boolean

    • containsText: function
      • containsText(text: string): boolean
      • Returns true if the PageElement's actual text currently does not contain the expected text.

        Parameters

        • text: string

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

        Returns boolean

    • exists: function
      • exists(): boolean
    • hasAnyAttribute: function
      • hasAnyAttribute(attributeName: string): boolean
      • Returns true if the HTML attribute with the specified attributeName of PageElement currently does not have any value.

        Parameters

        • attributeName: string

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

        Returns boolean

    • hasAnyClass: function
      • hasAnyClass(): boolean
    • hasAnyDirectText: function
      • hasAnyDirectText(): boolean
      • Returns true if the PageElement currently does not have any direct text.

        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.

        Returns boolean

    • hasAnyHTML: function
      • hasAnyHTML(): boolean
    • hasAnyId: function
      • hasAnyId(): boolean
    • hasAnyName: function
      • hasAnyName(): boolean
    • hasAnyText: function
      • hasAnyText(): boolean
    • hasAttribute: function
      • Returns true if the specified HTML attribute of PageElement currently does not have the expected value.

        Parameters

        • attribute: IAttribute

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

        Returns boolean

    • hasClass: function
      • hasClass(className: string): boolean
      • Returns true if the HTML attribute 'class' of PageElement currently does not have the specified className.

        Parameters

        • className: string

          the className which the HTML attribute 'class' of PageElement is supposed not to have

        Returns boolean

    • hasDirectText: function
      • hasDirectText(directText: string): boolean
      • Returns true if the PageElement's actual direct text currently does not equal the expected direct text.

        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

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

        Returns boolean

    • hasHTML: function
      • hasHTML(html: string): boolean
      • Returns true if the PageElement's actual HTML currently does not equal the expected HTML.

        Parameters

        • html: string

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

        Returns boolean

    • hasHeight: function
      • hasHeight(height: number, tolerance?: number): boolean
      • Returns true if - currently - the height of PageElement does not match the specified height or if PageElement's height deviates more than the specified tolerance from the specified height.

        Parameters

        • height: number

          the expected height of PageElement

        • Optional tolerance: number

          used to calculate the maximal allowed deviation from the expected height

        Returns boolean

    • hasId: function
      • hasId(id: string): boolean
      • Returns true if the HTML attribute 'id' of PageElement currently does not have the specified value.

        Parameters

        • id: string

          the value which the HTML attribute 'id' of PageElement is supposed not to have

        Returns boolean

    • hasLocation: function
      • Returns true if - currently - the location of PageElement does not match the specified coordinates or if its location deviates more than the specified tolerances from the specified coordinates.

        Parameters

        • coordinates: ICoordinates

          the not-expected coordinates of PageElement

        • Optional tolerances: Partial<ICoordinates>

          used to calculate the maximal allowed deviations from the expected coordinates

        Returns boolean

    • hasName: function
      • hasName(name: string): boolean
      • Returns true if the HTML attribute 'name' of PageElement currently does not have the specified value.

        Parameters

        • name: string

          the value which the HTML attribute 'name' of PageElement is supposed not to have

        Returns boolean

    • hasSize: function
      • hasSize(size: ISize, tolerances?: Partial<ISize>): boolean
      • Returns true if - currently - the size of PageElement does not match the specified size or if PageElement's size deviates more than the specified tolerances from the specified size.

        Parameters

        • size: ISize

          the not-expected size of PageElement

        • Optional tolerances: Partial<ISize>

          used to calculate the maximal allowed deviations from the expected size

        Returns boolean

    • hasText: function
      • hasText(text: string): boolean
      • Returns true if the PageElement's actual text currently does not equal the expected text.

        Parameters

        • text: string

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

        Returns boolean

    • hasWidth: function
      • hasWidth(width: number, tolerance?: number): boolean
      • Returns true if - currently - the width of PageElement does not match the specified width or if PageElement's width deviates more than the specified tolerance from the specified width.

        Parameters

        • width: number

          the expected width of PageElement

        • Optional tolerance: number

          used to calculate the maximal allowed deviation from the expected width

        Returns boolean

    • hasX: function
      • hasX(x: number, tolerance?: number): boolean
      • Returns true if - currently - the x-location of PageElement does not match the specified x-location or if PageElement's x-location deviates more than the specified tolerance from the specified x-location.

        Parameters

        • x: number

          the not-expected x-location of PageElement

        • Optional tolerance: number

          used to calculate the maximal allowed deviation from the expected x-location

        Returns boolean

    • hasY: function
      • hasY(y: number, tolerance?: number): boolean
      • Returns true if - currently - the y-location of PageElement does not match the specified y-location or if PageElement's y-location deviates more than the specified tolerance from the specified y-location.

        Parameters

        • y: number

          the not-expected y-location of PageElement

        • Optional tolerance: number

          used to calculate the maximal allowed deviation from the expected y-location

        Returns boolean

    • isChecked: function
      • isChecked(): boolean
    • isEnabled: function
      • isEnabled(): boolean
    • isSelected: function
      • isSelected(): boolean
    • isVisible: function
      • isVisible(): boolean

Methods

Protected _compareContains

  • _compareContains<T>(expected: T, actual: T): boolean

Protected _compareHas

  • _compareHas<T>(expected: T, actual: T): boolean

Protected _compareHasAny

  • _compareHasAny<T>(actual: T): boolean

Protected _withinTolerance

  • _withinTolerance(actual: number, expected: number, tolerance?: number): boolean

Protected _writeLastDiff

  • _writeLastDiff<T>(actual: T, expected?: T): void

containsAttribute

  • containsAttribute(attribute: IAttribute): boolean
  • Returns true if the specified HTML attribute of PageElement currently contains the expected value.

    Parameters

    • attribute: IAttribute

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

    Returns boolean

containsClass

  • containsClass(className: string): boolean
  • Returns true if the HTML attribute 'class' of PageElement currently contains the specified className.

    Parameters

    • className: string

      the className which the HTML attribute 'class' of PageElement is supposed to contain

    Returns boolean

containsDirectText

  • containsDirectText(directText: string): boolean
  • Returns true if the PageElement's actual direct text currently contains the expected direct text.

    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

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

    Returns boolean

containsHTML

  • containsHTML(html: string): boolean

containsId

  • containsId(id: string): boolean
  • Returns true if the HTML attribute 'id' of PageElement currently contains the specified value.

    Parameters

    • id: string

      the value which the HTML attribute 'id' of PageElement is supposed to contain

    Returns boolean

containsName

  • containsName(name: string): boolean
  • Returns true if the HTML attribute 'name' of PageElement currently contains the specified value.

    Parameters

    • name: string

      the value which the HTML attribute 'name' of PageElement is supposed to contain

    Returns boolean

containsText

  • containsText(text: string): boolean
  • Returns true if the PageElement's actual text currently contains the expected text.

    Parameters

    • text: string

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

    Returns boolean

exists

  • exists(): boolean
  • Returns true if PageElement currently exists.

    Overwriting this function affects the behavior of the function exists in PageElement and its currently, wait and eventually APIs.

    Returns boolean

getAttribute

  • getAttribute(attributeName: string): string
  • Returns the current value of PageElement's HTML attribute with the passed attribute name.

    Overwriting this function affects the behavior of the functions getAttribute, hasAttribute, containsAttribute and hasAnyAttribute in PageElement and its currently, wait and eventually APIs.

    Parameters

    • attributeName: string

      the name of the HTML attribute whose current value should be returned

    Returns string

getClass

  • getClass(): string
  • Returns the current value of PageElement's 'class' HTML attribute.

    Overwriting this function affects the behavior of the functions getClass, hasClass, containsClass and hasAnyClass in PageElement and its currently, wait and eventually APIs.

    Returns string

getContainsDirectText

  • getContainsDirectText(directText: string): boolean
  • Returns PageElement's current 'containsDirectText' status.

    A PageElement's 'containsDirectText' status is set to true if its actual direct text contains the expected direct text.

    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

      the expected direct text used in the comparison which sets the 'containsDirectText' status

    Returns boolean

getContainsText

  • getContainsText(text: string): boolean
  • Returns PageElement's current 'containsText' status.

    A PageElement's 'containsText' status is set to true if its actual text contains the expected text.

    Parameters

    • text: string

      the expected text used in the comparison which sets the 'containsText' status

    Returns boolean

getDirectText

  • getDirectText(): string
  • Returns PageElement's current direct text.

    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.

    Overwriting this function affects the behavior of the functions getDirectText, hasDirectText, containsDirectText and hasAnyDirectText in PageElement and its currently, wait and eventually APIs.

    Returns string

getExists

  • getExists(): boolean

getHTML

  • getHTML(): string
  • Returns PageElement's current HTML.

    Overwriting this function affects the behavior of the functions getHTML, hasHTML, containsHTML and hasAnyHTML in PageElement and its currently, wait and eventually APIs.

    Returns string

getHasAnyDirectText

  • getHasAnyDirectText(): boolean
  • Returns PageElement's current 'hasAnyDirectText' status.

    A PageElement's 'hasAnyDirectText' status is set to true if it has any direct text.

    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.

    Returns boolean

getHasAnyText

  • getHasAnyText(): boolean

getHasDirectText

  • getHasDirectText(directText: string): boolean
  • Returns PageElement's current 'hasDirectText' status.

    A PageElement's 'hasDirectText' status is set to true if its actual direct text equals the expected direct text.

    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

      the expected direct text used in the comparison which sets the 'hasDirectText' status

    Returns boolean

getHasText

  • getHasText(text: string): boolean
  • Returns PageElement's current 'hasText' status.

    A PageElement's 'hasText' status is set to true if its actual text equals the expected text.

    Parameters

    • text: string

      the expected text used in the comparison which sets the 'hasText' status

    Returns boolean

getHeight

  • getHeight(): number
  • Returns the current height of PageElement in pixels.

    Overwriting this function affects the behavior of the functions getHeight, hasHeight, containsHeight and hasAnyHeight in PageElement and its currently, wait and eventually APIs.

    Returns number

getId

  • getId(): string
  • Returns the current value of PageElement's 'id' HTML attribute.

    Overwriting this function affects the behavior of the functions getId, hasId, containsId and hasAnyId in PageElement and its currently, wait and eventually APIs.

    Returns string

getIsEnabled

  • getIsEnabled(): boolean

getIsVisible

  • getIsVisible(): boolean

getLocation

  • Returns the current location of PageElement in pixels.

    Overwriting this function affects the behavior of the functions getLocation, hasLocation, containsLocation and hasAnyLocation in PageElement and its currently, wait and eventually APIs.

    Returns ICoordinates

getName

  • getName(): string
  • Returns the current value of PageElement's 'name' HTML attribute.

    Overwriting this function affects the behavior of the functions getName, hasName, containsName and hasAnyName in PageElement and its currently, wait and eventually APIs.

    Returns string

getSize

  • Returns the current size of PageElement in pixels.

    Overwriting this function affects the behavior of the functions getSize, hasSize, containsSize and hasAnySize in PageElement and its currently, wait and eventually APIs.

    Returns ISize

getText

  • getText(): string
  • Returns PageElement's current text.

    Overwriting this function affects the behavior of the functions getText, hasText, containsText and hasAnyText in PageElement and its currently, wait and eventually APIs.

    Returns string

getWidth

  • getWidth(): number
  • Returns the current width of PageElement in pixels.

    Overwriting this function affects the behavior of the functions getWidth, hasWidth, containsWidth and hasAnyWidth in PageElement and its currently, wait and eventually APIs.

    Returns number

getX

  • getX(): number
  • Returns the current X-location of PageElement in pixels.

    Overwriting this function affects the behavior of the functions getX, hasX, containsX and hasAnyX in PageElement and its currently, wait and eventually APIs.

    Returns number

getY

  • getY(): number
  • Returns the current Y-location of PageElement in pixels.

    Overwriting this function affects the behavior of the functions getY, hasY, containsY and hasAnyY in PageElement and its currently, wait and eventually APIs.

    Returns number

hasAnyAttribute

  • hasAnyAttribute(attributeName: string): boolean
  • Returns true if the HTML attribute with the specified attributeName of PageElement currently has any value.

    Parameters

    • attributeName: string

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

    Returns boolean

hasAnyClass

  • hasAnyClass(): boolean

hasAnyDirectText

  • hasAnyDirectText(): boolean
  • Returns true if the PageElement currently has any direct text.

    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.

    Returns boolean

hasAnyHTML

  • hasAnyHTML(): boolean

hasAnyId

  • hasAnyId(): boolean

hasAnyName

  • hasAnyName(): boolean

hasAnyText

  • hasAnyText(): boolean

hasAttribute

  • Returns true if the specified HTML attribute of PageElement currently has the expected value.

    Parameters

    • attribute: IAttribute

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

    Returns boolean

hasClass

  • hasClass(className: string): boolean
  • Returns true if the HTML attribute 'class' of PageElement currently has the specified className.

    Parameters

    • className: string

      the className which the HTML attribute 'class' of PageElement is supposed to have

    Returns boolean

hasDirectText

  • hasDirectText(directText: string): boolean
  • Returns true if the PageElement's actual direct text currently equals the expected direct text.

    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

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

    Returns boolean

hasHTML

  • hasHTML(html: string): boolean

hasHeight

  • hasHeight(height: number, tolerance?: number): boolean
  • Returns true if - currently - the height of PageElement matches the specified height or if PageElement's height deviates no more than the specified tolerance from the specified height.

    Parameters

    • height: number

      the expected height of PageElement

    • Optional tolerance: number

      used to calculate the maximal allowed deviation from the expected height

    Returns boolean

hasId

  • hasId(id: string): boolean
  • Returns true if the HTML attribute 'id' of PageElement currently has the specified value.

    Parameters

    • id: string

      the value which the HTML attribute 'id' of PageElement is supposed to have

    Returns boolean

hasLocation

  • Returns true if - currently - the location of PageElement matches the specified coordinates or if its location deviates no more than the specified tolerances from the specified coordinates.

    Parameters

    • coordinates: ICoordinates

      the expected coordinates of PageElement

    • Default value tolerances: Partial<ICoordinates> = { x: 0, y: 0 }

      used to calculate the maximal allowed deviations from the expected coordinates

    Returns boolean

hasName

  • hasName(name: string): boolean
  • Returns true if the HTML attribute 'name' of PageElement currently has the specified value.

    Parameters

    • name: string

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

    Returns boolean

hasSize

  • hasSize(size: ISize, tolerances?: Partial<ISize>): boolean
  • Returns true if - currently - the size of PageElement matches the specified size or if PageElement's size deviates no more than the specified tolerances from the specified size.

    Parameters

    • size: ISize

      the expected size of PageElement

    • Default value tolerances: Partial<ISize> = { width: 0, height: 0 }

      used to calculate the maximal allowed deviations from the expected size

    Returns boolean

hasText

  • hasText(text: string): boolean

hasWidth

  • hasWidth(width: number, tolerance?: number): boolean
  • Returns true if - currently - the width of PageElement matches the specified width or if PageElement's width deviates no more than the specified tolerance from the specified width.

    Parameters

    • width: number

      the expected width of PageElement

    • Optional tolerance: number

      used to calculate the maximal allowed deviation from the expected width

    Returns boolean

hasX

  • hasX(x: number, tolerance?: number): boolean
  • Returns true if - currently - the x-location of PageElement matches the specified x-location or if PageElement's x-location deviates no more than the specified tolerance from the specified x-location.

    Parameters

    • x: number

      the expected x-location of PageElement

    • Optional tolerance: number

      used to calculate the maximal allowed deviation from the expected x-location

    Returns boolean

hasY

  • hasY(y: number, tolerance?: number): boolean
  • Returns true if - currently - the y-location of PageElement matches the specified y-location or if PageElement's y-location deviates no more than the specified tolerance from the specified y-location.

    Parameters

    • y: number

      the expected y-location of PageElement

    • Optional tolerance: number

      used to calculate the maximal allowed deviation from the expected y-location

    Returns boolean

isChecked

  • isChecked(): boolean
  • Returns true if PageElement is currently checked.

    Overwriting this function affects the behavior of the function isChecked in PageElement and its currently, wait and eventually APIs.

    Returns boolean

isEnabled

  • isEnabled(): boolean
  • Returns true if PageElement is currently enabled.

    Overwriting this function affects the behavior of the function isEnabled in PageElement and its currently, wait and eventually APIs.

    Returns boolean

isSelected

  • isSelected(): boolean
  • Returns true if PageElement is currently selected.

    Overwriting this function affects the behavior of the function isSelected in PageElement and its currently, wait and eventually APIs.

    Returns boolean

isVisible

  • isVisible(): boolean
  • Returns true if PageElement is currently visible.

    Overwriting this function affects the behavior of the function isVisible in PageElement and its currently, wait and eventually APIs.

    Returns boolean

Generated using TypeDoc