Skip to content

Commit 10384ae

Browse files
authored
Fix page object demo examples in API docs. (#4210)
1 parent 5b74671 commit 10384ae

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

lib/api/element-commands/waitForElementNotPresent.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const WaitForElement = require('./_waitFor.js');
6262
* .navigate()
6363
* .assert.titleContains('Nightwatch.js');
6464
*
65-
* nightwatch.api.waitForElementNotPresent('@dialogContainer', function(result) {
65+
* nightwatch..waitForElementNotPresent('@dialogContainer', function(result) {
6666
* console.log(result);
6767
* });
6868
* }
@@ -99,14 +99,14 @@ class WaitForElementNotPresent extends WaitForElement {
9999
* @returns {Promise}
100100
*/
101101
elementFound(result) {
102-
let defaultMsg = 'Timed out while waiting for element <%s> to be removed for %d milliseconds.';
102+
const defaultMsg = 'Timed out while waiting for element <%s> to be removed for %d milliseconds.';
103103
result.passed = false;
104104

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

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

112112
return this.pass(result, defaultMsg, this.executor.elapsedTime);

lib/api/element-commands/waitForElementNotVisible.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const WaitForDisplayed = require('./_waitForDisplayed.js');
6262
* .navigate()
6363
* .assert.titleContains('Nightwatch.js');
6464
*
65-
* nightwatch.api.waitForElementNotVisible('@mainDialog', function(result) {
65+
* nightwatch.waitForElementNotVisible('@mainDialog', function(result) {
6666
* console.log(result);
6767
* });
6868
* }
@@ -93,13 +93,13 @@ class WaitForElementNotVisible extends WaitForDisplayed {
9393
}
9494

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

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

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

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

lib/api/element-commands/waitForElementPresent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const WaitForElement = require('./_waitFor.js');
6262
* .navigate()
6363
* .assert.titleContains('Nightwatch.js');
6464
*
65-
* nightwatch.api.waitForElementPresent('@featuresList', function(result) {
65+
* nightwatch.waitForElementPresent('@featuresList', function(result) {
6666
* console.log(result);
6767
* });
6868
* }

lib/api/element-commands/waitForElementVisible.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const WaitForDisplayed = require('./_waitForDisplayed.js');
6464
* .navigate()
6565
* .assert.titleContains('Nightwatch.js');
6666
*
67-
* nightwatch.api.waitForElementVisible('@featuresList', function(result) {
67+
* nightwatch.waitForElementVisible('@featuresList', function(result) {
6868
* console.log(result);
6969
* });
7070
* }
@@ -94,13 +94,13 @@ class WaitForElementVisible extends WaitForDisplayed {
9494
}
9595

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

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

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

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

types/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3403,7 +3403,7 @@ export interface ElementCommands {
34033403
* .navigate()
34043404
* .assert.titleContains('Nightwatch.js');
34053405
*
3406-
* nightwatch.api.waitForElementNotPresent('@dialogContainer', function(result) {
3406+
* nightwatch.waitForElementNotPresent('@dialogContainer', function(result) {
34073407
* console.log(result);
34083408
* });
34093409
* }
@@ -3498,7 +3498,7 @@ export interface ElementCommands {
34983498
* .navigate()
34993499
* .assert.titleContains('Nightwatch.js');
35003500
*
3501-
* nightwatch.api.waitForElementNotVisible('@mainDialog', function(result) {
3501+
* nightwatch.waitForElementNotVisible('@mainDialog', function(result) {
35023502
* console.log(result);
35033503
* });
35043504
* }
@@ -3591,7 +3591,7 @@ export interface ElementCommands {
35913591
* .navigate()
35923592
* .assert.titleContains('Nightwatch.js');
35933593
*
3594-
* nightwatch.api.waitForElementPresent('@featuresList', function(result) {
3594+
* nightwatch.waitForElementPresent('@featuresList', function(result) {
35953595
* console.log(result);
35963596
* });
35973597
* }

0 commit comments

Comments
 (0)