Skip to main content

Copy a failed test's context to your AI agent

Qase Autofixer puts the full failure context of a failed Playwright test on your clipboard, ready to paste into the AI agent that maintains your tests.

You change the product, the change is correct, and a handful of end-to-end tests fail anyway because they still describe the old behaviour. Updating them by hand is the slow part. Qase Autofixer hands the whole failure context to the AI agent that already works in your test repository, so the agent can do the editing.

What the button does

On a failed automated result, a block titled Save time on test updates holds a Copy prompt button. Press it and the failure context lands on your clipboard. Paste it into your agent — Claude Code, Cursor, or whatever you use — and tell the agent to update the test.

The Execution tab of a failed result, with the Save time on test updates block and its Copy prompt button below the Play trace button

That is the whole feature, and it is worth being precise about the division of labour. Qase supplies the context. Your agent reads your repository and makes the change. Qase does not edit your tests, does not open a pull request, and does not send anything to an AI provider on your behalf.

What you are pasting

Playwright writes a file called error-context.md for every test that fails. The Copy prompt button gives you that file's text, unchanged. It has four parts:

  • Test info — the test's name and the exact file and line it lives at.

  • Error details — the assertion or exception, with the line that raised it.

  • Page snapshot — an accessibility-tree snapshot of the page at the moment of failure, written as YAML. Present only for tests that drove a browser page.

  • Test source — the source of the test, with an arrow marking the failing line.

It is context, not instructions. The text does not tell the agent what to do, so say what you want in your own words when you paste it: update the selector, adjust the expectation, or explain why the product changed.

Requirements

Requirement

Detail

Playwright 1.53 or newer

Older versions do not work, for two different reasons. Up to 1.51 Playwright writes no error-context.md at all. 1.52 writes one but files it under an internal name the reporter does not recognise, so the context is quietly dropped and the block never appears.

playwright-qase-reporter 2.6.0 or newer

The version that added this. 2.7.0 is current. An older reporter is the most common reason the block does not appear.

A failed result

Only failed tests produce a failure context. Passing and skipped tests have none.

Attachment upload left on

The testops.uploadAttachments option is on by default. Turning it off suppresses the copied text as well as the file, deliberately — see the note below.

A Playwright test

No other reporter sends a failure context today.

The result open in your workspace

A shared run report does not offer the button.

Your subscription plan does not affect this. Any workspace receiving results from a recent Playwright reporter gets the block.

Check what is in the snapshot before you paste it

The page snapshot is a record of what was on screen when the test failed. On a test that runs against real or realistic data, that can include customer names, email addresses, order details, or anything else the page had loaded. Treat it the way you treat a screenshot of your own application, and check your organisation's rules before pasting it into a third-party AI tool.

If that content must never leave your CI, set the testops.uploadAttachments option to false. That stops both the copied text and the uploaded file, because both contain the same snapshot.

Limits

The reporter caps the text at 262144 characters and appends a line reading [truncated by qase reporter: N characters omitted] when it has to trim. A very large DOM is the usual reason: the page snapshot grows with the page.

If Playwright's error-context.md is missing or unreadable, the reporter ignores it. Your results are still published as normal — a failure here never breaks a run.

What it does not do yet

  • It does not fix anything on its own. Every change is made by your agent, in your repository, under your review.

  • It does not open your agent for you. You paste the text yourself.

  • It covers Playwright only. Other reporters and manual tests do not produce a failure context today.

Troubleshooting

What you see

What it usually means

No Save time on test updates block on a failed result

One of the requirements above is not met. Check the reporter version first — anything below 2.6.0 never sends the context.

The result has an error-context.md attachment, but still no block

You are on Playwright 1.52. The file is uploaded, but its text is not, because 1.52 names the attachment differently from every version after it. Upgrade to 1.53 or newer.

The button reads Retry loading prompt

Qase could not fetch the text. Press the button again to retry; the text is only fetched once per result.

The button is greyed out

The text is still loading. It becomes active as soon as the text is there.

The copied text ends with a truncation line

The context was over the character cap. What you have is the beginning of it, which is usually enough — the error and the test source come first.

Nothing lands on the clipboard

Clipboard access is blocked outside a secure context. Open your workspace over https, not plain http.

Related

Did this answer your question?