/python-e2e-test-example

Example e2e tests written in Python

Primary LanguagePython

Python E2E Test Example

Example Selenium/Webdriver e2e tests (some quite silly) that aim to illustrate solutions for common issues when writing e2e tests

These 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

Requirements

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.

  1. python3 brew install python3

Install

  1. install requirements: pip install -r requirements --user
  2. if you want to run on firefox, download geckodriver and move to a folder on your path (eg. /usr/local/bin)

Run Tests

  1. in Chrome (default): pytest
  2. in Firefox pytest --driver firefox
  3. in parallel pytest --workers 2