Skip to content

Commit b0fb9db

Browse files
committed
Added nightwatch.js test suite for confirming that the app loads correctly and can run operations from each module. Currently only support the latest version of Chrome.
1 parent c7e9115 commit b0fb9db

File tree

8 files changed

+910
-4
lines changed

8 files changed

+910
-4
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ trim_trailing_whitespace = true
99
indent_style = space
1010
indent_size = 4
1111

12-
[{package.json,.travis.yml}]
12+
[{package.json,.travis.yml,nightwatch.json}]
1313
indent_style = space
1414
indent_size = 2

.eslintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@
8787
"no-var": "error",
8888
"prefer-const": "error"
8989
},
90+
"overrides": [
91+
{
92+
"files": "tests/**/*",
93+
"rules": {
94+
"no-unused-expressions": "off",
95+
"no-console": "off"
96+
}
97+
}
98+
],
9099
"globals": {
91100
"$": false,
92101
"jQuery": false,

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ docs/*
99
src/core/config/modules/*
1010
src/core/config/OperationConfig.json
1111
src/core/operations/index.mjs
12+
tests/browser/output/*
1213

Gruntfile.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ module.exports = function (grunt) {
3030
["clean:node", "clean:config", "exec:generateConfig", "webpack:node", "chmod:build"]);
3131

3232
grunt.registerTask("test",
33-
"A task which runs all the tests in the tests directory.",
34-
["exec:generateConfig", "exec:tests"]);
33+
"A task which runs all the operation tests in the tests directory.",
34+
["exec:generateConfig", "exec:opTests"]);
35+
36+
grunt.registerTask("testui",
37+
"A task which runs all the UI tests in the tests directory. Requires the dev server to be running.",
38+
["exec:browserTests"]);
3539

3640
grunt.registerTask("docs",
3741
"Compiles documentation in the /docs directory.",
@@ -386,8 +390,11 @@ module.exports = function (grunt) {
386390
"echo '--- Config scripts finished. ---\n'"
387391
].join(";")
388392
},
389-
tests: {
393+
opTests: {
390394
command: "node --experimental-modules --no-warnings --no-deprecation tests/operations/index.mjs"
395+
},
396+
browserTests: {
397+
command: "./node_modules/.bin/nightwatch --env chrome"
391398
}
392399
},
393400
});

nightwatch.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"src_folders": ["tests/browser"],
3+
"output_folder": "tests/browser/output",
4+
5+
"test_settings": {
6+
7+
"default": {
8+
"launch_url": "http://localhost:8080",
9+
"webdriver": {
10+
"start_process": true,
11+
"log_path": false
12+
}
13+
},
14+
15+
"chrome": {
16+
"webdriver": {
17+
"server_path": "./node_modules/.bin/chromedriver",
18+
"port": 9515
19+
},
20+
"desiredCapabilities": {
21+
"browserName": "chrome"
22+
}
23+
}
24+
25+
}
26+
}
27+

0 commit comments

Comments
 (0)