Writing automated acceptance tests using Jasmine, Protractor & Gulp is very popular. In this blog post, you will learn how to launch Selenium Webdriver Server automatically using Gulp Protractor without using seleniumServerJar and seleniumAddress in Protractor configuration file.
Protractor Configuration File
In Protractor configuration file, don’t add seleniumAddress and seleniumAddress
exports.config = { // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome' }, // Framework to use. Jasmine is recommended. framework: 'jasmine', specs: ['todo-spec.js'], jasmineNodeOpts: { defaultTimeoutInterval: 30000 } };
Gulpfile.js
var gulp = require('gulp'); var protractor = require("gulp-protractor").protractor; gulp.task("execute",function () { return gulp.src([]) .pipe(protractor({ configFile: "conf.js" })) .on('error', function(e) { throw e }) } );
Now you can run your Gulp task without starting or configuring in conf.js.
Comments(0)