forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Determines if an element is visible. | ||
* | ||
* 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('isVisible Demo', function() { | ||
* | ||
* it('test isVisible', function(browser) { | ||
* browser.element('#search') | ||
* .isVisible() | ||
* .assert.equals(true); | ||
* }); | ||
* | ||
* it('test async isVisible', async function(browser) { | ||
* const result = await browser.element('#search').isVisible(); | ||
* browser.assert.equal(result, true) | ||
* }); | ||
* | ||
* after(browser => browser.end()); | ||
* }); | ||
* | ||
* @since 3.0.0 | ||
* @method isVisible | ||
* @memberof ScopedWebElement | ||
* @instance | ||
* @syntax browser.element(selector).isVisible() | ||
* @see https://www.w3.org/TR/webdriver/#is-element-visible | ||
* @returns {ScopedValue<boolean>} | ||
* @alias isDisplayed | ||
*/ | ||
module.exports.command = function () { | ||
return this.runQueuedCommandScoped('isElementVisible'); | ||
}; |