Skip to main content

Configuration Options

These options are passed in the reporter tuple in your playwright.config.ts:

reporter: [
['@testplanit/playwright-reporter', { /* options */ }],
],

Required

OptionTypeDescription
domainstringBase URL of your TestPlanIt instance
apiTokenstringAPI token for authentication (starts with tpi_)
projectIdnumberProject ID where results will be reported (find this on the Project Overview page)

Optional

OptionTypeDefaultDescription
testRunIdnumber | string-Existing test run to add results to (ID or name). If set, runName is ignored
runNamestring'{suite} - {date} {time}'Name for new test runs (ignored if testRunId is set). Supports placeholders
testRunTypestring'JUNIT'Test framework type stored on the run
configIdnumber | string-Configuration for the test run (ID or name)
milestoneIdnumber | string-Milestone for the test run (ID or name)
stateIdnumber | string-Workflow state for the test run (ID or name)
caseIdAnnotationstring'testplanit'Playwright annotation type whose description holds the case ID(s) — the recommended way to link without renaming tests. Set to '' to disable. See Linking Test Cases
caseIdPatternRegExp | string/\[(\d+)\]/gRegex pattern for extracting case IDs from test titles and tags (must include a capturing group)
autoCreateTestCasesbooleanfalseAuto-create test cases if they don't exist
createFolderHierarchybooleanfalseCreate folder hierarchy based on test.describe structure (requires autoCreateTestCases and parentFolderId)
parentFolderIdnumber | string-Folder for auto-created test cases (ID or name)
templateIdnumber | string-Template for auto-created test cases (ID or name)
tagIds(number | string)[]-Tags to apply to the test run (IDs or names). Tags that don't exist are created automatically
uploadAttachmentsbooleantrueUpload Playwright attachments (screenshots, videos, traces) to the result — see Attachment Uploads
attachmentTypesstring[]allRestrict which attachments upload, by attachment name or content-type prefix (e.g. ['image/'])
includeStackTracebooleantrueInclude stack traces for failures
completeRunOnFinishbooleantrueMark run as complete when tests finish
timeoutnumber30000API request timeout in ms
maxRetriesnumber3Retry attempts for failed requests
verbosebooleanfalseEnable debug logging
tip

Options like configId, milestoneId, stateId, parentFolderId, and templateId accept either a numeric ID or a string name. When a string is provided, the resource is looked up by exact name match.

Run Name Placeholders

Customize your test run names with these placeholders:

PlaceholderDescriptionExample
{suite}Root describe title of the first reported testLogin Tests
{spec}Spec file name (without extension) of the first reported testlogin
{date}Current date in ISO format2024-01-15
{time}Current time14:30:00
{browser}Playwright project namechromium
{platform}Platform/OS namedarwin, linux, win32

The default run name is '{suite} - {date} {time}'.

// playwright.config.ts
export default defineConfig({
reporter: [
['@testplanit/playwright-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
// Default: '{suite} - {date} {time}'
// Custom example:
runName: 'E2E Tests - {browser} - {date} {time}',
}],
],
});

Appending to Existing Test Runs

Add results to an existing test run instead of creating a new one:

// playwright.config.ts
export default defineConfig({
reporter: [
['@testplanit/playwright-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
testRunId: 456, // Add results to this existing run (ID or name)
}],
],
});

This is useful for:

  • Aggregating results from multiple CI jobs
  • Running tests in parallel across machines
  • Re-running failed tests without creating new runs

Associating with Configurations and Milestones

Track test results against specific configurations (browser/OS combinations) and milestones:

// playwright.config.ts
export default defineConfig({
reporter: [
['@testplanit/playwright-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
configId: 5, // e.g., "Chromium / macOS"
milestoneId: 10, // e.g., "Sprint 15"
stateId: 2, // e.g., "In Progress" workflow state
tagIds: ['regression', 'automated'],
}],
],
});