protractor-webpack
v1.1.0
Published
Synchronizes Protractor test runs with serving a Webpack bundle
Downloads
66
Readme
protractor-webpack
Installation
npm install --save-dev protractor-webpack
Programatic Usage
The run
function will serve the Webpack bundle and run the Protractor tests. It requires two arguments: the Webpack config as a JSON object and the path to the Protractor config.
var webpackConfig = require('./webpack.config.json');
var runner = require('protractor-webpack');
runner.run('./protractor.conf.js', webpackConfig);
CLI Usage
TODO - Add documentation
Credit
This project is heavily influenced by the work done in angular-cli. They use the webpack-dev-server
to serve the application for test and call to the Protractor launcher directly to execute the tests. To wire everything together, they simply create a callback function to launch the protractor test and synchronize it with the webpack build by passing it is a plugin on 'done'.
The issue with angular-cli is that it blindly refuses to build an ejected project, and rather than allow for running the tests from the webpack config.