BurhanH / TestAutomationCourse-python-ui-project

Python UI project for Test Automation Course
MIT License
7 stars 10 forks source link
python test-automation testing

TestAutomationCourse-python-ui-project

Python UI project for Test Automation Course

Run Python Tests

code standard check by pylint

How to run tests from one file - pytest

In terminal execute:

pytest -v tests/your_test_file.py

How to run tests by category (markers) - pytest

Run only tests with marker smoke

pytest -m smoke -v

Run only tests with marker regression

pytest -m regression -v

How to use markers for pytest

For the reference see files test_dummy.py and pytest.ini. Basically, you need to add a new marker with a description into the pytest.ini file or use an existing one and use it in your test suite, see samples in test_dummy.py. You can apply many markers for each test as you can depend on your needs.

How to run tests from one file - unittest

python -m unittest -v tests/your_test_file.py

How to run specific test (or test method) from test class - unittest

python tests/your_test_file.py YourClass.test_method -v

How to run all tests - unittest

python -m unittest discover tests "*.py" -v

How run pylint static code analyser

pylint tests/your_test_file.py 

pylint will analyse your code, check errors, enforces a coding standard, and probably will make suggestions about how the code could be refactored.

How to make a PR with your changes into this repository

How can I contribute to this repository