Skip to main content

Helpers for writing selenium tests for Django

Project description

selenosis noun sel·e·no·sis /sɛliːˈnəʊsɪs/. poisoning due to excessive intake of selenium.

django-selenosis (formerly django-admin-testutils) contains helpers to make writing selenium unit tests for Django, and in particular the Django admin, easier. It is based on the code that supported selenium unit tests in django-nested-admin.

The test runner is designed to work similarly to the Django framework’s own runtests.py. The best guide on usage can be found in the unit tests for this repository. Specifically, look at runtests.py and selenosis/tests/test.py.

Development and Testing

Install chromedriver

You can use homebrew or manually download chomedriver:

  1. homebrew:

    brew install --cask chromedriver
  2. Manually:

    export PATH="$PWD:$PATH"
    export CHROMEDRIVER_VERSION=$(curl -q http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
    curl -O http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_mac64.zip
    unzip chromedriver_mac64.zip
    rm chromedriver_mac64.zip
    chmod +x chromedriver

Run tox To Test

Run all tests:

tox -- --selenium=chrome-headless

Run only a specified test environment:

tox -e py37-dj22 -- --selenium=chrome-headless

If you would like to observe the browser during a test run, simply remove -headless in the above examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_selenosis-2.0.5-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file django_selenosis-2.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for django_selenosis-2.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bb347bbb04286c4bfa12ffdc27217bb4f22dd8fab3d7020912e69f549ad12183
MD5 a03fac28b485dd2159680b96baa27fe9
BLAKE2b-256 b47e2497cc96111e1d4f4b4e06995643328cb2ba35e7b9cc593587ea7aca995e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page