-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
54 lines (46 loc) · 1.33 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = function (grunt) {
grunt.initConfig({
nightwatch: {
options: {
// Need to ensure that we have all the right target hiearchy to add to
// globals.
test_settings: {
default: {
exclude: doAuthenticated(),
// Assign some global variables values from the command line. Using
// grunt.options.
globals: {
authentication: {
userName: grunt.option('user'),
pW: grunt.option('pw'),
},
baseUrl: grunt.option('url'),
},
},
},
},
},
selenium_standalone: {
options: {
// Turns off selenium_standalone when done.
stopOnExit: true,
},
default: {
},
},
});
// Checks if we have user creds, if so, do all the tests.
function doAuthenticated() {
if (grunt.option('user') && grunt.option('pw')) {
// Exclude just known fails.
return 'tests/known_fails/*.js';
}
}
// Add selenium task.
grunt.loadNpmTasks('grunt-selenium-standalone');
// Add nightwatch task.
grunt.loadNpmTasks('grunt-nightwatch');
// Create a tests task that starts the selenium server, and runs nightwatch.
grunt.registerTask('tests', ['selenium_standalone:default:start',
'nightwatch',]);
};