@cuteribs/ado-playwright-reporter
v0.1.4
Published
Playwright custom reporter that pushes test results (with per-step outcomes) to Azure DevOps Test Cases already associated with an existing Test Run.
Maintainers
Readme
@cuteribs/ado-playwright-reporter
Playwright reporter that pushes test results - including per-test.step() outcomes - to
Azure DevOps, into a Test Run that already exists (created by an Azure Pipelines
"Run functional tests" / Test Plan build task, or manually). It never creates a run or
test points itself; use @cuteribs/ado-testplan-cli to create/link
the Test Suites and Test Cases ahead of time.
Install
npm install --save-dev @cuteribs/ado-playwright-reporterConfig
playwright.config.js:
export default defineConfig({
reporter: [
['@cuteribs/ado-playwright-reporter', { config: 'ado.config.json' }],
// or inline, skipping the config file:
// ['@cuteribs/ado-playwright-reporter', { orgUrl: '...', project: '...' }],
],
});ado.config.json only needs orgUrl and project for the reporter (no planId):
{ "orgUrl": "https://dev.azure.com/your-org", "project": "your-project" }Environment variables:
AZURE_DEVOPS_PAT/SYSTEM_ACCESSTOKEN- PAT with Test Management (Read & Write).TEST_RUNID- the existing ADO Test Run id. If unset, the reporter logs a warning and does nothing (safe no-op for localnpx playwright testruns).
Matching results to ADO Test Cases
A Playwright test is matched to an ADO test result in the run by:
automatedTestStorage = relative spec file path, automatedTestName = test title -
the exact fields ado-testplan-cli writes onto each Test Case. If nothing matches, the
test is logged as a warning and skipped (nothing is pushed for it).
What gets pushed per test
- Overall outcome (
Passed/Failed/Timeout/NotExecuted/Aborted), duration, error message. - Each
test.step()as asubResult(outcome/duration/error), in source order - visible in ADO as the automated result's data-driven sub-results.
Notes
- Retries: only the last attempt's result is kept (later
onTestEndcalls for the same test overwrite earlier ones). - This package intentionally duplicates a small amount of config/client code from
ado-testplan-cliinstead of depending on a shared package, per project decision to publish exactly two independent packages.
