grunt-protractor-webdriver
Advanced tools
Comparing version
105
Gruntfile.js
@@ -10,45 +10,76 @@ /* | ||
module.exports = function(grunt) { | ||
// Project configuration. | ||
grunt.initConfig({ | ||
jshint: { | ||
all: [ | ||
'Gruntfile.js', | ||
'tasks/*.js' | ||
], | ||
options: { | ||
jshintrc: '.jshintrc' | ||
} | ||
}, | ||
module.exports = function (grunt) { | ||
grunt.loadTasks('tasks'); | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-protractor-runner'); | ||
grunt.loadNpmTasks('grunt-express'); | ||
grunt.loadNpmTasks('grunt-shell'); | ||
// Before generating any new files, remove any previously-created files. | ||
clean: { | ||
tests: ['tmp'] | ||
}, | ||
var path = require('path'), | ||
isWindows = process.platform === 'win32', | ||
ptorDir = 'node_modules' + (isWindows ? '/.' : '/protractor/') + 'bin/'; | ||
// Configuration to be run (and then tested). | ||
protractor_webdriver: { | ||
default_options: {}, | ||
custom_options: { | ||
options: { | ||
path: '', | ||
command: '' | ||
} | ||
} | ||
} | ||
}); | ||
// Project configuration. | ||
grunt.initConfig({ | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'tasks/*.js' | ||
] | ||
}, | ||
// Actually load this plugin's task(s). | ||
grunt.loadTasks('tasks'); | ||
express: { | ||
server: { | ||
options: { | ||
port: 9999, | ||
hostname: 'localhost', | ||
server: 'server' | ||
} | ||
} | ||
}, | ||
// These plugins provide necessary tasks. | ||
grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
grunt.loadNpmTasks('grunt-contrib-clean'); | ||
protractor_webdriver: { | ||
e2e: { | ||
options: { | ||
path: ptorDir | ||
} | ||
} | ||
}, | ||
// Whenever the "test" task is run, first clean the "tmp" dir, then run this | ||
// plugin's task(s), then test the result. | ||
grunt.registerTask('test', ['clean', 'protractor_webdriver']); | ||
protractor: { | ||
options: { | ||
configFile: 'protractor.conf.js', | ||
keepAlive: false | ||
}, | ||
local: {} | ||
}, | ||
// By default, lint and run all tests. | ||
grunt.registerTask('default', ['jshint', 'test']); | ||
shell: { | ||
protractor: { | ||
options: { | ||
stdout: true | ||
}, | ||
command: path.resolve(ptorDir + 'webdriver-manager') + ' update --standalone --chrome' | ||
} | ||
} | ||
}); | ||
grunt.registerTask('test', [ | ||
'default', | ||
'express:server', | ||
'shell:protractor', | ||
'protractor_webdriver:e2e', | ||
'protractor:local' | ||
]); | ||
grunt.registerTask('server', [ | ||
'express:server', | ||
'express-keepalive' | ||
]); | ||
grunt.registerTask('default', ['jshint']); | ||
}; |
{ | ||
"name": "grunt-protractor-webdriver", | ||
"description": "grunt plugin for starting Protractor's bundled Selenium Webdriver", | ||
"version": "0.1.4", | ||
"version": "0.1.6", | ||
"homepage": "https://github.com/seckardt/grunt-protractor-webdriver", | ||
@@ -27,9 +27,12 @@ "author": { | ||
"devDependencies": { | ||
"grunt-contrib-jshint": "~0.8.0", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"protractor": "~0.17.0", | ||
"grunt": "~0.4.2" | ||
"grunt-contrib-jshint": "~0.9.2", | ||
"grunt-protractor-runner": "~0.2.4", | ||
"grunt-express": "~1.2.1", | ||
"grunt-shell": "~0.6.4", | ||
"protractor": "~0.20.1", | ||
"express": "~3.4.8", | ||
"grunt": "~0.4.4" | ||
}, | ||
"peerDependencies": { | ||
"grunt": ">=0.4.0", | ||
"grunt": "~0.4.4", | ||
"protractor": ">=0.14.0" | ||
@@ -40,4 +43,6 @@ }, | ||
"protractor", | ||
"webdriver" | ||
"webdriver", | ||
"selenium", | ||
"testing" | ||
] | ||
} |
# grunt-protractor-webdriver [](https://david-dm.org/seckardt/grunt-protractor-webdriver#info=devDependencies) [](http://badge.fury.io/js/grunt-protractor-webdriver) [](http://gruntjs.com/) | ||
> grunt plugin for starting Protractor's bundled Selenium Webdriver | ||
> grunt plugin for starting [Protractor](https://github.com/angular/protractor)'s bundled [Selenium WebDriver](https://code.google.com/p/selenium/wiki/WebDriverJs) | ||
[](https://nodei.co/npm/grunt-protractor-webdriver.png?downloads=true&stars=true) | ||
This `Grunt` task starts a Selenium Webdriver, blocks until it's ready to accept connections, and then leaves it running in the background until the `Grunt` process finished. During startup it checks for already running Webdriver instances and at the end of the `Grunt` process also shuts down the Selenium server to not leave you with any zombies. | ||
This `Grunt` task starts a Selenium WebDriver, blocks until it's ready to accept connections, and then leaves it running in the background until the `Grunt` process finished. During startup it checks for already running WebDriver instances and at the end of the `Grunt` process also shuts down the Selenium server to not leave you with any zombies. | ||
`grunt-protractor-webdriver` is capable to handle parallelized tasks in case you use helpers like [`grunt-concurrent`](https://github.com/sindresorhus/grunt-concurrent). That way you are able to work around the missing feature in Protractor that it's currently not able to run the tests against multiple browsers in parallel. See the `Gruntfile.js` for an example on how to do that. | ||
## Getting Started | ||
@@ -51,3 +53,3 @@ | ||
Customize the way how the Selenium Webdriver is started. By default it assumes the presence of the `webdriver-manager` script (which comes bundled with `Protractor`) on the PATH. | ||
Customize the way how the Selenium WebDriver is started. By default it assumes the presence of the `webdriver-manager` script (which comes bundled with `Protractor`) on the `PATH`. | ||
@@ -59,3 +61,3 @@ #### options.path | ||
Customize the path to the actual command that starts the the Selenium Webdriver. By default it assumes the presence of your script on the PATH. | ||
Customize the path to the actual command that starts the the Selenium WebDriver. By default it assumes the presence of your script on the `PATH`. | ||
@@ -79,3 +81,3 @@ ### Usage Examples | ||
By default the output of the Selenium Webdriver is not being piped to the console by the `protractor_webdriver` task. In case you need detailed information about its state, just run your `Grunt` tasks with the `--verbose` flag. | ||
By default the output of the Selenium WebDriver is not being piped to the console by the `protractor_webdriver` task. In case you need detailed information about its state, just run your `Grunt` tasks with the `--verbose` flag. | ||
@@ -88,2 +90,4 @@ ## Contributing | ||
* v0.1.6 - No code changes. Updated test showcase to use `Protractor` v.20.1 | ||
* v0.1.5 - Unpublished due to wrong dependencies settings | ||
* v0.1.4 - No code changes. Just had to push new release as v0.1.3 seems to be lost in the NPM repo... | ||
@@ -90,0 +94,0 @@ * v0.1.3 - Fix regression of v0.1.2 with wrong Selenium server path being used. Add additional exit handlers for `.on('error')`, `.on('uncaughtException')` and `.on('SIGINT')`. |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1170942
7863.42%23
228.57%19669
7553.31%97
4.3%7
75%2
Infinity%4
100%