Evan You
9 years ago
6 changed files with 99 additions and 10 deletions
@ -0,0 +1,40 @@ |
|||
// http://nightwatchjs.org/guide#settings-file
|
|||
module.exports = { |
|||
"src_folders": ["test/e2e/specs"], |
|||
"output_folder": "test/e2e/reports", |
|||
"custom_assertions_path": ["test/e2e/custom-assertions"], |
|||
|
|||
"selenium": { |
|||
"start_process": true, |
|||
"server_path": "node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.0.jar", |
|||
"host": "127.0.0.1", |
|||
"port": 4444, |
|||
"cli_args": { |
|||
"webdriver.chrome.driver": require('chromedriver').path |
|||
} |
|||
}, |
|||
|
|||
"test_settings": { |
|||
"default": { |
|||
"selenium_port": 4444, |
|||
"selenium_host": "localhost", |
|||
"silent": true |
|||
}, |
|||
|
|||
"chrome": { |
|||
"desiredCapabilities": { |
|||
"browserName": "chrome", |
|||
"javascriptEnabled": true, |
|||
"acceptSslCerts": true |
|||
} |
|||
}, |
|||
|
|||
"firefox": { |
|||
"desiredCapabilities": { |
|||
"browserName": "firefox", |
|||
"javascriptEnabled": true, |
|||
"acceptSslCerts": true |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
var path = require('path') |
|||
var httpServer = require('http-server') |
|||
var server = httpServer.createServer({ |
|||
root: path.resolve(__dirname, '../../') |
|||
}) |
|||
|
|||
server.listen(8080) |
|||
|
|||
var spawn = require('cross-spawn') |
|||
var runner = spawn( |
|||
'./node_modules/.bin/nightwatch', |
|||
[ |
|||
'--config', 'build/nightwatch.config.js', |
|||
'--env', 'chrome,firefox' |
|||
], |
|||
{ |
|||
stdio: 'inherit' |
|||
} |
|||
) |
|||
|
|||
runner.on('exit', function (code) { |
|||
server.close() |
|||
process.exit(code) |
|||
}) |
|||
|
|||
runner.on('error', function (err) { |
|||
server.close() |
|||
throw err |
|||
}) |
@ -0,0 +1,9 @@ |
|||
module.exports = { |
|||
'markdown': function (browser) { |
|||
browser |
|||
.url('http://localhost:8080/examples/markdown/') |
|||
.waitForElementVisible('#editor', 1000) |
|||
.assert.elementPresent('#editor') |
|||
.end() |
|||
} |
|||
} |
Loading…
Reference in new issue