Stml89/pytest-framework-playwright

★ 1Forks 0PythonGitHub ↗Compare

README

About


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.

Project structure


/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

Usage


How to install

  1. Clone this repository
    $ git clone <URL>
  1. Create virtual environment, activate it:
    $ pip install virtualenv
    $ cd ~/projects/pytest-framework
    $ virtualenv venv
    $ source venv/bin/activate
  1. Install dependencies
    $ pip install -r requirements.txt
  1. Install playwright
    $ playwright install
  1. Install allure
    $ brew install allure
    $ allure --version

How to run tests

  1. To execute login suite
    $ pytest . -m login
  1. To execute tests in Firefox, headed mode
    $ pytest . --headed --browser firefox

How to generate a report

    $ allure serve

Available markers:

  • login - 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.

Contributors

Stml89

Issues