-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a17b58
commit 212ba99
Showing
10 changed files
with
1,229 additions
and
73 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
logs/ | ||
tests/e2e/reports/ | ||
|
||
|
||
# local env files | ||
|
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
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,5 @@ | ||
module.exports = { | ||
rules: { | ||
'no-unused-expressions': 'off' | ||
} | ||
} |
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 @@ | ||
exports.assertion = {} |
Empty file.
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,104 @@ | ||
/////////////////////////////////////////////////////////////////////////////////// | ||
// Refer to the entire list of global config settings here: | ||
// https://github.com/nightwatchjs/nightwatch/blob/master/lib/settings/defaults.js#L16 | ||
// | ||
// More info on test globals: | ||
// https://nightwatchjs.org/gettingstarted/configuration/#test-globals | ||
// | ||
/////////////////////////////////////////////////////////////////////////////////// | ||
|
||
module.exports = { | ||
// this controls whether to abort the test execution when an assertion failed and skip the rest | ||
// it's being used in waitFor commands and expect assertions | ||
abortOnAssertionFailure: true, | ||
|
||
// this will overwrite the default polling interval (currently 500ms) for waitFor commands | ||
// and expect assertions that use retry | ||
waitForConditionPollInterval: 500, | ||
|
||
// default timeout value in milliseconds for waitFor commands and implicit waitFor value for | ||
// expect assertions | ||
waitForConditionTimeout: 5000, | ||
|
||
'default': { | ||
/* | ||
The globals defined here are available everywhere in any test env | ||
*/ | ||
|
||
/* | ||
myGlobal: function() { | ||
return 'I\'m a method'; | ||
} | ||
*/ | ||
}, | ||
|
||
'firefox': { | ||
/* | ||
The globals defined here are available only when the chrome testing env is being used | ||
i.e. when running with --env firefox | ||
*/ | ||
/* | ||
* myGlobal: function() { | ||
* return 'Firefox specific global'; | ||
* } | ||
*/ | ||
}, | ||
|
||
///////////////////////////////////////////////////////////////// | ||
// Global hooks | ||
// - simple functions which are executed as part of the test run | ||
// - take a callback argument which can be called when an async | ||
// async operation is finished | ||
///////////////////////////////////////////////////////////////// | ||
/** | ||
* executed before the test run has started, so before a session is created | ||
*/ | ||
/* | ||
before(cb) { | ||
//console.log('global before') | ||
cb(); | ||
}, | ||
*/ | ||
|
||
/** | ||
* executed before every test suite has started | ||
*/ | ||
/* | ||
beforeEach(browser, cb) { | ||
//console.log('global beforeEach') | ||
cb(); | ||
}, | ||
*/ | ||
|
||
/** | ||
* executed after every test suite has ended | ||
*/ | ||
/* | ||
afterEach(browser, cb) { | ||
browser.perform(function() { | ||
//console.log('global afterEach') | ||
cb(); | ||
}); | ||
}, | ||
*/ | ||
|
||
/** | ||
* executed after the test run has finished | ||
*/ | ||
/* | ||
after(cb) { | ||
//console.log('global after') | ||
cb(); | ||
}, | ||
*/ | ||
|
||
///////////////////////////////////////////////////////////////// | ||
// Global reporter | ||
// - define your own custom reporter | ||
///////////////////////////////////////////////////////////////// | ||
/* | ||
reporter(results, cb) { | ||
cb(); | ||
} | ||
*/ | ||
} |
Empty file.
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,41 @@ | ||
// For authoring Nightwatch tests, see | ||
// https://nightwatchjs.org/guide | ||
|
||
function testForm(browser) { | ||
browser | ||
.waitForElementVisible('#app') | ||
.expect.element('#app > div').text.to.equal('Count: 0. Count is even.') | ||
|
||
browser | ||
.useXpath() | ||
.click("//button[text()='Click']") | ||
.useCss() | ||
.expect.element('#app > div').text.to.equal('Count: 1. Count is odd.') | ||
|
||
browser | ||
.useXpath() | ||
.click("//button[text()='Click']") | ||
.useCss() | ||
.expect.element('#app > div').text.to.equal('Count: 2. Count is even.') | ||
} | ||
|
||
module.exports = { | ||
'default form interactivity': browser => { | ||
browser.init() | ||
|
||
testForm(browser); | ||
|
||
browser.expect.element('#pid').text.to.equal('PostID:') | ||
|
||
}, | ||
|
||
'post abc interactivity': browser => { | ||
browser | ||
.init() | ||
.url("http://localhost:8080/abc") | ||
|
||
testForm(browser); | ||
|
||
browser.useCss().expect.element('#pid').text.to.equal('PostID: abc') | ||
}, | ||
} |
Oops, something went wrong.