Home Reference Source

Typedef

Static Public Summary
public
public
public
public
public
public
public
public
public
public
public
public
public

RawBehaviorIterator: AsyncIterator<RawBehaviorStepResults>|AsyncIterableIterator<RawBehaviorStepResults>

public
public
public
public

SomeElement: HTMLAnchorElement | HTMLElement | HTMLAppletElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLBaseFontElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDirectoryElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFontElement | HTMLFormElement | HTMLFrameElement | HTMLFrameSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMarqueeElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLObjectElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLParamElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableDataCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTableHeaderCellElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | Element | Node | SVGAElement | SVGCircleElement | SVGClipPathElement | SVGDefsElement | SVGDescElement | SVGEllipseElement | SVGFEBlendElement | SVGFEColorMatrixElement | SVGFEComponentTransferElement | SVGFECompositeElement | SVGFEConvolveMatrixElement | SVGFEDiffuseLightingElement | SVGFEDisplacementMapElement | SVGFEDistantLightElement | SVGFEFloodElement | SVGFEFuncAElement | SVGFEFuncBElement | SVGFEFuncGElement | SVGFEFuncRElement | SVGFEGaussianBlurElement | SVGFEImageElement | SVGFEMergeElement | SVGFEMergeNodeElement | SVGFEMorphologyElement | SVGFEOffsetElement | SVGFEPointLightElement | SVGFESpecularLightingElement | SVGFESpotLightElement | SVGFETileElement | SVGFETurbulenceElement | SVGFilterElement | SVGForeignObjectElement | SVGGElement | SVGImageElement | SVGLineElement | SVGLinearGradientElement | SVGMarkerElement | SVGMaskElement | SVGMetadataElement | SVGPathElement | SVGPatternElement | SVGPolygonElement | SVGPolylineElement | SVGRadialGradientElement | SVGRectElement | SVGScriptElement | SVGStopElement | SVGStyleElement | SVGSVGElement | SVGSwitchElement | SVGSymbolElement | SVGTextElement | SVGTextPathElement | SVGTitleElement | SVGTSpanElement | SVGUseElement | SVGViewElement

public
public
public
public
public
public
public

Static Public

public BehaviorRunOptions: Object source

Properties:

NameTypeAttributeDescription
delayAmount number
  • optional
  • default: 1000

Time value in milliseconds representing how much time should be waited after initiating a behavior's step

noOutlinks boolean
  • optional
  • default: true

Should the collection of outlinks be disabled when running the behavior

logging boolean
  • optional
  • default: true

Should information the behavior sends be displayed

public BehaviorRunnerAsyncIterator: Object source

Properties:

NameTypeAttributeDescription
next function(): Promise<BehaviorStepResults>

function used to initiate the next action of the behavior

public BehaviorRunnerInitOpts: Object source

Properties:

NameTypeAttributeDescription
win Window
behaviorStepIterator RawBehaviorIterator

An async iterator that yields the state of the behavior

postStepFN function(results: RawBehaviorStepResults): BehaviorStepResults
  • optional

An optional function that is supplied the state of the behavior after performing an action. It is required that this function returns the state unmodified or a transformation of the state that is either an object that contains the original value of the done property or a boolean that is the value of the original done property.

metadata Object
  • optional

Optional metadata about the behavior currently being run

public BehaviorRunnerOpts: Object source

Properties:

NameTypeAttributeDescription
behaviorStepIterator RawBehaviorIterator

An async iterator that yields the state of the behavior

postStepFN function(results: RawBehaviorStepResults): BehaviorStepResults
  • optional

An optional function that is supplied the state of the behavior after performing an action. It is required that this function returns the state unmodified or a transformation of the state that is either an object that contains the original value of the done property or a boolean that is the value of the original done property.

metadata Object
  • optional

Optional metadata about the behavior currently being run

public BehaviorState: Object source

Properties:

NameTypeAttributeDescription
msg string

A message from the behavior representing a description of the action just performed

wait boolean

Should a wait for network idle be performed if possible by the runner

state *

Any additional information about the full state of the behavior

public BehaviorStepResults: Object source

Properties:

NameTypeAttributeDescription
done boolean

Has the behavior finished performing its actions

wait boolean

Should a wait for network idle be performed if possible by the runner

msg string

A message from the behavior representing a description of the action just performed

state *

Any additional information about the full state of the behavior

public BoolOrPromiseBool: boolean | Promise<boolean> source

public CreateMouseEventOptions: Object source

Properties:

NameTypeAttributeDescription
type string

The type of the mouse event to be created

elem Element

