This is example of Django UnitTest using Selenium.
- Functional Test using Selenium
- Unit Test using Django
to use Selenium, navigate to project directory then create virtual environment
virtualenv -p python3.8 env
source env/bin/activate
pip install -r hashthat/requirements.txtnow download Selenium
wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
tar -xzvf geckodriver-v*-linux64.tar.gzthen link the binary to environment binary
ln -s ./geckodriver env/bin/to test it
cd hashthat/
python manage.py testthe expected output should be like:
Found 9 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.........
----------------------------------------------------------------------
Ran 9 tests in 14.140s
OK
Destroying test database for alias 'default'...