Agentic testing with Playwright: E2E flows without hand-written scripts
Agentic end-to-end testing with Playwright has the same goal as a Playwright suite — verify that critical journeys work in a real browser — but instead of a script of hard-coded steps, an AI agent plans the steps from a plain-English goal and adapts as it goes.
Telling the agent "sign in, add to cart, check out" can be the whole test definition. This guide explains what agentic testing actually is, how it differs from hand-written Playwright scripts, and when each approach fits — and how my agents run it in Mira Checks.
What agentic end-to-end testing is
End-to-end testing with Playwright usually means writing code: a test file with selectors, steps, and assertions that runs the same journey every time. Agentic testing flips that. You describe the journey in plain English, and an AI agent works out the concrete steps on your live site, performs them in a real browser, and checks whether the expected result happened.
The agent isn't a runner for pre-written steps — it is the test's author, moment to moment. It reads the live markup to find the sign-in form, decides what a real visitor would do next, and adjusts its plan when the site behaves unexpectedly. That is the difference from a script that always runs the same steps.
-
1
Plan from the goal
The agent reads your plain-English goal and expected result, then works out the steps on the live site — where to go, what to fill in, what to click.
-
2
Act in a real browser
It performs the steps — signing in, adding to the cart, checking out — the way a visitor would, on representative pages.
-
3
Observe what happens
It watches page state, console errors, network responses, missing elements, and layout breaks as it goes.
-
4
Adapt when things change
If the site is different than expected — a new button label, a redesigned form — it adjusts instead of failing a hard-coded selector.
-
5
Verify and report
It checks the outcome against the expected result and provides supporting evidence to help you decide what to do next.
Two ways to run agentic end-to-end testing
Mira Checks offers two modes of agentic end-to-end testing, and they complement each other:
General auto-discovery
Give the agent the sitemap and let it discover the site on its own. It samples representative pages, finds the key journeys, and tests what a visitor would do — without you defining a single test.
This is the best starting point: zero setup, and it catches issues in journeys you didn't think to write down.
Targeted no-code workflow tests
Describe a critical workflow in plain language — a goal plus the expected result — and the agent walks it end to end. Think of it like a Playwright test without writing code: the agent figures out the steps instead of a script.
Use this when a specific journey matters more than the rest — checkout, onboarding, booking — and you want the agent to focus exactly there. The plain-English workflow is covered in the no-code end-to-end testing guide.
Both modes sample your site rather than exhaustively covering it, and targeted workflow tests use natural-language goals with expected results rather than hard-coded deterministic assertions. No recorded flows, no exported test suites to maintain.
Reports you can verify, not just trust
A scripted suite ends with "pass" or "fail" — a single bit of information. An agent ends with findings, and each finding carries the evidence that produced it:
See the broken state the agent saw, at the moment it saw it.
The JavaScript errors and warnings that accompanied the failure.
The exact steps and interactions that led to the finding, so you can reproduce it.
One honest caveat that applies to every AI testing agent: model-assisted findings can be wrong, and a clean run does not mean a website is bug-free, secure, accessible, or release-safe. Treat the report as strong evidence to act on — not a certification.
An automated accessibility audit as part of the run
As the agent visits pages, it also runs an automated accessibility audit against the WCAG 2.1 A/AA success criteria that tools like Axe can check automatically — catching missing labels, contrast issues, and keyboard-trapping elements in an automated audit, not a full compliance review.
The audit covers the pages the agent visits, which means it doesn't crawl your whole application and doesn't reach pages behind authentication. And because automation can't judge everything a human auditor can, a clean accessibility run is a useful signal — not a WCAG certification.
Looking for the full picture? See what the automated accessibility audit checks and how it runs for free as part of the general site test.
Agentic testing vs. hand-written Playwright scripts
A hand-written Playwright test is a script: selectors, steps, and deterministic assertions that always run exactly the same things. That makes it precise and repeatable — and it makes it dependent on the markup staying put. When the UI changes, someone has to update the test.
Agentic testing starts from a goal and an expected result in plain English, and the agent figures out the steps as it goes. "Like a Playwright test without writing code" is the common way to describe it — it is a useful analogy, not an exact equivalence. The agent plans dynamically and adapts to the site as it is today, while a script always runs the same hard-coded steps.
Hand-written Playwright code
- You write selectors, steps, and deterministic assertions for each journey
- Tests are versioned with the code and run in your CI pipeline
- Every UI change can break a test, and someone must maintain it
- The result is a deterministic red or green per test
Agentic testing with Mira
- You describe the goal and expected result in plain English — no test code
- My agent plans the steps on the live site and adapts when the markup changes
- No selectors to maintain, no scripts to repair after a redesign
- The result is findings with supporting details and screenshots where available
The analogy ends where engineering precision begins. Agentic testing covers the same kind of end-to-end journeys in a real browser, but it has no deterministic assertion suite, makes no whole-site coverage claim, and does not export or maintain a Playwright test suite. Model-assisted findings can be wrong — a clean run is a strong signal, not a guarantee. Teams that already run Playwright can keep it: my checks run alongside existing CI pipelines.
A walkthrough: "sign in, add to cart, check out"
The clearest way to see agentic testing is a single shopping journey. A Playwright team would script this flow with selectors and assertions; with Mira, you describe it in one sentence — the goal — plus the outcome you expect.
Goal: Sign in on the shop, add a product to the cart, and check out.
Expected result: An order confirmation appears, and the cart is empty.
The sentence above is the whole test definition. No selectors, no step-by-step instructions, no assertions to write.
It opens the shop, finds the sign-in form, enters the credentials, picks a product, adds it to the cart, and opens checkout — deciding each step from the live page.
Typing, clicking, submitting — for real, on the real site, on representative pages, watching the page state and network as it goes.
Did the order confirmation appear? Is the cart empty? If not, you get supporting evidence to help you and your developer decide what to do next.
Step by step, here is what the run does and what it leaves behind:
- Sign in. The agent opens the shop, finds the sign-in form on the live page, fills the fields a visitor would fill, and submits. Evidence: a screenshot before and after submitting, the console log, and the network response for the session request.
- Add to cart. It picks a product from the listing, chooses the add-to-cart control on the product page, and checks the cart state afterwards. Evidence: a screenshot of the cart, the network call that added the item, and the point in the trace where the cart count changed.
- Check out. Purchases and form submissions require explicit permission. For supported checks, the report explains the outcome and provides supporting evidence, such as screenshots where available.
A workflow run samples representative pages and key journeys rather than exhausting every possibility on the site. If the agent finds nothing, that is a strong signal — not a guarantee that the site is bug-free.
Failure modes of agentic test generation
An agent that plans its own steps can fail in ways a broken selector cannot. These are the ones I see most often, and what to do about each of them.
- A goal that is too vague to verify. Ask for "the shop to work" and the agent can pass something nobody defined. What to do: state the expected result as a visible outcome — "an order confirmation shows and the cart is empty" — so a pass means something.
- A look-alike element on a busy page. A page with several similar cards or buttons offers more than one plausible target, and the agent can pick a neighbour. What to do: read the screenshot and trace and check the element that was actually used, and name the product or section in the goal when the page is crowded.
- A clean sample that hides a failure on an uncovered page. A run samples representative pages and key journeys, so passing journeys do not speak for pages it never opened. What to do: add the pages and journeys you care about, and treat a clean report as evidence about what was checked — not whole-site proof.
- Long journeys that time out or cost more. Every extra step is another decision and another page load. What to do: split a ten-step flow into two shorter goals, or keep the one long high-value flow as a hand-written Playwright test.
- Non-deterministic ordering. Carousels rotate, feeds reorder, and modals appear on the second visit — the agent can take a different path on each run, so a journey that passed once may not repeat. What to do: aim the goal at the outcome rather than the order, and use a hand-written deterministic assertion when the order itself is the thing being tested.
- Auth, CAPTCHA, and third-party widgets it cannot drive. Login walls, challenge screens, and embedded payment or consent widgets can stop a run cold. What to do: keep those steps in code where credentials, test accounts, and mocks are under your control, and point the agent at the journeys it can reach.
- Findings that need a human to judge. "This layout looks wrong" or "this copy is confusing" is not a red or green check. What to do: treat those findings as evidence for review, with the screenshot attached, instead of as a gate that blocks a deploy.
The pattern behind all of them: a clean run is a strong signal that the journeys I described worked, not proof the site is bug-free — and a failure needs the evidence behind it before anyone acts on it.
When to keep your Playwright suite
Agentic testing can cover journeys nobody scripted; it is not a reason to delete the suite that already works. A script is still the better tool when:
- You need deterministic assertions — an exact price, a permission, a redirect, a specific error message.
- You gate CI on every commit and want a red or green check that cannot vary between runs.
- The suite is yours: you export it, version it with the code, and run it wherever you like.
- Your coverage requirement is a list of pages, states, and inputs that one sentence cannot describe.
- You have a high-value flow — checkout, sign-up, payment — you want locked down and re-checked the same way every time.
So use both: keep the scripted suite for what must be exact, and let an agent cover the journeys you describe. The Mira vs. Playwright comparison walks through where each one fits, and the agentic testing overview covers what the agent does beyond a single E2E flow.
When to pick agentic testing vs. Playwright code
Neither approach is a silver bullet, and most teams end up using both. Agentic testing generally suits teams that want coverage fast without owning a test codebase; hand-written Playwright code generally suits developer teams that want deterministic, code-owned tests.
Agentic testing is generally a good fit when:
- You are a non-developer — marketing, product, CMS, or agency — and the test suite would live in someone else's codebase.
- You want coverage after every change without a backlog of selectors and assertions to maintain.
- You want to verify key journeys end to end and see a report — a goal and an expected result are all you need.
Hand-written Playwright code is generally a stronger fit when:
- Your developer team writes and maintains E2E tests as part of its workflow and wants them versioned with the code.
- You need deterministic assertions, full CI integration, or test suites you export and run yourself.
- Your coverage requirements exceed what a natural-language goal and expected result can describe.
The honest version: an agentic run samples representative pages and key journeys, and its findings are model-assisted — so treat a clean report as strong evidence to act on, not a certification. Many teams run Playwright for the flows that demand deterministic assertions and Mira for everything else.
The full comparison: Mira Checks vs. Playwright
If you are deciding between a Playwright suite and agentic testing, our side-by-side comparison walks through test creation, expected results, execution and maintenance, and coverage scope — with the same honest framing: Playwright remains the stronger choice for some teams, and Mira fits others.
Read: Playwright alternative — no-code E2E testingRelated guides: agentic end-to-end testing · no-code end-to-end testing in plain English · how Mira Checks works · agentic testing
Frequently asked questions
- What is agentic end-to-end testing with Playwright?
- Agentic end-to-end testing with Playwright is automated E2E testing driven by an AI agent. Instead of a script of hard-coded steps, you describe a goal in plain English — for example, "sign in, add to cart, check out" — and the agent plans the steps, runs them in a real browser, and verifies the expected result. It covers the same kind of journey a Playwright test would, but there is no test code to write or maintain.
- How is agentic testing different from a hand-written Playwright script?
- A hand-written Playwright test is a script: you write selectors, steps, and deterministic assertions, and it always runs exactly those steps. Agentic testing starts from a plain-English goal and an expected result; the agent plans the concrete steps on the live site and adapts when the markup or the flow changes. "Like a Playwright test without writing code" is an analogy, not an exact equivalence — an agent plans dynamically, while a script always runs the same steps.
- Is "a Playwright test without writing code" an exact description?
- No, it is an analogy. Agentic testing covers the same kind of end-to-end journeys in a real browser, but it has no deterministic assertion suite, makes no whole-site coverage claim, and does not export or maintain a Playwright test suite. A clean run is a strong signal, not a guarantee.
- When should I pick agentic testing over writing Playwright code?
- Agentic testing generally suits teams that want coverage without maintaining a test codebase — non-developers, agencies, and teams shipping changes fast. Hand-written Playwright code is generally a stronger fit when a developer team wants deterministic, code-owned assertions, full CI integration, and versioned tests. Neither approach is a silver bullet; many teams use Playwright for some journeys and agentic testing for the rest.
Let my agent run your critical flows
Mira is live. Describe a goal and an expected result in plain English, and get evidence-backed findings in minutes — no test code to write.
Create free account