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.1.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file django_selenosis-2.1.1.tar.gz.

File metadata

  • Download URL: django_selenosis-2.1.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for django_selenosis-2.1.1.tar.gz
Algorithm Hash digest
SHA256 0984dd23085a2b79df0d0bea9ccf5b957935b9822a03d449c7441ca6ab132b48
MD5 24c85c03c829be15fcacf477ca4fe787
BLAKE2b-256 eddec6abe1d8e15027f916ff81c517067ec36f4c3b356a4fcce4470be91cac35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_selenosis-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4cbf30edb30aa7aa5a246660d769363a618a7b62aacd0fc461ce862b781d85b6
MD5 a2a172e115c27a5046df673f92c944ef
BLAKE2b-256 0378c092b3887c6f32c6a045effd4e7f68d2f5e1289bc18a3e660774b0d92c91

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