From e04ea6e490486b93c95ca0b4ddb5f70246c65127 Mon Sep 17 00:00:00 2001 From: Priyansh Garg Date: Sun, 10 Nov 2024 19:17:24 +0530 Subject: [PATCH] Refactor JSDoc for a few commands. --- lib/api/web-element/commands/isActive.js | 5 +++-- lib/api/web-element/commands/isEnabled.js | 7 ++++--- lib/api/web-element/commands/isSelected.js | 7 ++++--- lib/api/web-element/commands/isVisible.js | 9 ++++++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/lib/api/web-element/commands/isActive.js b/lib/api/web-element/commands/isActive.js index abac2f471..9d7561428 100644 --- a/lib/api/web-element/commands/isActive.js +++ b/lib/api/web-element/commands/isActive.js @@ -2,17 +2,18 @@ * Determines if an element is currently active/focused in the DOM. * * 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('isActive Demo', function() { * it('test isActive', function(browser) { - * browser.element('#search') + * browser.element.find('#search') * .isActive() * .assert.equals(true); * }); * * it('test async isActive', async function(browser) { - * const result = await browser.element('#search').isActive(); + * const result = await browser.element.find('#search').isActive(); * browser.assert.equal(result, true); * }); * }); diff --git a/lib/api/web-element/commands/isEnabled.js b/lib/api/web-element/commands/isEnabled.js index ac36a975d..070b4e85f 100644 --- a/lib/api/web-element/commands/isEnabled.js +++ b/lib/api/web-element/commands/isEnabled.js @@ -2,17 +2,18 @@ * Determines if an element is enabled. * * 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('isEnabled Demo', function() { * it('test isEnabled', function(browser) { - * browser.element('#search') + * browser.element.find('#search') * .isEnabled() * .assert.equals(true); * }); * * it('test async isEnabled', async function(browser) { - * const result = await browser.element('#search').isEnabled(); + * const result = await browser.element.find('#search').isEnabled(); * browser.assert.equal(result, true); * }); * }); @@ -21,7 +22,7 @@ * @method isEnabled * @memberof ScopedWebElement * @instance - * @syntax browser.element(selector).isEnabled() + * @syntax browser.element.find(selector).isEnabled() * @link /#is-element-enabled * @returns {ScopedValue} */ diff --git a/lib/api/web-element/commands/isSelected.js b/lib/api/web-element/commands/isSelected.js index 075bd800e..a20ec39bc 100644 --- a/lib/api/web-element/commands/isSelected.js +++ b/lib/api/web-element/commands/isSelected.js @@ -2,17 +2,18 @@ * Determines if an element is selected. * * 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('isSelected Demo', function() { * it('test isSelected', function(browser) { - * browser.element('#search') + * browser.element.find('#search') * .isSelected() * .assert.equals(true); * }); * * it('test async isSelected', async function(browser) { - * const result = await browser.element('#search').isSelected(); + * const result = await browser.element.find('#search').isSelected(); * browser.assert.equal(result, true); * }); * }); @@ -21,7 +22,7 @@ * @method isSelected * @memberof ScopedWebElement * @instance - * @syntax browser.element(selector).isSelected() + * @syntax browser.element.find(selector).isSelected() * @link /#is-element-selected * @returns {ScopedValue} */ diff --git a/lib/api/web-element/commands/isVisible.js b/lib/api/web-element/commands/isVisible.js index fe5cbc19e..e42654daf 100644 --- a/lib/api/web-element/commands/isVisible.js +++ b/lib/api/web-element/commands/isVisible.js @@ -2,15 +2,18 @@ * Determines if an element is visible. * * 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('isVisible demo', function() { * it('test isVisible', function(browser) { - * browser.element('#search').isVisible().assert.equals(true); + * browser.element.find('#search') + * .isVisible() + * .assert.equals(true); * }); * * it('test async isVisible', async function(browser) { - * const result = await browser.element('#search').isVisible(); + * const result = await browser.element.find('#search').isVisible(); * browser.assert.equal(result, true); * }); * }); @@ -19,7 +22,7 @@ * @method isVisible * @memberof ScopedWebElement * @instance - * @syntax browser.element(selector).isVisible() + * @syntax browser.element.find(selector).isVisible() * @link /#element-displayedness * @returns {ScopedValue} * @alias isDisplayed