Skip to content

Commit 684da06

Browse files
committed
configure travis to trigger cross-browser saucelabs tests
1 parent 55c69fe commit 684da06

7 files changed

Lines changed: 50 additions & 9 deletions

File tree

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ language: php
22
php:
33
- 5.6
44

5-
env:
6-
global:
7-
- secure: kggQMkI+fvr0W6d24m6r4sOBoMu4isg38WZ7dDaZD3CPZe44faGL/uSmrWLw9F8q6T7FxvUF4Zu31NG5X4JHddx9oPxDLTmwfC2pPjhOntOON4L6Ga1gpAyA8u2KuXnrjK+F5vHbv8G46L7+s7eRP23L9HHRfeiLWALlOx7nlTY=
8-
- secure: a5mc0IQzxZzippCm8pIJWRw48p3lLAoJD734ueD+CUxDh7uEr5kbKg32tUzL6+aHauJIIbRgKV75DXHO/kzv3ChzQqtGhOtJxzgLMNcjl7IXQpSXAXXwyjy/LWsLPCxKLr574OM7dWlUBx0bT/9JVY66TnwB6rbw3EpyQkDn63s=
9-
105
addons:
116
sauce_connect: true
127

@@ -29,4 +24,4 @@ before_script:
2924
- grunt
3025

3126
script:
32-
- grunt test
27+
- grunt travis

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
21
module.exports = function(grunt) {
3-
require('grunt-loader').load(grunt);
2+
grunt.loadNpmTasks('grunt-saucelabs');
3+
require('grunt-loader').load(grunt);
44
};

grunt/saucelabs-qunit.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
all:
2+
options:
3+
urls:
4+
- localhost:8888/tests/index.html
5+
build: '1'
6+
testname: hook-javascript client tests
7+
browsers:
8+
- browserName: 'firefox'
9+
version: '19'
10+
platform: 'XP'
11+
- browserName: 'chrome'
12+
version: '31'
13+
- browserName: 'internet explorer'
14+
version: '8'

grunt/tasks/test.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
- connect
22
- qunit
3-

grunt/tasks/travis.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- connect
2+
- saucelabs-qunit

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"grunt-contrib-uglify": "*",
2727
"grunt-contrib-qunit": "*",
2828
"grunt-contrib-connect": "*",
29+
"grunt-saucelabs": "~8.3.2",
2930
"grunt-loader": "0.2.1"
3031
}
3132
}

tests/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,36 @@
3535
<!-- devDependencies -->
3636
<script type="text/javascript" src="../bower_components/qunit/qunit/qunit.js"></script>
3737

38+
<script type="text/javascript">
39+
var log = [];
40+
var testName;
41+
42+
QUnit.done(function (test_results) {
43+
var tests = [];
44+
for(var i = 0, len = log.length; i < len; i++) {
45+
var details = log[i];
46+
tests.push({
47+
name: details.name,
48+
result: details.result,
49+
expected: details.expected,
50+
actual: details.actual,
51+
source: details.source
52+
});
53+
}
54+
test_results.tests = tests;
55+
window.global_test_results = test_results;
56+
});
57+
58+
QUnit.testStart(function(testDetails){
59+
QUnit.log(function(details){
60+
if (!details.result) {
61+
details.name = testDetails.name;
62+
log.push(details);
63+
}
64+
});
65+
});
66+
</script>
67+
3868
<script src="api.js"></script>
3969

4070
<!-- Collections -->

0 commit comments

Comments
 (0)