The `testit-adapter-playwright` package provides a robust integration layer between the Playwright test automation framework and the Test IT Test Management System (TMS). It automates the process of publishing test results, logs, and attachments from Playwright test runs directly into a Test IT instance. The current stable version is `4.0.2-TMS-5.7`, with parallel releases like `4.0.2` for different TMS versions, indicating an active development and maintenance cadence. Key differentiators include seamless mapping of Playwright tests to TMS work items using decorators like `externalId`, automatic reporting of test statuses (passed, failed, skipped), and the ability to attach rich media (screenshots, videos, logs) directly from Playwright's capabilities. It allows for flexible configuration via environment variables or a Playwright configuration file, supporting various adapter modes for managing test runs within TMS.
npm install testit-adapter-playwrightVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates configuring the `testit-adapter-playwright` in `playwright.config.ts` using environment variables for TMS credentials, and a basic Playwright test file showcasing `externalId` and `attachment` decorators for reporting results and artifacts to Test IT.
Review the official changelog for specific behavioral changes. Test existing workflows thoroughly after upgrading to identify any regressions or altered synchronization logic. Pay close attention to `adapterMode` configuration.
Utilize environment variables (e.g., `process.env.TMS_PRIVATE_TOKEN`) and ensure they are properly set in your CI/CD pipelines and local development environments. Refer to the 'Configuration' section in the README for available environment variables.
Always check the release notes and ensure the `testit-adapter-playwright` version you install is compatible with your Test IT TMS instance version. Refer to the Test IT documentation for compatibility matrices.
Verify that `reporter: [[TestITReporter, {...options}], 'html']` or similar is correctly configured in your `playwright.config.ts` file, and that all required options (url, privateToken, projectId, configurationId) are provided and valid.Set the `TMS_URL` environment variable or provide `url` in the `TestITReporter` options in `playwright.config.ts`.
Ensure you are using `import { TestITReporter } from 'testit-adapter-playwright/reporter';` in a TypeScript or ESM file (e.g., `playwright.config.ts`), and that your project is configured for ESM.Verify the `TMS_TEST_RUN_ID` environment variable or the `testRunId` option in `TestITReporter` is correct and corresponds to an active test run in your Test IT instance. Alternatively, omit `testRunId` to allow the adapter to create a new one (if `adapterMode` 1 is configured to do so).
Check network connection to the Test IT instance. Verify `TMS_PRIVATE_TOKEN` is correct and has necessary permissions. Ensure the file path provided to `attachment` decorator/function is valid and accessible by the test runner process.