forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
isSelected.js
37 lines (37 loc) · 1.09 KB
/
isSelected.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Determines if an element is selected.
*
* For more info on working with DOM elements in Nightwatch, refer to the <a href="https://nightwatchjs.org/guide/writing-tests/finding-interacting-with-dom-elements.html">Finding & interacting with DOM Elements</a> guide page.
*
* @example
* describe('isSelected Demo', function() {
*
* it('test isSelected', function(browser) {
* browser
* .element('#search')
* .isSelected(function callback(result) {
* assert.equal(result.value, true);
* });
* });
*
* it('test async isSelected', async function(browser) {
* const result = await browser
* .element('#search')
* .isSelected();
* assert.equal(result, true)
* });
*
* after(browser => browser.end());
* });
*
* @since 3.0.0
* @method isSelected
* @memberof ScopedWebElement
* @instance
* @syntax browser.element(selector).isSelected()
* @see https://www.w3.org/TR/webdriver/#is-element-selected
* @returns {ScopedValue<boolean>}
*/
module.exports.command = function () {
return this.runQueuedCommandScoped('isElementSelected');
};