- If you clone this repo, you can do
pip install -r requirements.txt
to install both pytest and selenium at once. Otherwise, you can install them one by one.
- Install pytest via pip or easy_install:
pip install -U pytest or easy_install -U pytest
- After installation, you can check the installed version by running:
pytest --version
- Install selenium via pip:
pip install -U selenium
- Download tar file from chromedriver
- Go to download location and extract the file from archive.
- Create local file with system user name and
.env
format, likeusername.env
. Add your local path to this fileCHROME_PATH=/Path/to/driver
and save insettings
directory.
- Download and extract zip file from chromedriver
- Get the executable file's location and add it to your Environment Variables. Instructions on setting the path can be found here
- Create local file with system user name and
.env
format, likeusername.env
. Add your local path to this fileCHROME_PATH=/Path/to/driver
and save it in thesettings
directory.
- To run all tests inside the test directory, simply run this command:
pytest
- To run a specific test, do
pytest <module name> <test name>
e.g. pytest test_w3_trysql.py::test_check_city
- To run a test with allure report, do
pytest <module name> --alluredir=<directory name>
e.g. pytest test_w3_trysql.py --alluredir=reportdir
- To see allure report, do
allure serve <directory name>
e.g. allure serve reportdir
- It is recommended to run the tests with verbosity by invoking
-v
during the test run.