-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
168 lines (157 loc) · 2.87 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
var request = require('request');
var safari_browsers = [
{
browserName: 'safari',
platform: 'OS X 10.10',
version: '8.0'
}
];
var chrome_browsers = [
{
browserName: 'chrome',
platform: 'OS X 10.10',
version: '44.0'
},
{
browserName: 'chrome',
platform: 'Windows 10',
version: '43.0'
},
{
browserName: 'chrome',
platform: 'Linux',
version: '42.0'
}
];
var firefox_browsers = [
{
browserName: 'firefox',
platform: 'Windows 10',
version: '40.0'
},
{
browserName: 'firefox',
platform: 'OS X 10.10',
version: '39.0'
},
{
browserName: 'firefox',
platform: 'Linux',
version: '38.0'
}
];
var ios_browsers = [
{
browserName: 'iphone',
deviceName: 'iPhone Simulator',
deviceOrientation: 'portrait',
platform: 'OS X 10.10',
version: '8.4'
}
];
var android_browsers = [
{
browserName: 'android',
deviceName: 'Android Emulator',
deviceOrientation: 'portrait',
platform: 'Linux',
version: '5.1'
},
{
browserName: 'android',
deviceName: 'Google Nexus 7 HD Emulator',
deviceOrientation: 'portrait',
platform: 'Linux',
version: '4.4'
},
{
browserName: 'android',
deviceName: 'Google Nexus 7C Emulator',
deviceOrientation: 'portrait',
platform: 'Linux',
version: '4.3'
},
{
browserName: 'android',
deviceName: 'LG Nexus 4 Emulator',
deviceOrientation: 'portrait',
platform: 'Linux',
version: '4.2'
},
{
browserName: 'android',
deviceName: 'HTC One X Emulator',
deviceOrientation: 'portrait',
platform: 'Linux',
version: '4.1'
},
{
browserName: 'android',
deviceName: 'HTC Evo 3D Emulator',
deviceOrientation: 'portrait',
platform: 'Linux',
version: '4.0'
}
];
var ie_browsers = [
{
browserName: 'internet explorer',
platform: 'Windows 10',
version: '11.0'
},
{
browserName: 'internet explorer',
platform: 'Windows 8.1',
version: '11.0'
},
{
browserName: 'internet explorer',
platform: 'Windows 7',
version: '10.0'
}
];
var test_urls = [
'http://0.0.0.0:9999/test/test.html',
'http://0.0.0.0:9999/test/integration-test.html'
];
module.exports = function(grunt) {
grunt.initConfig({
'saucelabs-mocha': {
all: {
options: {
username: 'branchmetrics',
urls: test_urls,
maxRetries: 3,
testname: 'Web SDK Tests',
browsers: [].concat(
safari_browsers,
chrome_browsers,
// firefox_browsers,
android_browsers,
ios_browsers,
ie_browsers)
}
},
options: {
force: true
}
},
connect: {
server: {
options: {
port: 9999,
base: ''
}
}
}
});
// Loading dependencies
for (var key in grunt.file.readJSON("package.json").devDependencies) {
if (key !== "grunt" && key.indexOf("grunt") === 0) {
grunt.loadNpmTasks(key);
}
}
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('test', ['connect', 'saucelabs-mocha']);
};