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 Distribution

django-selenosis-2.0.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

django_selenosis-2.0.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file django-selenosis-2.0.0.tar.gz.

File metadata

  • Download URL: django-selenosis-2.0.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for django-selenosis-2.0.0.tar.gz
Algorithm Hash digest
SHA256 fcc482e7fc80bfe74dec9c2b6342d8d91e39808d2e6f8f0b760d394caaa6b9b1
MD5 f8458c9c65ae4cda83b8f5d9fe4d980a
BLAKE2b-256 3f971ece9a5e864003c9acc297b50f06e6318a017a35e31f84f80773a0d65a99

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_selenosis-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.5.0.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for django_selenosis-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c6a3ade6101b7974965b5e1d027b156fe35978b813efc9dd57a8251a2e11d92
MD5 388c8eae9f6c4254ad7a2a7edc577723
BLAKE2b-256 63809f8e54ced8d3a849e9e45dea844d8acddddbfa3b384fbaca557277d39ab3

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