-
Install python 3.7:
sudo apt-get update sudo apt-get upgrade sudo apt-get install python3.7
-
Install pip:
python3 -m pip install pip
-
Create a virtual environment:
sudo apt-get install -y python3.7-venv mkdir ~/env cd ~/env python3 -m venv selenium
-
Activate a virtual environment:
cd ~/env source selenium/bin/activate
-
Install the necessary environment requirements (libraries, modules, packages etc.):
pip install -r requirements.txt
-
Execute the tests from the terminal via the command:
pytest -v --tb=line <test_name.py>
The parameter
--tb=line
shortens the log with the test results. The parameter--reruns N
can be used for rerunning the failed tests, where N is the number of the reruns.You can initialize custom marks in pytest.ini.
Add the following parameter into command line when executong the tests to perform the ones with a certain mark:
-m <marking name>
- The key
-k
can be added to execute separate tests:
-k <test_name>
- The key
-
To finish the work or before switching to another prject you need to deactivate the virtual environment:
deactivate