-
Notifications
You must be signed in to change notification settings - Fork 1
/
test-saucelabs
executable file
·37 lines (34 loc) · 1.06 KB
/
test-saucelabs
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
#!/usr/bin/env node
var username = process.env.SAUCELABS_USERNAME
var password = process.env.SAUCELABS_PASSWORD
var hostname = process.env.POLYFILLS_HOSTNAME || 'https://cdn.jsdelivr.net/polyfills'
var platforms = [
['win7', 'internet explorer', '11'],
['win7', 'internet explorer', '10'],
['win7', 'internet explorer', '9'],
['win7', 'chrome', 'latest'],
['win7', 'firefox', 'latest'],
['win7', 'opera', 'latest'],
['os x 10.9', 'safari', '7.1'],
['os x 10.9', 'safari', '7.0'],
['os x 10.9', 'safari', '6.2'],
['os x 10.9', 'safari', '6.1'],
['os x 10.9', 'safari', '6.0'],
['os x 10.9', 'safari', '5.1'],
]
var cp = require('child_process')
cp.exec([
'curl',
'https://saucelabs.com/rest/v1/' + username + '/js-tests',
'-X POST',
'-u ' + username + ':' + password,
'-H \'Content-Type: application/json\'',
'--data \'' + JSON.stringify({
platforms: platforms,
url: hostname + '/test.html',
framework: 'mocha',
}) + '\'',
].join(' '), function (err, stdout, stderr) {
if (err) console.log(stderr)
else console.log(stdout)
})