Skip to content

Commit 074408f

Browse files
authored
percy tests (#1758)
Added percy visual tests, using a Python scripts to generate a collection of html files to be checked by percy. Note that animation auto_play must be turned off.
1 parent 944af4a commit 074408f

File tree

2 files changed

+478
-0
lines changed

2 files changed

+478
-0
lines changed

Diff for: .circleci/config.yml

+33
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,38 @@ jobs:
7979
command: 'cd packages/python/plotly; tox -e py37-core'
8080
no_output_timeout: 20m
8181

82+
python-3.7-percy:
83+
docker:
84+
- image: circleci/python:3.7-stretch-node-browsers
85+
environment:
86+
PERCY_ENABLED: True
87+
PERCY_PROJECT: plotly/plotly.py
88+
89+
steps:
90+
- checkout
91+
- run:
92+
name: Inject Percy Environment variables
93+
command: |
94+
echo 'export PERCY_TOKEN="$PERCY_PYTHON_TOKEN_V0"' >> $BASH_ENV
95+
- run:
96+
name: Install requirements
97+
command: |
98+
sudo pip install --upgrade virtualenv
99+
python -m venv venv || virtualenv venv
100+
. venv/bin/activate
101+
pip install -e ./packages/python/plotly
102+
- run:
103+
name: Build html figures
104+
command: |
105+
. venv/bin/activate
106+
pip install pandas statsmodels --quiet
107+
python test/percy/plotly-express.py
108+
- run:
109+
name: Run percy snapshots
110+
command: |
111+
npx percy snapshot test/percy/
112+
rm test/percy/*.html
113+
82114
# Optional
83115
python-2.7-optional:
84116
docker:
@@ -367,6 +399,7 @@ workflows:
367399
- python-3.5-core
368400
- python-3.6-core
369401
- python-3.7-core
402+
- python-3.7-percy
370403
- python-2.7-optional
371404
- python-3.5-optional
372405
- python-3.6-optional

0 commit comments

Comments
 (0)