Python client for visual testing with Percy
Project description
percy-selenium-python
Percy visual testing for Python Selenium.
Installation
npm install @percy/cli
:
$ npm install --save-dev @percy/cli
pip install Percy selenium package:
$ pip install percy-selenium
Usage
This is an example test using the percy_snapshot
function.
from percy import percy_snapshot
browser = webdriver.Firefox()
browser.get('http://example.com')
# 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: https://percy.io/[your-project]
[percy] Snapshot taken "Python example"
[percy] Stopping percy...
[percy] Finalized build #1: https://percy.io/[your-project]
[percy] Done!
Configuration
percy_snapshot(driver, name[, **kwargs])
driver
(required) - A selenium-webdriver driver instancename
(required) - The snapshot name; must be unique to each snapshot**kwargs
- See per-snapshot configuration options
Migrating Config
If you have a previous Percy configuration file, migrate it to the newest version with the
config:migrate
command:
$ percy config:migrate
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
percy-selenium-1.0.5.tar.gz
(4.3 kB
view hashes)
Built Distribution
Close
Hashes for percy_selenium-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de64b4531a61f3eacd2d0eca331f74893ea835d1576cb087b5aeaecea7bcf84d |
|
MD5 | 87b8c98440ba1764e77c132a3bbdbb37 |
|
BLAKE2b-256 | be45cdfb91b7a8b296df4b605e5b0ea31ac3946a22dea8618cd2bf18f6693df5 |