Skip to content

Commit

Permalink
Refactor JSDoc for isPresent command.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Nov 10, 2024
1 parent 99637d8 commit 270ecbb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 6 additions & 5 deletions lib/api/web-element/commands/isPresent.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
/**
* Checks if an element is present in the DOM.
*
* This command is useful for verifying the presence of elements that may not be visible or interactable.
* This command is useful for verifying the presence of elements that may/may not be visible or interactable.
*
* For more information on working with DOM elements in Nightwatch, refer to the <a href="https://nightwatchjs.org/guide/working-with-page-elements/finding-elements.html">Finding Elements</a> guide page.
* 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.
* For more info on the new `browser.element.find()` syntax, refer to the <a href="/api/element/"> new Element API Overview </a> page.
*
* @example
* describe('isPresent Demo', function() {
* it('test isPresent', function(browser) {
* browser.element('#search')
* browser.element.find('#search')
* .isPresent()
* .assert.equals(true);
* });
*
* it('test async isPresent', async function(browser) {
* const result = await browser.element('#search').isPresent();
* const result = await browser.element.find('#search').isPresent();
* browser.assert.equal(result, true);
* });
* });
Expand All @@ -23,7 +24,7 @@
* @method isPresent
* @memberof ScopedWebElement
* @instance
* @syntax browser.element(selector).isPresent()
* @syntax browser.element.find(selector).isPresent()
* @returns {ScopedValue<boolean>} A boolean value indicating if the element is present in the DOM.
*/

Expand Down
1 change: 0 additions & 1 deletion test/src/api/commands/web-element/testIsPresent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const MockServer = require('../../../../lib/mockserver.js');
const CommandGlobals = require('../../../../lib/globals/commands-w3c.js');
const common = require('../../../../common.js');
const Element = common.require('element/index.js');
const Utils = common.require('./utils');
const NightwatchClient = common.require('index.js');
const {settings} = common;

Expand Down

0 comments on commit 270ecbb

Please sign in to comment.