Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit d2cab1b

Browse files
author
jacobawenger
committed
Merged with master
2 parents ce5b7ec + 3d2cf53 commit d2cab1b

File tree

8 files changed

+152
-9
lines changed

8 files changed

+152
-9
lines changed

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@ node_js:
33
- '0.10'
44
addons:
55
sauce_connect: true
6+
before_install:
7+
- export DISPLAY=:99.0
8+
- sh -e /etc/init.d/xvfb start
69
install:
710
- git clone git://github.com/n1k0/casperjs.git ~/casperjs
811
- export PATH=$PATH:~/casperjs/bin
12+
- npm install -g grunt-cli
913
- npm install -g bower
1014
- npm install
1115
- bower install
1216
before_script:
17+
- grunt install
1318
- phantomjs --version
14-
- casperjs --version
1519
script:
16-
- npm run travis
20+
- sh ./tests/travis.sh
1721
env:
1822
global:
1923
- secure: mGHp1rQI11OvbBQn3PnBT5kuyo26gFl8U+nNq0Ot4opgSBX9JaHqS8Dx63uALWWU9qjy08/Mn68t/sKhayH1+XrPDIenOy/XEkkSAG60qAAowD9dRo3WaIMSOcWWYDeqdZOAWZ3LiXvjLO4Swagz5ejz7UtY/ws4CcTi2n/fp7c=

Gruntfile.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,22 @@ module.exports = function(grunt) {
9393
singlerun: {},
9494
watch: {
9595
autowatch: true,
96-
singleRun: false
96+
singleRun: false,
97+
},
98+
saucelabs: {
99+
configFile: 'tests/sauce_karma.conf.js'
97100
}
98101
},
99102

