Skip to content

Commit

Permalink
Add Playwright to requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jul 23, 2023
1 parent 7476d3d commit 033ef34
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ jobs:
- name: Install Python dependencies (3.7)
if: ${{ matrix.python-version == '3.7' }}
run: make install-python-test-37
- name: Ensure browsers are installed
run: python -m playwright install --with-deps
- name: Install Playwright browser
run: playwright install firefox --with-deps
- name: Install Node
uses: actions/setup-node@v3
with:
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ all:
@echo
@echo "For testing and CI:"
@echo " make install-test # Install everything needed for a test environment"
@echo " make install-playwright # Install browsers for Playwright-based tests"
@echo
@echo "For development:"
@echo " make install-dev # For first time setup and after dependency upgrades"
Expand Down Expand Up @@ -132,9 +133,18 @@ install-python-test-37: install-python-pip deps-editable
install-python-37: install-python-pip deps-editable
pip install --use-pep517 -r requirements/base.py37.txt

install-dev: deps-editable install-python-dev install-npm assets
install-playwright:
@if command -v playwright > /dev/null; then\
echo "playwright install --with-deps";\
playwright install --with-deps;\
else\
echo "Install Playwright first: make install-python-test";\
exit 1;\
fi

install-test: deps-editable install-python-test install-npm assets
install-dev: deps-editable install-python-dev install-playwright install-npm assets

install-test: deps-editable install-python-test install-playwright install-npm assets

install: deps-editable install-python install-npm-ci assets

Expand Down
2 changes: 2 additions & 0 deletions requirements/test.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ coverage
coveralls
lxml
mock;python_version=="3.7"
playwright
Pygments
pytest
pytest-asyncio
pytest-bdd
pytest-cov
pytest-dotenv
pytest-env
pytest-playwright
pytest-rerunfailures
pytest-selenium>=4.0.1
pytest-socket
Expand Down
19 changes: 17 additions & 2 deletions requirements/test.py37.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:210785110b0bd0694e5a75e2f1c15924908a21c4
# SHA1:c6ac172b4b9707e36b45d4c91cca650ab0a7dd5d
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand Down Expand Up @@ -37,10 +37,16 @@ parse==1.19.1
# pytest-bdd
parse-type==0.6.2
# via pytest-bdd
playwright==1.35.0
# via
# -r requirements/test.in
# pytest-playwright
pluggy==1.2.0
# via pytest
py==1.11.0
# via pytest-html
pyee==9.0.4
# via playwright
pytest==7.4.0
# via
# -r requirements/test.in
Expand All @@ -52,14 +58,17 @@ pytest==7.4.0
# pytest-env
# pytest-html
# pytest-metadata
# pytest-playwright
# pytest-rerunfailures
# pytest-selenium
# pytest-socket
# pytest-variables
pytest-asyncio==0.21.1
# via -r requirements/test.in
pytest-base-url==2.0.0
# via pytest-selenium
# via
# pytest-playwright
# pytest-selenium
pytest-bdd==6.1.1
# via -r requirements/test.in
pytest-cov==4.1.0
Expand All @@ -72,6 +81,8 @@ pytest-html==3.2.0
# via pytest-selenium
pytest-metadata==3.0.0
# via pytest-html
pytest-playwright==0.3.3
# via -r requirements/test.in
pytest-rerunfailures==12.0
# via -r requirements/test.in
pytest-selenium==4.0.1
Expand All @@ -80,6 +91,8 @@ pytest-socket==0.6.0
# via -r requirements/test.in
pytest-variables==3.0.0
# via pytest-selenium
python-slugify==8.0.1
# via pytest-playwright
requests-mock==1.11.0
# via -r requirements/test.in
respx==0.20.2
Expand All @@ -96,6 +109,8 @@ sttable==0.0.1
# via -r requirements/test.in
tenacity==8.2.2
# via pytest-selenium
text-unidecode==1.3
# via python-slugify
tomli==2.0.1
# via
# coverage
Expand Down
21 changes: 19 additions & 2 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:210785110b0bd0694e5a75e2f1c15924908a21c4
# SHA1:c6ac172b4b9707e36b45d4c91cca650ab0a7dd5d
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand All @@ -25,6 +25,8 @@ coveralls==3.3.1
# via -r requirements/test.in
docopt==0.6.2
# via coveralls
greenlet==2.0.2
# via playwright
iniconfig==2.0.0
# via pytest
outcome==1.2.0
Expand All @@ -35,10 +37,16 @@ parse==1.19.1
# pytest-bdd
parse-type==0.6.2
# via pytest-bdd
playwright==1.36.0
# via
# -r requirements/test.in
# pytest-playwright
pluggy==1.2.0
# via pytest
py==1.11.0
# via pytest-html
pyee==9.0.4
# via playwright
pytest==7.4.0
# via
# -r requirements/test.in
Expand All @@ -50,14 +58,17 @@ pytest==7.4.0
# pytest-env
# pytest-html
# pytest-metadata
# pytest-playwright
# pytest-rerunfailures
# pytest-selenium
# pytest-socket
# pytest-variables
pytest-asyncio==0.21.1
# via -r requirements/test.in
pytest-base-url==2.0.0
# via pytest-selenium
# via
# pytest-playwright
# pytest-selenium
pytest-bdd==6.1.1
# via -r requirements/test.in
pytest-cov==4.1.0
Expand All @@ -70,6 +81,8 @@ pytest-html==3.2.0
# via pytest-selenium
pytest-metadata==3.0.0
# via pytest-html
pytest-playwright==0.3.3
# via -r requirements/test.in
pytest-rerunfailures==12.0
# via -r requirements/test.in
pytest-selenium==4.0.1
Expand All @@ -78,6 +91,8 @@ pytest-socket==0.6.0
# via -r requirements/test.in
pytest-variables==3.0.0
# via pytest-selenium
python-slugify==8.0.1
# via pytest-playwright
requests-mock==1.11.0
# via -r requirements/test.in
respx==0.20.2
Expand All @@ -94,6 +109,8 @@ sttable==0.0.1
# via -r requirements/test.in
tenacity==8.2.2
# via pytest-selenium
text-unidecode==1.3
# via python-slugify
tomli==2.0.1
# via
# coverage
Expand Down

0 comments on commit 033ef34

Please sign in to comment.