WebdriverIO Viewport Size
This is a port of the old setViewportSize
function of webdriverio v4 to webdriverio v5.
It allows setting the size of the viewport which is helpful for consistent visual regression testing.
Usage
- Install the package:
npm install --save-dev wdio-viewport-size
- Import the service and add it to your
wdio.conf.js
file:
const ViewportSizeService = ; exportsconfig = // other configuration services: ViewportSizeService
- Use available commands:
browser.getViewport: Promise<>browser.setViewportwidth: number, height: number: Promise<void>