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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_selenosis-2.1.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_selenosis-2.1.2.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for django_selenosis-2.1.2.tar.gz
Algorithm Hash digest
SHA256 0c49b014877107ec93a89f94191791ef34187b10b54dd4146161166725d280d5
MD5 618b9fd9b2e68f4949711e81b4e30048
BLAKE2b-256 19dd33ae3e6c8a163f447d090b61c481aa7c9e914a17d9d161b69094cadf1c11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_selenosis-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e251ffca1d2975bb979a4a37d03f7421abb5f97899e2a718cc5754738d8f9442
MD5 373317298492fc9e204a7f6386aa1e69
BLAKE2b-256 73d511c23de1853702f672907ead24b228040d6ffada26c2818af5d3666d9133

See more details on using hashes here.

Supported by

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