Every few years a new wave of tooling promises to make testing effortless. Record-and-playback was supposed to replace scripting. Codeless platforms were supposed to replace engineers. AI is the latest wave—but this time, the impact is real. The difference is that AI does not replace the discipline of testing; it removes a large share of the repetitive work that keeps QA engineers from doing that discipline well.
In this article I'll walk through where AI genuinely helps today, a practical workflow for AI-assisted test generation, and the guardrails that keep an AI-augmented suite trustworthy.
Where AI actually helps today
It is easy to get lost in demos. In day-to-day automation work, these are the areas where AI consistently pays for itself:
- Test generation from requirements — turning acceptance criteria or user stories into a first draft of Playwright or Cypress tests, including edge cases a tired human might skip.
- Locator resilience — suggesting stable, user-facing locators (
getByRole,getByLabel) instead of brittle CSS chains, and proposing fixes when the DOM changes. - Failure triage — summarizing long CI logs and traces, clustering failures by root cause, and separating real regressions from flaky infrastructure noise.
- Test data generation — producing realistic, varied, and privacy-safe input data for forms, APIs, and boundary-value testing.
- Coverage review — reading a feature spec alongside the existing suite and pointing out scenarios that are not covered yet.
A practical workflow for AI-assisted test generation
The workflow below keeps humans in control of what matters—intent and assertions—while letting AI handle the boilerplate.
- 1Start from a clear spec. Paste the acceptance criteria, the relevant page object API, and your team's conventions into the prompt. Context is what separates useful output from generic output.
- 2Ask for a draft, not a final answer. Request tests that use your existing page objects and fixtures, with one behavior per test.
- 3Review assertions first. Generated assertions are where subtle mistakes hide. Confirm each one checks the business outcome, not an implementation detail.
- 4Run locally, then in CI. Execute the tests several times to catch timing issues before they reach the shared pipeline.
- 5Commit with the same review bar as hand-written code. AI-written tests are still your tests.
An example prompt
You are a senior QA automation engineer.
Write Playwright tests in TypeScript for the feature below.
Conventions:
- Use the existing page objects: LoginPage, DashboardPage
- Prefer getByRole / getByLabel locators
- One behavior per test, descriptive test titles
- Tag critical-path tests with @smoke
Acceptance criteria:
1. A registered user can sign in with valid credentials
2. An invalid password shows "Incorrect email or password"
3. After sign-in, the dashboard greets the user by first nameThe reviewed result
import { test, expect } from "../fixtures";
test.describe("Sign in", () => {
test("registered user can sign in @smoke", async ({ loginPage, dashboardPage }) => {
await loginPage.goto();
await loginPage.signIn("qa.user@example.com", process.env.QA_PASSWORD!);
await expect(dashboardPage.greeting).toHaveText("Welcome back, Alex");
});
test("invalid password shows an error", async ({ loginPage }) => {
await loginPage.goto();
await loginPage.signIn("qa.user@example.com", "wrong-password");
await expect(loginPage.errorMessage).toHaveText("Incorrect email or password");
});
});Notice what review changed: the password comes from an environment variable instead of being hard-coded, and the assertions target the visible user outcome. Those are exactly the judgment calls AI tends to get wrong on the first pass.
Self-healing tests: useful, with limits
Self-healing locators can automatically recover when an element's selector changes. That reduces maintenance noise—but a test that silently heals can also silently pass when the UI is genuinely broken. If you adopt self-healing, log every heal, surface it in reports, and review heals the same way you review failures.
Guardrails that keep the suite trustworthy
- Never let AI own the oracle. Humans decide what correct behavior is; AI helps express it in code.
- Keep secrets and customer data out of prompts. Use synthetic data and sanitized logs.
- Measure the impact. Track time-to-author, flaky-test rate, and escaped defects before and after adoption.
- Version your prompts. Treat prompt templates like code so results are reproducible across the team.
What this means for QA engineers
AI shifts the QA role up the value chain. Less time goes into typing selectors and boilerplate; more goes into risk analysis, test strategy, and exploratory thinking—the work that has always mattered most. Engineers who learn to direct AI effectively will ship broader coverage, faster, with the same rigor.
AI won't replace QA engineers. QA engineers who use AI will replace those who don't.