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:
homebrew:
brew install --cask chromedriver
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file django_selenosis-2.0.4-py3-none-any.whl
.
File metadata
- Download URL: django_selenosis-2.0.4-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e8fc04824cbece58cf11826229e8237d656c380047f194a8aa9fb4f77d9ab5f |
|
MD5 | 696f91b7a2f6f93d5c7e9d6633b320d4 |
|
BLAKE2b-256 | 220d4c51b4b9134edce3fd4533ca3422636862b1ff617e5b991df0689478050d |