Basic Selenium framework with pytest and unittest to write automated tests for webpages easily and quickly.
This is a basic framework with Selenium that could be used to write automated tests for webpages.
The framework provides a quite simple way of performing browser operations such as getting an element, clicking, setting input values and asserting if an element is enabled or not. Using the element names defined in the model classes, we can easily write the test codes.
The test cases are written using both pytest and unittest.
utils: libraries implementing the base page model class and the browsermodels: libraries implementing the page modelstests_pytest: tests usingpytesttests_unittest: tests usingunittest
cd into the project root
pytest:
python3 -m pytest tests_pytest
unittest:
python3 -m unittest discover tests_unittest
Or you can run the tests in IDEs such as PyCharm.
Third-party libraries used:
- selenium
- pytest
Python version used for the development: Python 3.9.6