The element the mouse event will be fired on used to calculate mouse position

position Object
  • optional

An object specifying the events position

eventOpts Object
  • optional

Additional options to be used

view Window
  • optional

The view (window)

clickCount number
  • optional

How many clicks have been done before this event

See:

public DisconnectingWalkState: Object source

Properties:

NameTypeAttributeDescription
walkEndedReason number

The WalkEndedReasons why the walk ended (set once the walk has ended)

findParentElement function(): SomeElement

function used to find the parent element

refindCurrentChild function(parent: SomeElement, child: SomeElement): SomeElement

function used to re-find the currnet child when the parent element has become disconnected

shouldWait function(parent: SomeElement, child: SomeElement): boolean

function used to determine if the wait function should be called

wait function(parent: SomeElement, child: SomeElement): boolean

function used to wait once shouldWait returns true

nextChild function(parent: SomeElement, child: SomeElement): SomeElement

function used to get the next child element

public ElemOrPromiseElem: SomeElement | Promise<SomeElement> source

public FireMouseEventsOnOptions: Object source

Properties:

NameTypeAttributeDescription
elem Element

The element the mouse event will be fired on used to calculate mouse position

eventNames Array<string>

The event types to be fired

view Window
  • optional

The view (window)

position Object
  • optional

An object specifying the events position

eventOpts Object
  • optional

Additional options to be used

clickCount number
  • optional

How many clicks have been done before this event

public GuardedWaitForOptions: Object source

Properties:

NameTypeAttributeDescription
guard function(): boolean
  • optional

Function polled to determine if the wait is considered done by additional conditions

pollRate number
  • optional
  • default: 1000

The rate at which the condition will be checked

max number
  • optional
  • nullable: true

The maximum length of time the polling will happen in milliseconds

public RawBehaviorIterator: AsyncIterator<RawBehaviorStepResults>|AsyncIterableIterator<RawBehaviorStepResults> source

public RawBehaviorStepResults: Object source

Properties:

NameTypeAttributeDescription
done boolean

Is the generator finished

value BehaviorState
  • nullable: true

The value yielded by the behavior

public Scroller: Object source

Properties:

NameTypeAttributeDescription
timesToScroll number

the desired number of times to be scrolled

scrollUpDownAmount number

The current amount to be scrolled up or down

scrollLeftRightAmount number

The current amount to be scrolled left or right

scrollRight function(): void

Scroll the page right

scrollLeft function(): void

Scroll the page left

scrollUp function(): void

Scroll the page up

scrollDown function(): void

Scroll the page down

canScrollDownMore function(): boolean

Can the page be scrolled some more down

canScrollUpMore function(): boolean

Can the page be scrolled some more up

public SelectScrollIntoViewClickUntilNullOptions: Object source

Properties:

NameTypeAttributeDescription
cntx Document | Element | HTMLElement
  • optional

optional element to call querySelector on using selector

stopPredicate function(selected: Element): boolean
  • optional

optional function called to determine if the loop should end after each iteration @property{number} [delay] - amount of time, in milliseconds, that should be waited after scrolling into view and clicking (defaults to 1 second) -- Only used if the function will apply a delay

public SomeElement: HTMLAnchorElement | HTMLElement | HTMLAppletElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLBaseFontElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDirectoryElement | HTMLDivElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFontElement | HTMLFormElement | HTMLFrameElement | HTMLFrameSetElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLLinkElement | HTMLMapElement | HTMLMarqueeElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLObjectElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLParamElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLSpanElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableDataCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTableHeaderCellElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | Element | Node | SVGAElement | SVGCircleElement | SVGClipPathElement | SVGDefsElement | SVGDescElement | SVGEllipseElement | SVGFEBlendElement | SVGFEColorMatrixElement | SVGFEComponentTransferElement | SVGFECompositeElement | SVGFEConvolveMatrixElement | SVGFEDiffuseLightingElement | SVGFEDisplacementMapElement | SVGFEDistantLightElement | SVGFEFloodElement | SVGFEFuncAElement | SVGFEFuncBElement | SVGFEFuncGElement | SVGFEFuncRElement | SVGFEGaussianBlurElement | SVGFEImageElement | SVGFEMergeElement | SVGFEMergeNodeElement | SVGFEMorphologyElement | SVGFEOffsetElement | SVGFEPointLightElement | SVGFESpecularLightingElement | SVGFESpotLightElement | SVGFETileElement | SVGFETurbulenceElement | SVGFilterElement | SVGForeignObjectElement | SVGGElement | SVGImageElement | SVGLineElement | SVGLinearGradientElement | SVGMarkerElement | SVGMaskElement | SVGMetadataElement | SVGPathElement | SVGPatternElement | SVGPolygonElement | SVGPolylineElement | SVGRadialGradientElement | SVGRectElement | SVGScriptElement | SVGStopElement | SVGStyleElement | SVGSVGElement | SVGSwitchElement | SVGSymbolElement | SVGTextElement | SVGTextPathElement | SVGTitleElement | SVGTSpanElement | SVGUseElement | SVGViewElement source

