Option 1: Running in Your Own CI with Playwright
When you runstably test or npx playwright test in your own CI environment, Playwright executes locally and you have full control over reporter output. This is the simplest integration path because most TCMS tools — including Zephyr Scale — natively import JUnit XML.
Step 1: Add the JUnit Reporter
Add Playwright’s built-in JUnit reporter alongside the Stably reporter in yourplaywright.config.ts:
playwright.config.ts
junit-results.xml file after every test run, alongside streaming results to the Stably dashboard.
Step 2: Upload Results to Zephyr Scale
After tests complete, upload the JUnit XML to Zephyr Scale using their CLI or API. Here’s an example for GitHub Actions:- Zephyr Scale CLI
- Zephyr Scale API
.github/workflows/stably-zephyr.yml
How Test Names Map to Zephyr
Playwright’s JUnit XML uses this naming structure:name attribute to match or create test cases. To keep things clean:
- Use descriptive, stable test names in your Playwright tests
- Avoid dynamically generated test names that change between runs
- Use Playwright tags to organize tests, and map those to Zephyr folders or labels
Other TCMS Tools
The JUnit XML approach works with any TCMS that supports JUnit import:Option 2: Running on Stably Cloud
When tests run on Stably Cloud, you don’t have direct access to the file system where tests execute, so you can’t grab a JUnit XML file. Instead, use the Stably REST API to retrieve structured test results and push them to your TCMS.The Stably API requires an API key. Get yours from the API Key Dashboard.
Step 1: Trigger a Cloud Run and Get the Run ID
Trigger a run using any method — the Web Editor, CLI, API, or scheduled runs. All methods produce arunId you can use to fetch results.
Step 2: Poll for Results
Poll the run status until it completes:PASSED, FAILED, TIMEDOUT, SKIPPED, INTERRUPTED, FLAKY.
Step 3: Push Results to Zephyr Scale
Write a script that maps Stably results to Zephyr’s test execution API. Here’s a complete example:sync-to-zephyr.sh
Using stably runs for Richer Data
Thestably runs view --json command provides more detailed results including error messages, attempt counts, and file locations — useful if your TCMS supports richer metadata:
Automating the Sync in CI
Add the sync script as a post-run step in your CI pipeline:.github/workflows/stably-cloud-zephyr.yml
Mapping Test Statuses
Stably and Zephyr use different status vocabularies. Here’s how they map:Best Practices
Use Stable Test Names
Your TCMS matches test cases by name. Avoid dynamically generated names that change between runs — this creates duplicate entries in Zephyr.
Run the Sync on Every CI Run
Automate the TCMS sync so results are always up to date. Don’t rely on manual uploads.
Use autoCreateTestCases
Let Zephyr auto-create test cases on first import. This avoids the overhead of manually creating entries for every Playwright test.
Keep One Source of Truth
Author and maintain tests in Playwright with Stably. Use the TCMS as a reporting and visibility layer, not as the place where test definitions live.
Next Steps
Stably Test Reporter
Stream results to the Stably dashboard for AI-powered debugging
API Reference
Full REST API documentation for programmatic access
Run Tests on Cloud
Execute tests on Stably’s cloud infrastructure
CI/CD Integration
Set up tests in your deployment pipeline