-
Notifications
You must be signed in to change notification settings - Fork 9
/
Gruntfile.js
58 lines (51 loc) · 1.45 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
55
56
57
58
/*
* grunt-selenium-standalone
* https://github.com/zs-zs/grunt-selenium-standalone
*
* Copyright (c) 2015-2016 zs-zs
* Licensed under the MIT license.
*/
'use strict';
var automatedBrowsers = require('./test/automatedBrowsers.json');
module.exports = function(grunt) {
var testDrivers = {};
Object.keys(automatedBrowsers).forEach(function(browserName) {
var automationConfig = automatedBrowsers[browserName];
testDrivers[browserName] = {
version: automationConfig.version,
arch: process.arch,
downloadURL: automationConfig.downloadURL
};
});
grunt.initConfig({
eslint: {
target: ['*.js']
},
// Configuration to run the tests
'selenium_standalone': {
testConfig: {
seleniumVersion: '2.53.0',
seleniumDownloadURL: 'http://selenium-release.storage.googleapis.com',
drivers: testDrivers
}
},
// Integration tests
nodeunit: {
server_should_run: ['test/server_should_run.js'],
server_should_not_run: ['test/server_should_not_run.js']
}
});
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.registerTask('test', [
'eslint',
'nodeunit:server_should_not_run',
'selenium_standalone:testConfig:install',
'nodeunit:server_should_not_run',
'selenium_standalone:testConfig:start',
'nodeunit:server_should_run', // server should be up and running at this point
'selenium_standalone:testConfig:stop',
'nodeunit:server_should_not_run'
]);
};