Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "helpers"

Index

Functions

Const click

  • click(selector: string, index?: number, useBrowser?: any): void
  • function

    click

    desc

    clicks the selector specified and if there are multiple elememts with the same selector it will choose based on the index. Note that it waits until selector appears in the DOM. And clicks only the visible element.

    Parameters

    • selector: string

      The Selector element.

    • Default value index: number = 0
    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const clickWithText

  • clickWithText(selector: string, text: string, index?: number, useBrowser?: any): void
  • function

    clickWithText

    desc

    finds the selector with text and clicks and if there are multiple elememts with the same text, it will click based on the index. Note that it waits until selector appears in the DOM.

    Parameters

    • selector: string

      Selector for the element.

    • text: string

      The text element.

    • Default value index: number = 0
    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const findElementFromGroupWithText

  • findElementFromGroupWithText(groupSelector: string, textToSearch: string, index?: number, useBrowser?: any): any
  • function

    findElementFromGroupWithText()

    desc

    Finds and returns the element that matches the text from the group of selectors

    Parameters

    • groupSelector: string

      The groupSelector element.

    • textToSearch: string

      Enter the text to search in elements

    • Default value index: number = 0
    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns any

    element - The element which matches the textToSearch from group of groupSelector or returns null if nothing is found

Const load

  • load(url: string, useBrowser?: any): void
  • function

    load

    desc

    loads the url in the browser.

    Parameters

    • url: string

      The url to navigate to.

    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const setValue

  • setValue(selector: string, index?: number, value?: string, useBrowser?: any): void
  • function

    setValue

    desc

    Set Value in any selector

    Parameters

    • selector: string

      The Selector element.

    • Default value index: number = 0
    • Default value value: string = ""
    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const wait

  • wait(selector: string, useBrowser?: any): void
  • function

    wait

    desc

    Accepts selector to wait for the element to appear in the DOM and scroll the page to that element in the screen.

    Parameters

    • selector: string

      The Selector element.

    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const waitForElementToGo

  • waitForElementToGo(selector: string, index?: number, useBrowser?: any): void
  • function

    waitForElementToGo

    desc

    Waits until element is not visible in DOM. Selector will choose based on the index.

    Parameters

    • selector: string

      The Selector element.

    • Default value index: number = 0
    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const waitForTextToAppear

  • waitForTextToAppear(selector: string, textToSearch: string, useBrowser?: any): void
  • function

    waitForTextToAppear

    desc

    Accepts selector and the text of the selector to wait for the element with that text to appear in the DOM and scroll the page to that element in the screen and waits until the selector with text is visible

    Parameters

    • selector: string

      The Selector element.

    • textToSearch: string

      Text to search in the selectors.

    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const waitForUrl

  • waitForUrl(url: string, timeout: number, regex?: boolean, useBrowser?: any): void
  • Waits until the url is loaded, then continues Times out after timeout mentioned in configs

    Parameters

    • url: string

      URL to check if loaded

    • timeout: number

      waiting time for url to load

    • Default value regex: boolean = false

      Regex to match with url

    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Const waitForVisible

  • waitForVisible(selector: any, useBrowser?: any): void
  • function

    waitForVisible

    desc

    Accepts selector to wait for the element to appear in the DOM and scroll the page to that element in the screen. and waits until the selector is visible

    Parameters

    • selector: any

      The Selector element.

    • Default value useBrowser: any = browser

      Optional browser instance to use, otherwise defaults to global browser

    Returns void

Object literals

Const Helpers

Helpers: object

click

click: click

clickWithText

clickWithText: clickWithText

findElementFromGroupWithText

findElementFromGroupWithText: findElementFromGroupWithText

load

load: load

setValue

setValue: setValue

wait

wait: wait

waitForElementToGo

waitForElementToGo: waitForElementToGo

waitForTextToAppear

waitForTextToAppear: waitForTextToAppear

waitForUrl

waitForUrl: waitForUrl

waitForVisible

waitForVisible: waitForVisible

Generated using TypeDoc