← Case Studies
Case Study — 01

AI-Powered Playwright
Test Framework

A Playwright test framework where an autonomous AI agent is a first-class citizen of the QA workflow — mapping existing coverage, navigating the live app, generating test cases for uncovered flows, and deduplicating them semantically before they reach the test management system.

Type
Personal project
Stack
Playwright · TypeScript · AI Agents
CI/CD
GitHub Actions
TMS
Qase
The Problem

Manual test coverage drifts. As features ship, new flows emerge that aren't covered by existing suites — and finding those gaps requires constantly auditing both the live application and the test code. At scale, this is impossible to maintain by hand without dedicated tooling.

Beyond discovery, there's a duplication problem: test management systems accumulate semantically identical entries written by different people at different times. "Login with valid credentials" and "should login successfully" describe the same test — but without deduplication, both end up in the backlog.

The Approach

An AI agent integrated directly into the QA workflow. Rather than replacing human-written tests, the agent works alongside them — extending coverage autonomously while conforming to the same framework conventions the human tests follow.

The result is a self-extending test suite where human-written and AI-generated tests coexist without noise. The agent handles discovery and generation; the framework handles execution; Qase TMS holds the ground truth.

How the Agent Works
01
Coverage Mapping

The agent parses all existing spec files and extracts the flows that are already covered — building a structured map of what the suite currently tests.

02
App Exploration

Using Playwright, the agent navigates the live application — browsing pages, triggering interactions, and identifying user paths that don't appear in the coverage map.

03
Test Case Generation

For each uncovered flow, the agent generates a structured test case. Cases follow the naming conventions, assertion patterns, and data factory usage of the existing human-written tests.

04
Semantic Deduplication

Before publishing, the agent compares new cases against existing TMS entries using semantic similarity — recognising that "Login with valid credentials" and "should login successfully" are the same test and discarding the duplicate.

05
TMS Sync

Clean, deduplicated test cases are pushed to Qase TMS, ready to be picked up for automation or manual execution.

Framework Architecture
  • UI layer — Page Object Model with full TypeScript typing across all page components and interactions
  • API layer — typed wrappers using Playwright's request context for direct, in-test API calls without browser overhead
  • Data layer — factory pattern for consistent, isolated test data generation per run
  • Serial mode — dependent test flows share state cleanly without workarounds
  • CI/CD — GitHub Actions pipeline with automated test gating on every push
Stack
Playwright TypeScript AI Agents GitHub Actions Qase TMS
Key Outcomes
  • Self-extending test suite
  • Zero duplicate entries in TMS
  • Human & AI tests coexist cleanly
  • Coverage gaps surfaced automatically