How Can We Help?

< All Topics

WebdriverIO is test automation framework/tool for web and mobile application. It is open source and the underlying protocols are the same as Webdriver. WebdriverIO is getting popular especially for automation of React and Angular applications. Integration with Imagium for visual testing is very straight forward and is based on the following steps.

  • Get a unique runtime UID using GETUID API call – This would need a project key and a TestName (Choose any name)
  • Take a snapshot and convert it into Base64 string
  • Pass the Base64 (as generated above) to Validate API call to make the comparison
  • Results can be viewed on Imagium portal

Library

To do the setup use the following code as a supporting library . it contains two methods getUID and validate for their respective usage. You would need to specify the endpoint of your Imagium Instance and a projectKey.

TypeScript

Usage

Run the following code on and browser page where a snapshot is to be taken and sent to imagium. GetUID method should be called only once in a test case and the same uid should be used for subsequent steps by changing the step names. Creating a new uid will create a new testcase.

TypeScript

Dependencies

To pull the axios dependencies you can use the following npm commands

Shell