100103
// End to end (e2e) tests
101104
protractor: {
102105
options: {
103-
configFile: "tests/protractor.conf.js"
106+
configFile: "tests/local_protractor.conf.js"
104107
},
105108
singlerun: {},
106109
saucelabs: {
107110
options: {
111+
configFile: "tests/sauce_protractor.conf.js",
108112
args: {
109113
sauceUser: process.env.SAUCE_USERNAME,
110114
sauceKey: process.env.SAUCE_ACCESS_KEY
@@ -140,6 +144,14 @@ module.exports = function(grunt) {
140144
//grunt.registerTask('test:travis', ['build', 'test:unit', 'connect:testserver', 'protractor:saucelabs']);
141145
grunt.registerTask('test:travis', ['build', 'test:unit']);
142146

147+
// Sauce tasks
148+
grunt.registerTask('sauce:unit', ['karma:saucelabs']);
149+
grunt.registerTask('sauce:e2e', ['connect:testserver', 'protractor:saucelabs']);
150+
151+
// Watch tests
152+
grunt.registerTask('test:watch', ['karma:watch']);
153+
grunt.registerTask('test:watch:unit', ['karma:watch']);
154+
143155
// Build tasks
144156
grunt.registerTask('build', ['concat', 'jshint', 'uglify']);
145157

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,13 @@
4949
"karma": "~0.12.0",
5050
"karma-jasmine": "~0.2.0",
5151
"karma-phantomjs-launcher": "~0.1.0",
52+
"karma-sauce-launcher": "~0.2.9",
5253
"load-grunt-tasks": "~0.2.0",
53-
"protractor": "^0.23.1",
54+
"protractor": "^1.0.0",
5455
"karma-coverage": "^0.2.4",
5556
"karma-failed-reporter": "0.0.2",
5657
"jasmine-spec-reporter": "^0.4.0",
5758
"karma-spec-reporter": "0.0.13",
5859
"karma-chrome-launcher": "^0.1.4"
59-
},
60-
"scripts": {
61-
"travis": "grunt test:travis"
6260
}
6361
}

tests/browsers.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[
2+
{
3+
"name": "chrome",
4+
"version": "35",
5+
"platform": "OS X 10.9"
6+
},
7+
{
8+
"name": "firefox",
9+
"version": "30"
10+
},
11+
{
12+
"name": "safari",
13+
"platform": "OS X 10.9",
14+
"version": "7"
15+
},
16+
{
17+
"device": "iPhone",
18+
"name": "iphone",
19+
"platform": "OS X 10.9",
20+
"version": "7.1"
21+
},
22+
{
23+
"device": "Android",
24+
"name": "android",
25+
"platform": "linux",
26+
"version": "4.3"
27+
},
28+
{
29+
"name": "internet explorer",
30+
"platform": "Windows 8.1",
31+
"version": "11"
32+
},
33+
{
34+
"name": "internet explorer",
35+
"platform": "Windows 7",
36+
"version": "9"
37+
}
38+
]

tests/local_protractor.conf.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
exports.config = {
2+
// Locally, we should just use the default standalone Selenium server
3+
// In Travis, we set up the Selenium serving via Sauce Labs
4+
5+
// Tests to run
6+
specs: [
7+
'./protractor/**/*.spec.js'
8+
],
9+
10+
// Capabilities to be passed to the webdriver instance
11+
// For a full list of available capabilities, see https://code.google.com/p/selenium/wiki/DesiredCapabilities
12+
capabilities: {
13+
'browserName': 'firefox',
14+
},
15+
16+
// Calls to protractor.get() with relative paths will be prepended with the baseUrl
17+
baseUrl: 'http://localhost:3030/tests/protractor/',
18+
19+
// Selector for the element housing the angular app
20+
rootElement: 'body',
21+
22+
// Options to be passed to minijasminenode
23+
jasmineNodeOpts: {
24+
// onComplete will be called just before the driver quits.
25+
onComplete: null,
26+
// If true, display spec names.
27+
isVerbose: true,
28+
// If true, print colors to the terminal.
29+
showColors: true,
30+
// If true, include stack traces in failures.
31+
includeStackTrace: true,
32+
// Default time to wait in ms before a test fails.
33+
defaultTimeoutInterval: 20000
34+
}
35+
};

tests/sauce_karma.conf.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Configuration file for Karma
2+
// http://karma-runner.github.io/0.10/config/configuration-file.html
3+
4+
module.exports = function(config) {
5+
var customLaunchers = require('./browsers.json')
6+
.reduce(function (browsers, browser) {
7+
browsers[(browser.name + '_v' + browser.version).replace(/(\.|\s)/g, '_')] = {
8+
base: 'SauceLabs',
9+
browserName: browser.name,
10+
platform: browser.platform,
11+
version: browser.version
12+
};
13+
return browsers;
14+
}, {});
15+
var browsers = Object.keys(customLaunchers);
16+
17+
config.set({
18+
basePath: '',
19+
frameworks: ['jasmine'],
20+
files: [
21+
'../bower_components/angular/angular.js',
22+
'../bower_components/angular-mocks/angular-mocks.js',
23+
'../lib/omnibinder-protocol.js',
24+
'lib/lodash.js',
25+
'lib/MockFirebase.js',
26+
'../angularfire.js',
27+
'unit/**/*.spec.js'
28+
],
29+
30+
logLevel: config.LOG_INFO,
31+
32+
transports: ['xhr-polling'],
33+
34+
sauceLabs: {
35+
testName: 'angularFire Unit Tests',
36+
startConnect: false,
37+
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
38+
},
39+
40+
captureTimeout: 0,
41+
browserNoActivityTimeout: 120000,
42+
43+
//Recommend starting Chrome manually with experimental javascript flag enabled, and open localhost:9876.
44+
customLaunchers: customLaunchers,
45+
browsers: browsers,
46+
reporters: ['dots', 'saucelabs'],
47+
singleRun: true
48+
49+
});
50+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ exports.config = {
4747
// Default time to wait in ms before a test fails.
4848
defaultTimeoutInterval: 20000
4949
}
50-
};
50+
};

tests/travis.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
grunt test;
2+
if [ $SAUCE_ACCESS_KEY ]; then
3+
grunt sauce:unit
4+
grunt build
5+
#grunt sauce:e2e
6+
fi

0 commit comments

Comments
 (0)