Skip to content

Commit

Permalink
Get Protractor tests partially working on Mac with Chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminapetersen committed Sep 15, 2017
1 parent 92bdb41 commit 43e9fd2
Show file tree
Hide file tree
Showing 7 changed files with 389 additions and 346 deletions.
46 changes: 26 additions & 20 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,8 @@ module.exports = function (grunt) {
// grunt test --browsers=Chrome,Firefox,Safari (be sure karma-<browser_name>-launcher is installed)
browsers: grunt.option('browsers') ?
grunt.option('browsers').split(',') :
['Firefox']
// ['Firefox']
['Nightmare']
},
unit: {
singleRun: true,
Expand All @@ -629,6 +630,7 @@ module.exports = function (grunt) {
baseUrl: grunt.option('baseUrl') || ("https://localhost:9000/" + contextRoot + "/")
}
},
// default is the same as above?
default: {
options: {
configFile: "test/protractor.conf.js",
Expand All @@ -638,15 +640,16 @@ module.exports = function (grunt) {
}
}
},
mac: {
options: {
configFile: "test/protractor-mac.conf.js",
args: {
baseUrl: grunt.option('baseUrl') || ("https://localhost:9000/" + contextRoot + "/"),
browser: grunt.option('browser') || "firefox"
}
}
}
// ideally we want to drop this.
// mac: {
// options: {
// configFile: "test/protractor-mac.conf.js",
// args: {
// baseUrl: grunt.option('baseUrl') || ("https://localhost:9000/" + contextRoot + "/"),
// browser: grunt.option('browser') || "firefox"
// }
// }
// }
},

// Settings for grunt-istanbul-coverage
Expand Down Expand Up @@ -745,16 +748,19 @@ module.exports = function (grunt) {

grunt.registerTask('test-integration',
grunt.option('baseUrl') ?
[isMac ? 'protractor:mac' : 'protractor:default'] : // if a baseUrl is defined assume we dont want to run the local grunt server
[
'clean:server',
'development-build',
'postcss',
'connect:test',
'add-redirect-uri',
(isMac ? 'protractor:mac' : 'protractor:default'),
'clean:server'
]
// if a baseUrl is defined assume we dont want to run the local grunt server
// [isMac ? 'protractor:mac' : 'protractor:default'] :
['protractor:default'] : // TODO:
[
'clean:server',
'development-build',
'postcss',
'connect:test',
'add-redirect-uri',
//(isMac ? 'protractor:mac' : 'protractor:default'),
'protractor:default',
'clean:server'
]
);

grunt.registerTask('build', [
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
"grunt-newer": "0.7.0",
"grunt-ng-annotate": "0.3.2",
"grunt-postcss": "^0.8.0",
"grunt-protractor-runner": "1.2.1",

"grunt-protractor-runner": "^5.0.0",

"grunt-replace": "1.0.1",
"grunt-svgmin": "0.4.0",
"grunt-usemin": "2.4.0",
Expand All @@ -48,7 +50,6 @@
"imagemin": "1.0.5",

"jasmine-core": "^2.8.0",
"jasmine-beforeall": "0.1.1",
"jasmine-spec-reporter": "1.1.2",

"jshint-stylish": "0.2.0",
Expand Down Expand Up @@ -82,6 +83,7 @@
"serve": "grunt serve",
"start": "grunt serve",
"test-integration": "grunt test-integration",
"postinstall": "webdriver-manager update",
"__postinstall": "node test/upgrade-selenium.js && node_modules/protractor/bin/webdriver-manager update",
"_postinstall": "node_modules/protractor/bin/webdriver-manager update"
}
Expand Down
1 change: 0 additions & 1 deletion test/integration/e2e.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

require('jasmine-beforeall');
var h = require('./helpers.js');

describe('', function() {
Expand Down
2 changes: 0 additions & 2 deletions test/integration/features/user_creates_from_url.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

require('jasmine-beforeall');

const h = require('../helpers');
const addExtension = require('../helpers/extensions').addExtension;
const resetExtensions = require('../helpers/extensions').resetExtensions;
Expand Down
8 changes: 8 additions & 0 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ module.exports = function(config) {
'karma-firefox-launcher',
'karma-chrome-launcher',
'karma-phantomjs-launcher',
'karma-nightmare',
'karma-ng-html2js-preprocessor',
'karma-jasmine',
'karma-coverage'
Expand Down Expand Up @@ -163,5 +164,12 @@ module.exports = function(config) {
// outputs the results of coverage reporter to this dir
dir: 'test-results/coverage/'
},

nightmareOptions: {
width: 1048,
height: 600,
show: false,
}

});
};
Loading

0 comments on commit 43e9fd2

Please sign in to comment.