FinderAction

FinderAction

This class provides action methods for Finder. This class is Mixined to "Finder" class

Constructor

new FinderAction()

Source:

Methods

attribute() → {Promise}

Description:
  • Get a attribute of element which is found first by Finder.

Source:
Returns:

Promise resolved with element.attributes[attrName].value

Type
Promise

check() → {Promise}

Description:
  • Set "checked" property true on all elements which is found by Finder

Source:
Returns:
Type
Promise

checked() → {Promise}

Description:
  • Get a value of element.checked which is found first by Finder.

Source:
Returns:

Promise resolved with element.checked

Type
Promise

chooseRadioButton() → {Promise}

Description:
  • Alias of "click"

Source:
Returns:
Type
Promise

click() → {Promise}

Description:
  • Click an element which is found first by Finder

Source:
Returns:

Promise resolved after click event

Type
Promise

count() → {Promise}

Description:
  • Get a count of elements which is found by Finder.

Source:
Returns:

Promise resolved with matched number

Type
Promise

exist() → {Promise}

Source:
Returns:

return true if count of elements which is found by Finder is over one.

Type
Promise

keydown(options) → {Promise}

Description:
  • Press given key on element which is found by Finder.

Source:
Parameters:
Name Type Description
options Object

options is passed to the KeyboardEvent constructor. The default value is the Enter key.

Returns:
Type
Promise

notExist() → {Promise}

Source:
Returns:

return true if count of elements which is found by Finder is zero.

Type
Promise

select() → {Promise}

Description:
  • Set "selected" property true on element which is found by Finder. This method is supposed to be called on the "option" element

Source:
Returns:
Type
Promise

setText() → {Promise}

Description:
  • Set given text to textContent of all elements which is found by Finder

Source:
Returns:

Promise resolved after setting textContent

Type
Promise

setValue(val, options) → {Promise}

Description:
  • Set given value to value of all elements which is found by Finder. Unlike fillIn(), this assigns the value by script and does not move the focus by default.

Source:
Parameters:
Name Type Description
val string

value to be set

options object
Properties
Name Type Description
focus boolean

if true, focus the element as a user does (default false)

Returns:

Promise resolved after setting value

Type
Promise

submit() → {Promise}

Description:
  • Submit the form as if pressing Enter on an element within the form

Source:
Returns:
Type
Promise

text(options) → {Promise}

Description:
  • Get a textContent of element which is found first by Finder.

Source:
Parameters:
Name Type Description
options Object
Properties
Name Type Description
trim boolean

If true, trim textContent. Default is false.

Returns:

Promise resolved with element.textContent

Type
Promise

uncheck() → {Promise}

Description:
  • Set "checked" property true on all elements which is found by Finder

Source:
Returns:
Type
Promise

value() → {Promise}

Description:
  • Get a value of element which is found first by Finder.

Source:
Returns:

Promise resolved with element.value

Type
Promise