WDIO Webpack Dev Server Service
This allows you to run a local server with your built static assets using Webpack Dev Server before testing.
Installation
1
| npm install wdio-webpack-dev-server-service --save-dev
|
Configuration
This assumes you have:
Add the Webpack Dev Server service to your WebdriverIO services list:
1 2 3 4 5 6
| export.config = { services: ['webpack-dev-server'], };
|
Options are set directly on your WebdriverIO config as well, e.g.
1 2 3 4 5 6 7
| export.config = { webpackConfig: require('webpack.dev.config.js'), webpackPort: 8080, };
|
Options
webpackConfig
Type: String
| Object
Default: webpack.config.js
Either the absolute path to your Webpack configuration, or your actual Webpack configuration.
webpackPort
Type: Number
Default: 8080
The port the Dev Server should be run on. You’ll want to set this same port in the baseUrl
option of your WebdriverIO configuration.