Skip to content

Commit

Permalink
Refactor JSDoc for a few commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed Nov 10, 2024
1 parent 270ecbb commit e04ea6e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
5 changes: 3 additions & 2 deletions lib/api/web-element/commands/isActive.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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('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);
* });
* });
Expand Down
7 changes: 4 additions & 3 deletions lib/api/web-element/commands/isEnabled.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
* Determines if an element is enabled.
*
* 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('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);
* });
* });
Expand All @@ -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<boolean>}
*/
Expand Down
7 changes: 4 additions & 3 deletions lib/api/web-element/commands/isSelected.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
* 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.
* 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('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);
* });
* });
Expand All @@ -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<boolean>}
*/
Expand Down
9 changes: 6 additions & 3 deletions lib/api/web-element/commands/isVisible.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
* 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.
* 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('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);
* });
* });
Expand All @@ -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<boolean>}
* @alias isDisplayed
Expand Down

0 comments on commit e04ea6e

Please sign in to comment.