{"library":"playwright-testrail-reporter","title":"Playwright TestRail Reporter","description":"The `playwright-testrail-reporter` is a custom reporter designed to integrate Playwright Test results seamlessly with TestRail. It automates the process of creating new TestRail runs or updating existing ones, and then posts test outcomes by matching specific case IDs (e.g., `C12345`) embedded directly within Playwright test titles. The current stable version is 1.3.3, released in October 2025, with a consistent cadence of minor quality-of-life improvements and dependency updates. Key differentiators include robust environment variable validation and auto-sanitization, support for using TestRail API keys instead of passwords, and flexible custom status mappings for different test outcomes. It simplifies the reporting workflow, allowing developers to focus on writing tests rather than manually updating TestRail.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install playwright-testrail-reporter"],"cli":null},"imports":["['playwright-testrail-reporter']","import { defineConfig } from '@playwright/test';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { defineConfig } from '@playwright/test';\n\n// To ensure environment variables are loaded if using a .env file\n// require('dotenv').config(); // Uncomment if you are using dotenv\n\nexport default defineConfig({\n  testDir: './tests',\n  fullyParallel: true,\n  forbidOnly: !!process.env.CI,\n  retries: process.env.CI ? 2 : 0,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: [\n    ['list'], // Keep the default list reporter\n    ['playwright-testrail-reporter'] // Add TestRail reporter\n  ],\n  use: {\n    baseURL: 'http://127.0.0.1:3000',\n    trace: 'on-first-retry',\n  },\n});\n\n// Example test file (tests/example.spec.ts)\n// Make sure to set these environment variables in your .env file:\n// TESTRAIL_HOST=https://yourcompany.testrail.io\n// TESTRAIL_USERNAME=your.email@company.com\n// TESTRAIL_API_KEY=your_api_key_here\n// TESTRAIL_PROJECT_ID=123\n// TESTRAIL_SUITE_ID=456\n// TESTRAIL_RUN_NAME=Automated Playwright Run\n\nimport { test, expect } from '@playwright/test';\n\ntest('C12345: User can log in with valid credentials', async ({ page }) => {\n  await page.goto('/');\n  // Simulate login\n  console.log('Test C12345 executed.');\n  expect(true).toBe(true);\n});\n\ntest('C67890 C98765: Dashboard loads correctly after login', async ({ page }) => {\n  await page.goto('/dashboard');\n  // Simulate dashboard checks\n  console.log('Test C67890 and C98765 executed.');\n  expect(page.url()).toContain('/dashboard');\n});","lang":"typescript","description":"This quickstart demonstrates how to configure `playwright-testrail-reporter` in `playwright.config.ts` and tag tests with TestRail case IDs (e.g., C12345) for automatic reporting. It also highlights the necessary environment variables for TestRail integration.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}