DEV Community

Saso Trpovski
Saso Trpovski

Posted on

4

From Zero to Playwright: Building a QA Starter Kit for Automation Testing

πŸš€ Introduction

When I first started exploring test automation, I juggled tools, folder structures, and various frameworks. Most of the tutorials were either too advanced or didn’t follow best practices. So I decided to create something that would help beginners get started quickly, and still be scalable for professional teams. That's how QA to Go was born.

This post shares my journey of building a Python + Playwright starter kit β€” from scratch β€” and how it evolved into a clean, reusable testing framework.


πŸ› οΈ The Problem I Wanted to Solve

Many QA beginners (and even some experienced testers) struggle with:

  • Setting up a testing environment
  • Choosing the right tools
  • Managing test structure and maintainability

I wanted to create a solution that:

  • Uses modern, open-source tools
  • Works on Windows, Mac, and Linux
  • Has a DRY (Don’t Repeat Yourself) folder structure
  • Includes basic reporting out of the box

βš™οΈ Tools Used

  • Python 3.10+
  • Playwright (for browser automation)
  • Pytest (for test running)
  • pytest-html (for reports)

Optionally, it works great with:

  • VS Code or JetBrains Rider
  • Git for version control

πŸ“ Folder Structure

QA_to_Go/
β”œβ”€β”€ tests/               # All test cases go here
β”‚   └── test_sample.py
β”œβ”€β”€ pages/               # Page Object Models (POM)
β”œβ”€β”€ utils/               # Helpers like config or browser setup
β”œβ”€β”€ reports/             # HTML reports
β”œβ”€β”€ requirements.txt     # Project dependencies
└── README.md            # Setup instructions
Enter fullscreen mode Exit fullscreen mode

This structure is modular, so you can add API tests, DB validation, and more later.


πŸ” Setting Up the Project

Step 1: Install Python

Check if Python is installed:

python --version
Enter fullscreen mode Exit fullscreen mode

If not, download Python here.

Step 2: Create and Activate a Virtual Environment

python -m venv venv
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activate
Enter fullscreen mode Exit fullscreen mode

Step 3: Install Dependencies

pip install playwright pytest pytest-html
python -m playwright install
Enter fullscreen mode Exit fullscreen mode

You can also use a requirements.txt:

playwright
pytest
pytest-html
Enter fullscreen mode Exit fullscreen mode

Install it with:

pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Step 4: Create a Sample Test

# tests/test_sample.py
from playwright.sync_api import sync_playwright

def test_open_page():
    with sync_playwright() as p:
        browser = p.chromium.launch()
        page = browser.new_page()
        page.goto("https://example.com")
        assert "Example" in page.title()
        browser.close()
Enter fullscreen mode Exit fullscreen mode

Step 5: Run the Test

pytest --html=reports/report.html
Enter fullscreen mode Exit fullscreen mode

πŸ’‘ Why QA to Go Works

  • Lightweight & Simple – no bloated framework, just what you need
  • Fast to Set Up – go from zero to test in minutes
  • Scalable – easily add tests, POMs, utilities, or APIs

πŸ“¦ Want the Kit?

You can grab the full working starter kit here: QA to Go on Gumroad

It includes:

  • Full folder structure
  • Pytest + Playwright integration
  • HTML reports
  • Setup guide as a PDF

πŸ™Œ Final Thoughts

If you’re learning QA or just want a clean way to get started with Playwright and Python, QA to Go is for you.

I’d love your feedback, ideas, or improvements. Let’s make QA simpler, faster, and more accessible together.

Follow me on LinkedIn and let’s connect!

Heroku

Amplify your impact where it matters most β€” building exceptional apps.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (1)

Collapse
 
ruzin profile image
Aleksandar Ruzin β€’

I have the opportunity to work closely with the author. All I can say is how devoted he is to the tasks and always happy to jump to give his insights about the daily problems we encounter. Kudos

Postmark Image

"Please fix this..."

Focus on creating stellar experiences without email headaches. Postmark's reliable API and detailed analytics make your transactional emails as polished as your product.

Start free

Join the Runner H "AI Agent Prompting" Challenge: $10,000 in Prizes for 20 Winners!

Runner H is the AI agent you can delegate all your boring and repetitive tasks to - an autonomous agent that can use any tools you give it and complete full tasks from a single prompt.

Check out the challenge

DEV is bringing live events to the community. Dismiss if you're not interested. ❀️