Example Selenium/Webdriver e2e tests (some quite silly) that aim to illustrate solutions for common issues when writing e2e tests
- run python selenium e2e tests against an existing website
- make use of a page object pattern
- use pytest for most of the heavy lifting
- run on Firefox or Chrome
- run tests in parallel (via pytest-parallel (requires python3.6+)
- run api tests using requests
- run on merge on CI
So... while python is a lovely language, it has a silly need for keeping python2.7 around. So silly. Down that road lies madness, so we are only talking about python3
. I'm using Homebrew (aka brew
) to install things but you do you... install however you like.
- python3
brew install python3
- install requirements:
pip install -r requirements --user
- if you want to run on firefox, download geckodriver and move to a folder on your path (eg.
/usr/local/bin
)
- in Chrome (default):
pytest
- in Firefox
pytest --driver firefox
- in parallel
pytest --workers 2