Playwright automation with python

Test project to show

  • features of MS Playwright on Python
  • automation project structure using pytest

All tests designed to cover application Test-Me

Tools:

Install guide

  1. Install python
  2. Install PyCharm
  3. Install python dependencies pip install -r requirements.txt
  4. Make sure playwright version 1.8+ installed

Project structure

  • conftest.py file contains main fixtures to work
  • Page objects stored in page_object folder
  • Tests stored in tests folder
  • Settings are spread between:
    • pytest.ini
    • settings.py

Run guide

  1. Create file secure.json for logins and passwords. Structure below. For demo purpose my file included to project as credentials already exposed in Test-Me documentaion
{
  "users": {
    "userRole1": {
      "login": "login",
      "password": "password"
    },
    "userRole2": {
      "login": "login",
      "password": "password"
    }
  }
}
  1. Install software to test Test-Me
  2. Set correct path to DB in pytest.ini file
  3. Run Test-Me (check guide in it's repo)
  4. Run tests using command pytest