From 270ecbb4d55efb961579a42189a3291fadd4a632 Mon Sep 17 00:00:00 2001 From: Priyansh Garg Date: Sun, 10 Nov 2024 18:06:11 +0530 Subject: [PATCH] Refactor JSDoc for isPresent command. --- lib/api/web-element/commands/isPresent.js | 11 ++++++----- test/src/api/commands/web-element/testIsPresent.js | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/api/web-element/commands/isPresent.js b/lib/api/web-element/commands/isPresent.js index 3a588ee63..be62d0f34 100644 --- a/lib/api/web-element/commands/isPresent.js +++ b/lib/api/web-element/commands/isPresent.js @@ -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 Finding Elements guide page. + * For more info on working with DOM elements in Nightwatch, refer to the Finding & interacting with DOM Elements guide page. + * For more info on the new `browser.element.find()` syntax, refer to the new Element API Overview 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); * }); * }); @@ -23,7 +24,7 @@ * @method isPresent * @memberof ScopedWebElement * @instance - * @syntax browser.element(selector).isPresent() + * @syntax browser.element.find(selector).isPresent() * @returns {ScopedValue} A boolean value indicating if the element is present in the DOM. */ diff --git a/test/src/api/commands/web-element/testIsPresent.js b/test/src/api/commands/web-element/testIsPresent.js index b9a18ae0b..3a3557836 100644 --- a/test/src/api/commands/web-element/testIsPresent.js +++ b/test/src/api/commands/web-element/testIsPresent.js @@ -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;