Let protractor conf call selenium server directly:
'use strict';
exports.config = {
framework: 'jasmine',
// seleniumAddress: 'http://localhost:4444/wd/hub',
seleniumServerJar: '../node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.12.0.jar',
specs: ['spec.js']
}
Gruntfile:
module.exports = function(grunt) {
grunt.initConfig({
protractor: {
options: {
configFile: 'tests/conf.js',
noColor: false,
args: {
}
},
e2e: {
options: {
keepAlive: false
}
},
continuous: {
options: {
keepAlive: true
}
}
},
watch: {
options: {
livereload: true
},
protractor: {
files: ['tests/*.js'],
tasks: ['protractor:continuous']
}
},
run: {
mock_server: {
options: {
wait: false
},
args: []
// args: ['app/mockApi/apiserver.js']
}
},
connect: {
options: {
port: 9000,
hostname: 'localhost'
},
livereload: {
options: {
livereload: 35729,
open: true,
base: ['']
}
},
test: {
options: {
base: ['./']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.loadNpmTasks('grunt-run');
grunt.registerTask('default', ['connect:test', 'protractor:e2e']);
};
package.json:
{
"name": "calculator_protractor_demo",
"version": "1.0.0",
"description": "",
"main": "src/app.js",
"directories": {
"test": "tests"
},
"scripts": {
"grunt": "node_modules/.bin/grunt",
"test": "node_modules/.bin/protractor tests/conf.js",
"webdriver:update": "node_modules/.bin/webdriver-manager update",
"webdriver:start": "node_modules/.bin/webdriver-manager start"
},
"repository": {
"type": "git",
"url": "https://jsheridanwells.visualstudio.com/Calculator_Protractor_Demo/_git/Calculator_Protractor_Demo"
},
"author": "jsheridanwells",
"license": "MIT",
"dependencies": {
"angular": "^1.7.0",
"protractor": "^5.3.2",
"grunt": "1.0.3",
"grunt-contrib-connect": "1.0.2",
"grunt-contrib-watch": "1.1.0",
"grunt-protractor-runner": "5.0.0",
"grunt-run": "0.8.1",
"grunt-cli": "1.2.0"
}
}
Select Grunt task template.
- npm install
- npm run webdriver:update
- Run Grunt Task
- Archive Files Publish Artifacts: drop