Skip to main content

Configuration

The configuration has to be specified in a pupille.config.js file, placed at the root of your project.

baseUrl

This property is mandatory. You have to define the base url pupille should check. This allows you to specify different domains or ports depending on the environment.

root

This property is optional, and allows you to specify which folder pupille screenshots should live in. Default value is pupille.

prepare

This property is optional, and allows you to specify a function to be run before each test. It should return a Promise, and takes a Page as the only parameter.

resolutions

This property is optional, and allows you to specify which resolution(s) you want the screenshots to be taken in. It is an array of a tuple containing the width and the height. You can list as many resolutions as you want. Each resolution will require a new page load. The default value is [[1920, 1080]]

tests

The main section of the configuration is found under the tests property. It's an array containing every page to be tested.

url

This property is mandatory. It specifies the URL to be tested.

waitFor

This property is optional, and is used to specify one or more selectors to wait for before taking the screenshot. It is useful if you need Pupille to wait for some asynchronous data to load before the page is ready. It can either be a string or an array of strings.

prepare

This property is optional, and allows you to specify a function to be run before the test. It should return a Promise, and takes a Page as the only parameter.