Contract tests for Mugshot's various interfaces
npm install @mugshot/contracts
yarn add @mugshot/contracts
Implementing your own Webdriver adapter
Mugshot ships with a few adapters for the most popular webdriver clients, but if you need something else then you can easily write your own. You need to implement the [[Webdriver]] interface by providing a way to take screenshots, get element geometry and execute scripts on the page.
To validate your implementation you can run the [[webdriverContractSuites]]. Each suite consists of a number of tests that need your adapter implementation and a way to set up the test environment. See the example below for [[PuppeteerAdapter]] to understand how to run the tests: