TL;DR: To export tests to Playwright from ContextQA, the autonomous quality engineer, call export_to_playwright through the MCP server with a nonempty test_case_ids list and an optional project_name. It returns a JSON file manifest that you save to a local directory. A generated project does not prove you have the same coverage. Check assertions, credentials, fixtures and manual steps, then run one representative spec outside ContextQA before adding it to CI.
When you export tests to Playwright from ContextQA, the generated project can look finished. A green run still doesn't prove that its assertions match your source cases, because some AI steps become manual checkpoints or placeholders that don't block the run. This guide shows how to call export_to_playwright, review credentials and manual steps, and prove assertion parity before the specs join your CI pipeline.
Quick answers
Does a Playwright export from ContextQA guarantee the same coverage as the original tests? No. An export is where a portability check begins. Some AI steps need manual work, and others become verification placeholders that don't block the run, so a passing exit code can hide missing checks. Review every generated assertion and run a representative test outside ContextQA first. See the export and portability guide.
How does the ContextQA Playwright export work from an AI coding assistant? From an MCP connected assistant such as Claude Code, Cursor or Codex, call export_to_playwright with a nonempty test_case_ids list. One ID gives a project with a single case, and several IDs give multiple specs. The tool returns a JSON file manifest that your client saves to disk. Setup steps are in the MCP installation and setup guide.
What should my team review before exported Playwright tests join CI? Save the files to an empty directory outside committed source. Check them for credentials, fixtures, manual checkpoints, and assertions that are missing or don't block the run. Run them against a non production environment with a scoped test account and compare the results with the source baseline. Commit only after the assertions match and no secrets remain.
What does it mean to export tests to Playwright?
Exporting turns test cases managed in a testing platform into a Playwright project you run yourself: spec files, configuration and fixtures in your own repository. Teams need it when checking for vendor lock in, handing tests to developers, or moving regression coverage into repository CI. ContextQA handles the export through its MCP server.
In ContextQA, testers build cases with AI generation or the no code recorder. An assistant connected over MCP calls export_to_playwright, and ContextQA resolves prerequisites and reusable step groups while it builds the project (code export, portability guide).
The export is only a starting point. Some AI steps become manual work or verification placeholders that don't block the run, so review them before CI.
Converting suites from another framework is a different job. It is a migration into a new format, not a live sync, and you can't convert back without losing something. The migration guides cover that path.
What do you need before you start?
You need four things: access to the source test cases and their reviewed steps, an MCP connected assistant whose current manifest lists export_to_playwright, a coding client allowed to write local files, and an empty directory outside committed source. You also need a non production environment, a scoped test account, reproducible data and a baseline run to compare against.
The export guide describes a Playwright project but does not list language options. If your team needs TypeScript, JavaScript, Python, Java or C# output, confirm it on a demo call.
| Option | Best for | Pricing model | Notable tradeoff |
|---|---|---|---|
| ContextQA MCP export | Moving managed cases into your repo | Quote via demo | Some AI steps export as manual or non blocking placeholders |
| Playwright Test Agents | Generating new specs from exploration | Open source | You review coverage and repairs |
| Hand written Playwright specs | Critical flows that need exact assertions | Open source plus engineer time | Highest maintenance load |
These options can coexist. Use the export for cases you already manage in ContextQA, Test Agents to explore new flows, and hand written specs where one exact assertion matters most (Playwright MCP, CLI, and Test Agents).

How do you run the export, step by step?
Ask an MCP connected assistant to call export_to_playwright with your reviewed test case IDs. Save the returned file manifest to an empty directory, review credentials and manual steps, then run a sample spec outside ContextQA. Treat the export as a draft until its assertions match both the source tests and the baseline run.
- Gather the source case IDs, the application build, and a recent execution baseline.
- In Claude Code, Cursor, or Codex, request
export_to_playwrightwith a nonemptytest_case_idslist and an optionalproject_name. Several IDs produce several specs. - Write the manifest files to a scratch directory, not committed source.
- Search for credentials, manual steps, and non blocking verification placeholders. Replace each placeholder with a real assertion.
- Run the project against staging, using the commands from the Playwright installation guide:
cd ~/exports/reporting-pilot
npm install
npx playwright install --with-deps chromium
npx playwright test --reporter=list
Playwright codegen records one new browser session into a spec. The export works differently: it converts cases you already maintain, so you don't have to rewrite them from scratch.
What are the most common mistakes?
The most common failures are treating a green exit code as proof of coverage, committing generated files before reviewing credentials, ignoring AI steps that became manual or non blocking placeholders, and wiring the project into CI before a representative spec has run outside ContextQA. Each one creates false confidence instead of portable coverage.
- Trusting a passing run. Missing assertions pass silently. Compare each assertion against the source case steps.
- Exporting into committed source. Credentials or session state can leak. Use an empty directory and ignore
playwright/.auth/, which can hold reusable credentials (Playwright authentication docs). - Skipping manual checkpoints. Placeholders don't fail the run, so they can hide missing checks. Convert or remove them before merge.
- Adding to CI too early. Environment drift breaks the pipeline. Run one spec with
npx playwright testfirst.
You avoid lock in only when your team can run and maintain the specs without the platform. Once you have saved and reviewed the manifest, the output is standard Playwright Test code that runs with the usual runner in Jenkins, GitHub Actions or another CI tool.
How do you know it is working?
Exported tests work when a representative spec passes outside ContextQA with the same assertions as its source case, stays green across repeated runs, and fails when you plant a defect. A green exit code alone proves little, because the export guide notes that some AI steps become non blocking verification placeholders.
Watch flakiness first. In 2016, Google reported that almost 16% of its tests showed some level of flakiness (Google Testing Blog, 2016), so a single passing run is weak evidence. Track three checks on a feature branch:
- Assertion parity: every expected outcome in the source case maps to an
expect()call, not a comment ortest.fixme(). - Stability:
npx playwright test --repeat-each=10 --retries=0passes with no intermittent failures (Playwright command line docs). - Sensitivity: break the feature on purpose and confirm the spec fails.
Self healing repairs locators for tests managed inside the ContextQA platform. After a spec moves into your repository, your team fixes broken locators through normal code review. One practical split is to keep regression suites that change often in the platform and export only the specs that must run in repository CI.
To measure return, compare maintenance hours per sprint and escaped defects before and after the move. Use your own tracker data, not vendor estimates.
How can you automate the Playwright export with ContextQA?
ContextQA runs the export through its MCP server. In Claude Code, Cursor or Codex, you ask the assistant to call export_to_playwright with reviewed test case IDs. ContextQA builds the project, resolves prerequisites and reusable step groups, and returns a JSON file manifest. Your coding client saves those files locally for review.
- Connect the assistant by following the MCP setup guide.
- Confirm the export tools appear in the assistant's current manifest.
- Have the same assistant create and run managed tests, retrieve their evidence, and export the reviewed cases.
This path covers only tests that already live in ContextQA. Suites coming from other frameworks follow the separate migration guides.
Want to see an export you can review before it reaches CI? Book a demo to walk through ContextQA's code export on your own test cases.

What should you do right now? A checklist
Start with one representative test case. Export it with export_to_playwright, save the files to an empty directory, and check credentials, manual steps and assertions before anything reaches CI. Run the spec against staging and compare the results with the ContextQA baseline. Only then extend the export to more cases.
- Record the source case IDs, the application build and a passing execution baseline.
- Call
export_to_playwrightwith one ID intest_case_idsand aproject_name. - Save the returned manifest to an empty directory outside committed source.
- Search the specs for hardcoded credentials, and move saved sessions to an ignored
playwright/.auth/path. - Replace every manual step or non blocking placeholder with a real assertion.
- Run the spec against a non production environment with a scoped test account.
- Compare the pass, fail and assertion counts with the ContextQA baseline.
- Add the spec to CI only after a reviewer approves assertion parity.
Bottom line
The export_to_playwright tool gives you a file manifest. That is the first step of a portability check, not the end of it. Before any exported spec joins CI, review its assertions, credentials, fixtures and manual checkpoints, then run a representative test outside ContextQA against your baseline. A green exit code alone does not prove the export covers what the original test covered. For older suites, see the migration guides.
Sources
The ContextQA workflow claims in this article come from the product documentation listed below. The flakiness statistic and the Playwright commands come from their primary sources, so you can verify each one directly before you share it with your team.