wdio-viewport-size

1.0.1 • Public • Published

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

  1. Install the package:
npm install --save-dev wdio-viewport-size
  1. Import the service and add it to your wdio.conf.js file:
const { ViewportSizeService } = require('wdio-viewport-size');
 
exports.config = {
  // other configuration
    services: [
        [ViewportSizeService]
    ]
}
  1. Use available commands:
browser.getViewport()Promise<{ widthnumber, heightnumber }>
browser.setViewport(widthnumber, heightnumber)Promise<void>

Package Sidebar

Install

npm i wdio-viewport-size

Weekly Downloads

92

Version

1.0.1

License

MIT

Unpacked Size

8.1 kB

Total Files

15

Last publish

Collaborators

  • dpoetzsch