Percy visual testing for Python Selenium.


npm install @percy/cli:

$ npm install --save-dev @percy/cli

pip install Percy selenium package:

$ pip install percy-selenium


This is an example test using the percy_snapshot function.

from percy import percy_snapshot

browser = webdriver.Firefox()
# take a snapshot
percy_snapshot(browser, 'Python example')

Running the test above normally will result in the following log:

[percy] Percy is not running, disabling snapshots

When running with percy exec, and your project's PERCY_TOKEN, a new Percy build will be created and snapshots will be uploaded to your project.

$ export PERCY_TOKEN=[your-project-token]
$ percy exec -- [python test command]
[percy] Percy has started!
[percy] Created build #1:[your-project]
[percy] Snapshot taken "Python example"
[percy] Stopping percy...
[percy] Finalized build #1:[your-project]
[percy] Done!


percy_snapshot(driver, name[, **kwargs])

Migrating Config

If you have a previous Percy configuration file, migrate it to the newest version with the config:migrate command:

$ percy config:migrate