Hers is How You Can Integrate Percy with Selenium Python Tests
Step by step tutorial to Integrate Percy with Selenium Python Tests
Setup @percy/cli (currently only available from NPM). This package handles all of the processing and interactions with Percy's API:
Install the Python package for Percy-Selenium:
Step 1: Import the percy snapshot function from the percy_selenium package into your test in order to begin taking snapshots of your Selenium tests.
Step 2: You can now add visual tests to your current testing framework:
Step 3: Lastly, use the percy exec command to enclose your test runner command. In order to receive snapshots from your Python Selenium tests, this will launch a local Percy server. Following processing, the snapshots are then uploaded to your Percy dashboard. Percy exec -- python tests.py might be used as an illustration.
Percy needs the PERCY TOKEN environment variable specified before it can be effectively launched:
Now you should be able to run percy exec. For example:
Remember to include a double-dash, --, between your test run command and percy exec.
Done! Now, everytime you execute a test with Percy, Percy will upload a snapshot of the app in that state for visual regression testing!
Comments
Post a Comment