Skip to content

Commit

Permalink
Fix page object demo examples in API docs. (#4210)
Browse files Browse the repository at this point in the history
  • Loading branch information
garg3133 committed May 23, 2024
1 parent 5b74671 commit 10384ae
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/api/element-commands/waitForElementNotPresent.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const WaitForElement = require('./_waitFor.js');
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementNotPresent('@dialogContainer', function(result) {
* nightwatch..waitForElementNotPresent('@dialogContainer', function(result) {
* console.log(result);
* });
* }
Expand Down Expand Up @@ -99,14 +99,14 @@ class WaitForElementNotPresent extends WaitForElement {
* @returns {Promise}
*/
elementFound(result) {
let defaultMsg = 'Timed out while waiting for element <%s> to be removed for %d milliseconds.';
const defaultMsg = 'Timed out while waiting for element <%s> to be removed for %d milliseconds.';
result.passed = false;

return this.fail(result, 'found', this.expectedValue, defaultMsg);
}

elementNotFound(result) {
let defaultMsg = 'Element <%s> was not present after %d milliseconds.';
const defaultMsg = 'Element <%s> was not present after %d milliseconds.';
result.passed = true;

return this.pass(result, defaultMsg, this.executor.elapsedTime);
Expand Down
6 changes: 3 additions & 3 deletions lib/api/element-commands/waitForElementNotVisible.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const WaitForDisplayed = require('./_waitForDisplayed.js');
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementNotVisible('@mainDialog', function(result) {
* nightwatch.waitForElementNotVisible('@mainDialog', function(result) {
* console.log(result);
* });
* }
Expand Down Expand Up @@ -93,13 +93,13 @@ class WaitForElementNotVisible extends WaitForDisplayed {
}

elementVisible(response) {
let defaultMsg = 'Timed out while waiting for element <%s> to not be visible for %d milliseconds.';
const defaultMsg = 'Timed out while waiting for element <%s> to not be visible for %d milliseconds.';

return this.fail(response, 'visible', this.expectedValue, defaultMsg);
}

elementNotVisible(response) {
let defaultMsg = 'Element <%s> was not visible after %d milliseconds.';
const defaultMsg = 'Element <%s> was not visible after %d milliseconds.';

return this.pass(response, defaultMsg, this.executor.elapsedTime);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/api/element-commands/waitForElementPresent.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const WaitForElement = require('./_waitFor.js');
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementPresent('@featuresList', function(result) {
* nightwatch.waitForElementPresent('@featuresList', function(result) {
* console.log(result);
* });
* }
Expand Down
6 changes: 3 additions & 3 deletions lib/api/element-commands/waitForElementVisible.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const WaitForDisplayed = require('./_waitForDisplayed.js');
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementVisible('@featuresList', function(result) {
* nightwatch.waitForElementVisible('@featuresList', function(result) {
* console.log(result);
* });
* }
Expand Down Expand Up @@ -94,13 +94,13 @@ class WaitForElementVisible extends WaitForDisplayed {
}

elementVisible(response) {
let defaultMsg = 'Element <%s> was visible after %d milliseconds.';
const defaultMsg = 'Element <%s> was visible after %d milliseconds.';

return this.pass(response, defaultMsg, this.executor.elapsedTime);
}

elementNotVisible(response) {
let defaultMsg = 'Timed out while waiting for element <%s> to be visible for %d milliseconds.';
const defaultMsg = 'Timed out while waiting for element <%s> to be visible for %d milliseconds.';

return this.fail(response, 'not visible', this.expectedValue, defaultMsg);
}
Expand Down
6 changes: 3 additions & 3 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3403,7 +3403,7 @@ export interface ElementCommands {
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementNotPresent('@dialogContainer', function(result) {
* nightwatch.waitForElementNotPresent('@dialogContainer', function(result) {
* console.log(result);
* });
* }
Expand Down Expand Up @@ -3498,7 +3498,7 @@ export interface ElementCommands {
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementNotVisible('@mainDialog', function(result) {
* nightwatch.waitForElementNotVisible('@mainDialog', function(result) {
* console.log(result);
* });
* }
Expand Down Expand Up @@ -3591,7 +3591,7 @@ export interface ElementCommands {
* .navigate()
* .assert.titleContains('Nightwatch.js');
*
* nightwatch.api.waitForElementPresent('@featuresList', function(result) {
* nightwatch.waitForElementPresent('@featuresList', function(result) {
* console.log(result);
* });
* }
Expand Down

0 comments on commit 10384ae

Please sign in to comment.