public SubstringArgs: Object source

Properties:

NameTypeAttributeDescription
searchFrom number
  • optional

Index to search from for the supplied substring

include boolean
  • optional

Should the supplied substring be included in the returned substring

public TraversalOpts: Object source

Properties:

NameTypeAttributeDescription
handler function(element: SomeElement, additionalArgs: *): *

The function to be called for each child

parentElement SomeElement
  • optional
  • nullable: true

The element who's children are to be visited, if not supplied it is expected that a setup function is

setup function(): ElemOrPromiseElem
  • optional

Function used to receive the parent element who's children are to be traversed.

setupFailure function(): *
  • optional

Function called if the supplied setup function fails to return a parent element or the supplied parent element is falsy

nextChild function(parent: SomeElement, child: SomeElement): ElemOrPromiseElem
  • optional

Function used to get the next child to be visited

filter function(child: SomeElement): BoolOrPromiseBool
  • optional

Function used to determine if a specific child is to be handled or not, returning true indicates the child element is to be handled false otherwise

selector function(child: SomeElement): Element
  • optional

Function used to select a more specific element to be used

shouldWait function(parent: SomeElement, child: SomeElement): BoolOrPromiseBool
  • optional

Function used to determine if a wait for additional children should be done

wait function(parent: SomeElement, child: SomeElement): Promise<*>
  • optional

Function used to perform the wait for additional children

preTraversal function(): *
  • optional

Function used to perform some action before traversal begins. If this function returns an (async) generator the values of the generator are yielded otherwise no value this function returns is yielded

postTraversal function(setupFailure: boolean): *
  • optional

Function called after the traversal is complete with T/F indicating if the function is being called if setup failed or the traversal is complete. The value of this function yield'd if it is truthy

additionalArgs *
  • optional

Optional additional arguments to be supplied to the handler function

loader boolean
  • optional
  • default: false

Should the traversal expect that the parent element could have additional child elements added e.g. infinite loading. If loader is falsy and either or both shouldWait and wait function(s) are supplied then the walk behaves as if the loader was set to true

waitOptions WaitForOptions
  • optional

Options controlling the wait for more children

public WaitForOptions: Object source

Properties:

NameTypeAttributeDescription
pollRate number
  • optional
  • default: 1000

The rate at which the condition will be checked

max number
  • optional
  • default: 15000
  • nullable: true

The maximum length of time the polling will happen in milliseconds

public WaitForSelectorOptions(cntx: SomeElement | Document, options: WaitForOptions): Object source

Properties:

NameTypeAttributeDescription
selector string

The selector to be waited for

public WaitResult: Object source

Properties:

NameTypeAttributeDescription
predicate boolean

T/F indicating if the stopping condition(s) of a wait was met, this includes guards

maxExceeded boolean

T/F indicating if the configured maximum wait time was exceeded

public WalkChildrenOfCustomOpts: Object source

Properties:

NameTypeAttributeDescription
parentElement SomeElement

The element who's children are to be visited, if not supplied it is expected that a setup function is

nextChild function(parent: SomeElement, child: SomeElement): ElemOrPromiseElem
  • optional

Function used to get the next child to be visited

selector function(child: SomeElement): Element
  • optional

Function used to select a more specific element to be used

filter function(child: SomeElement): BoolOrPromiseBool
  • optional

Function used to determine if a specific child is to be handled

shouldWait function(parent: SomeElement, child: SomeElement): BoolOrPromiseBool
  • optional

Function used to determine if a wait for additional children should be done

wait function(parent: SomeElement, child: SomeElement): Promise<*>
  • optional

Function used to perform the wait for additional children

loader boolean
  • optional
  • default: false

Should the walk expect that the parent element could have additional child elements added e.g. infinite loading. If loader is falsy and either or both shouldWait and wait function(s) are supplied then the walk behaves as if the loader was set to true

waitOptions WaitForOptions
  • optional

Options controlling the wait for more children waitForAdditionalElemChildren when no custom wait function is supplied

public XPathOnOfOpts: Object source

Properties:

NameTypeAttributeDescription
queries Array<string>
xpg *
context *
  • optional