Percy visual testing for Python Selenium.
- Install
@percy/agentfrom NPM:npm i -D @percy/agent - Install the Python SDK:
pip install percy-python-selenium - Import
percySnapshotin your test file:from percy import percySnapshot - Add a
percySnapshotcall to your test:
from percy import percySnapshot
browser = webdriver.Firefox()
browser.get('http://example.com')
# take a snapshot
percySnapshot(browser=browser, name='Home page')- Set your
PERCY_TOKENin the current env (you can get this in your Percy project settings) - Run your tests with
percy exec -- [test command]:npx percy exec -- python ./tests.py(oryarn percy exec -- python ./tests.py)