forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…inside section for the section element to be gone
- Loading branch information
1 parent
068a1ba
commit f02fce6
Showing
4 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/extra/pageobjects/pages/waitForElementNotPresentPageObj.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = { | ||
commands: [{ | ||
waitForElementNotPresentDemo(cb) { | ||
this.click("@button") | ||
const dialog = this.section.dialog; | ||
dialog.selectValueDemo(cb) | ||
} | ||
}], | ||
elements: { | ||
button: "#weblogin" | ||
}, | ||
sections: { | ||
dialog: { | ||
selector: "#weblogin", | ||
elements: { | ||
select: "#badElement", | ||
}, | ||
commands: [{ | ||
selectValueDemo(cb) { | ||
this.waitForElementNotPresent("@select", cb); | ||
}, | ||
}] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
const assert = require('assert'); | ||
const path = require('path'); | ||
const Nocks = require('../../lib/nocks.js'); | ||
const Nightwatch = require('../../lib/nightwatch.js'); | ||
|
||
describe('test PageObject WaitForElementNotPresent', function () { | ||
beforeEach(function (done) { | ||
Nocks.enable().cleanAll().createSession(); | ||
Nightwatch.init({ | ||
page_objects_path: path.join(__dirname, '../../extra/pageobjects/pages'), | ||
}, function () { | ||
done(); | ||
}); | ||
this.client = Nightwatch.client(); | ||
}); | ||
|
||
afterEach(function () { | ||
Nocks.deleteSession().disable(); | ||
}); | ||
|
||
it('WaitForElementNotPresent with section', function(done) { | ||
Nocks.elementFound().click().elementFound().childElementFound().elementFound().childElementNotFound() | ||
|
||
const page = this.client.api.page.waitForElementNotPresentPageObj(); | ||
|
||
page.waitForElementNotPresentDemo(function(result) { | ||
assert.equal(result.status, 0); | ||
done(); | ||
}) | ||
|
||
this.client.start() | ||
}); | ||
}); | ||
|