Home Reference Source
import Finder from 'pagewalker/lib/page/finder.js'
public class | source

Finder

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

attachFile(filePath: string, options: object): Promise

Attach the file given with filePath.

public

every(code: *): *

return true if all elements which is found by Finder satisfied given filter

public

executeJs(code: *): Promise

execute "JavaScript code" given as argument

public

inIframe(finderForIframe: Finder): Finder

Make this finder object executed in given iframe.

public

selectOption(content: *): Promise

Set "selected" property true on option element whose textContent match the given string.

public
Private Methods
private

Public Constructors

public constructor() source

Public Methods

public attachFile(filePath: string, options: object): Promise source

Attach the file given with filePath. This method implemented at FinderExtentions by Browser. so please read api-document of FinderExtentions you use.

Params:

NameTypeAttributeDescription
filePath string

Specify the path of the file to be attached

options object

options given to FinderExtentions

Return:

Promise

public every(code: *): * source

return true if all elements which is found by Finder satisfied given filter

Params:

NameTypeAttributeDescription
code *

Return:

*

Example:

await page.find("input").every(FinderFilter.haveValue("123")) // return true or false

public executeJs(code: *): Promise source

execute "JavaScript code" given as argument

Params:

NameTypeAttributeDescription
code *

Return:

Promise

public inIframe(finderForIframe: Finder): Finder source

Make this finder object executed in given iframe.

Params:

NameTypeAttributeDescription
finderForIframe Finder

finder object for iframe

Return:

Finder

Example:

  await page.find("h3").inIframe(page.find("iframe").first()).text()

public selectOption(content: *): Promise source

Set "selected" property true on option element whose textContent match the given string. This method is assumed to be called on a select element

Params:

NameTypeAttributeDescription
content *

Return:

Promise

public toArray(): Promise source

Return:

Promise

Promise which resolved with array of finder, that array length is matched number

Private Methods

private toContextString(): string source

Return:

string