Skip to content

Commit 29f21bf

Browse files
committed
Merge pull request #75 from BogdanLivadariu/added-travis
Enhancements for travis
2 parents 0e6c055 + 68a100a commit 29f21bf

File tree

6 files changed

+61
-34
lines changed

6 files changed

+61
-34
lines changed

.travis.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
sudo: false
2+
bundler_args: --retry 3
13
language: node_js
24
node_js:
3-
- "0.12"
4-
install: npm install
5-
before_script: npm install -g grunt-cli && webdriver-manager update
5+
- 0.12
6+
cache:
7+
directories:
8+
- node_modules/
9+
install:
10+
- npm set progress=false
11+
- travis_retry npm install
12+
before_script:
13+
- npm install -g grunt-cli
14+
script:
15+
- node_modules/grunt-protractor-runner/node_modules/.bin/webdriver-manager update
16+
- npm test

Gruntfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function(grunt) {
66
options: {
77
jshintrc: '.jshintrc',
88
},
9-
files: ['lib/**/*.js']
9+
files: ['lib/**/*.js']
1010
},
1111
jasmine_node: {
1212
options: {
@@ -18,7 +18,7 @@ module.exports = function(grunt) {
1818
connect: {
1919
example: {
2020
options: {
21-
base: 'example'
21+
base: 'example'
2222
}
2323
},
2424
'client-test': {
@@ -29,7 +29,7 @@ module.exports = function(grunt) {
2929
},
3030
protractor: {
3131
options: {
32-
configFile: 'example/protractor.conf',
32+
configFile: 'example/protractor-conf.js',
3333
//debug: true
3434
},
3535
example: {}

example/protractor-conf.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var config = {
2+
baseUrl: 'http://localhost:8000/',
3+
specs: [
4+
'spec/*.spec.js'
5+
],
6+
mocks: {
7+
dir: 'mocks',
8+
default: ['default']
9+
},
10+
onPrepare: function(){
11+
require('../index').config = {
12+
rootDirectory: __dirname
13+
}
14+
}
15+
};
16+
17+
if (process.env.TRAVIS) {
18+
//Run PhantomJS on Travis
19+
config.capabilities = {
20+
browserName: 'phantomjs',
21+
'phantomjs.binary.path': require('phantomjs').path,
22+
'phantomjs.ghostdriver.cli.args': ['--loglevel=DEBUG'],
23+
shardTestFiles: true,
24+
maxInstances: 2
25+
};
26+
} else {
27+
config.capabilities = {
28+
browserName: 'chrome'
29+
}
30+
config.chromeDriver= '../node_modules/protractor/selenium/chromedriver';
31+
}
32+
exports.config = config;

example/protractor.conf

Lines changed: 0 additions & 15 deletions
This file was deleted.

lib/defaultConfig.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module.exports = {
2-
moduleConfig: {
3-
rootDirectory: process.cwd(),
4-
protractorConfig: 'protractor.conf'
5-
},
6-
mocksConfig: {
7-
dir: 'mocks',
8-
defaults: []
9-
}
2+
moduleConfig: {
3+
rootDirectory: process.cwd(),
4+
protractorConfig: 'protractor-conf.js'
5+
},
6+
mocksConfig: {
7+
dir: 'mocks',
8+
defaults: []
9+
}
1010
};

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"description": "Mock HTTP calls in your protractor specs.",
55
"main": "index.js",
66
"scripts": {
7-
"example": "grunt example"
7+
"example": "grunt example",
8+
"test": "node_modules/.bin/grunt verify"
89
},
910
"author": "Carlos Atencio",
1011
"license": "BSD-2-Clause",
@@ -16,16 +17,14 @@
1617
"grunt-contrib-jshint": "~0.10.0",
1718
"grunt-jasmine-node": "~0.2.1",
1819
"grunt-protractor-runner": "^1.1.4",
19-
"protractor": "~1.5.0"
20+
"phantomjs": "2.1.3",
21+
"protractor": "2.5.1"
2022
},
2123
"repository": {
2224
"type": "git",
2325
"url": "https://github.com/atecarlos/protractor-http-mock"
2426
},
2527
"dependencies": {
2628
"query-string": "^1.0.0"
27-
},
28-
"scripts": {
29-
"test": "node_modules/.bin/grunt verify"
3029
}
3130
}

0 commit comments

Comments
 (0)