Skip to content

Commit

Permalink
Added nightwatch.js test suite for confirming that the app loads corr…
Browse files Browse the repository at this point in the history
…ectly and can run operations from each module. Currently only support the latest version of Chrome.
  • Loading branch information
n1474335 committed Dec 29, 2018
1 parent c7e9115 commit b0fb9db
Show file tree
Hide file tree
Showing 8 changed files with 910 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ trim_trailing_whitespace = true
indent_style = space
indent_size = 4

[{package.json,.travis.yml}]
[{package.json,.travis.yml,nightwatch.json}]
indent_style = space
indent_size = 2
9 changes: 9 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@
"no-var": "error",
"prefer-const": "error"
},
"overrides": [
{
"files": "tests/**/*",
"rules": {
"no-unused-expressions": "off",
"no-console": "off"
}
}
],
"globals": {
"$": false,
"jQuery": false,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ docs/*
src/core/config/modules/*
src/core/config/OperationConfig.json
src/core/operations/index.mjs
tests/browser/output/*

13 changes: 10 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ module.exports = function (grunt) {
["clean:node", "clean:config", "exec:generateConfig", "webpack:node", "chmod:build"]);

grunt.registerTask("test",
"A task which runs all the tests in the tests directory.",
["exec:generateConfig", "exec:tests"]);
"A task which runs all the operation tests in the tests directory.",
["exec:generateConfig", "exec:opTests"]);

grunt.registerTask("testui",
"A task which runs all the UI tests in the tests directory. Requires the dev server to be running.",
["exec:browserTests"]);

grunt.registerTask("docs",
"Compiles documentation in the /docs directory.",
Expand Down Expand Up @@ -386,8 +390,11 @@ module.exports = function (grunt) {
"echo '--- Config scripts finished. ---\n'"
].join(";")
},
tests: {
opTests: {
command: "node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs"
},
browserTests: {
command: "./node_modules/.bin/nightwatch --env chrome"
}
},
});
Expand Down
27 changes: 27 additions & 0 deletions nightwatch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"src_folders": ["tests/browser"],
"output_folder": "tests/browser/output",

"test_settings": {

"default": {
"launch_url": "http://localhost:8080",
"webdriver": {
"start_process": true,
"log_path": false
}
},

"chrome": {
"webdriver": {
"server_path": "./node_modules/.bin/chromedriver",
"port": 9515
},
"desiredCapabilities": {
"browserName": "chrome"
}
}

}
}

Loading

0 comments on commit b0fb9db

Please sign in to comment.