This is a simple example of a test automation project for testing https://www.saucedemo.com/, using Pytest,
playwright and allure for reporting.
Repository have a general structure to help you organize and create frameworks from scratch.
Made by Siarhei Stamal for Python Test Automation course.
/pytest-framework-playwright
├── .github
│ ├── workflows
│ │ ├── flake8.yaml
│ │ ├── ...
├── page_factory
│ ├── button.py
│ ├── ...
├── pages
│ ├── base_page.py
│ ├── ...
├── tests
│ ├── test_login.py
│ ├── conftest.py
│ ├── ...
├── utilities
│ ├── users.py
├── .gitignore
├── pyproject.toml
├── README.md
├── requirements.txt
└── LICENSE
- Clone this repository
$ git clone <URL>- Create virtual environment, activate it:
$ pip install virtualenv
$ cd ~/projects/pytest-framework
$ virtualenv venv
$ source venv/bin/activate- Install dependencies
$ pip install -r requirements.txt- Install playwright
$ playwright install- Install allure
$ brew install allure
$ allure --version- To execute login suite
$ pytest . -m login- To execute tests in Firefox, headed mode
$ pytest . --headed --browser firefox $ allure servelogin - to execute all login tests.login_positive - to execute valid login tests.login_negative - to execute negative login tests.product_list - to execute all tests ralated to products page.acceptance - to execute all acceptance test cases.