Skip to main content

WebdriverIO Reporter

@testplanit/wdio-reporter is an official WebdriverIO reporter that automatically sends test results to your TestPlanIt instance. It supports linking tests to existing test cases, automatic test case creation, screenshot uploads, and more.

Installation

npm install @testplanit/wdio-reporter @testplanit/api
# or
pnpm add @testplanit/wdio-reporter @testplanit/api
# or
yarn add @testplanit/wdio-reporter @testplanit/api

Quick Start

Add the reporter to your WebdriverIO configuration:

// wdio.conf.js
export const config = {
reporters: [
['@testplanit/wdio-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
}]
],
};

Run your tests:

npx wdio run wdio.conf.js

After your tests complete, you'll see a summary:

[TestPlanIt] Results Summary
[TestPlanIt] ═══════════════════════════════════════════════════════
[TestPlanIt] Test Run ID: 123
[TestPlanIt] Duration: 45.2s
[TestPlanIt]
[TestPlanIt] Test Results:
[TestPlanIt] ✓ Passed: 15
[TestPlanIt] ✗ Failed: 2
[TestPlanIt] ○ Skipped: 1
[TestPlanIt] Total: 18
[TestPlanIt]
[TestPlanIt] View results: https://testplanit.example.com/projects/runs/1/123
[TestPlanIt] ═══════════════════════════════════════════════════════

When autoCreateTestCases is enabled, additional stats are shown:

[TestPlanIt]   Test Cases:
[TestPlanIt] Found (existing): 12
[TestPlanIt] Created (new): 6

Screenshot upload stats appear when screenshots are captured:

[TestPlanIt]   Screenshots:
[TestPlanIt] Uploaded: 2

Choosing Your Setup

This package provides two components: a reporter and a launcher service. Use them together or separately depending on your needs.

Reporter Only

The simplest setup. Each worker creates its own test run, reports results, and completes the run when it finishes. Parallel workers running the same spec file are combined via the oneReport option.

Best for: Single spec files, small test suites, or setups where one run per spec file is acceptable.

export const config = {
reporters: [
['@testplanit/wdio-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
}]
],
};

The service creates a single test run before any workers start and completes it after all workers finish. Each reporter worker detects the pre-created run and reports results to it. This guarantees all spec files — across all batches — land in one test run.

Best for: Multiple spec files, CI pipelines, any setup where you want a single consolidated test run for your entire test suite.

import { TestPlanItService } from '@testplanit/wdio-reporter';

export const config = {
services: [
[TestPlanItService, {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
runName: 'E2E Tests - {date}',
captureScreenshots: true,
}]
],
reporters: [
['@testplanit/wdio-reporter', {
domain: 'https://testplanit.example.com',
apiToken: process.env.TESTPLANIT_API_TOKEN,
projectId: 1,
autoCreateTestCases: true,
parentFolderId: 10,
templateId: 1,
}]
],
};

What the service overrides

When both are used, the service takes over the test run lifecycle. The following reporter options are ignored because the service handles them:

Reporter optionIgnored because
runNameService creates the run with its own runName
testRunIdService provides the test run ID automatically
oneReportNot needed — the service already ensures a single run
completeRunOnFinishService controls when the run is completed
configId, milestoneId, stateId, tagIdsSet these on the service instead
testRunTypeSet on the service instead

The following reporter options still apply when using the service:

Reporter optionPurpose
autoCreateTestCasesFind or create test cases by name
parentFolderId, templateIdControl where and how test cases are created
createFolderHierarchyMirror suite structure as folders
caseIdPatternParse case IDs from test titles
uploadScreenshotsUpload intercepted screenshots
includeStackTraceInclude stack traces for failures
timeout, maxRetries, verboseAPI and logging behavior per worker
tip

When using the service, set run-level options (runName, configId, milestoneId, etc.) on the service and test-level options (autoCreateTestCases, caseIdPattern, uploadScreenshots, etc.) on the reporter.

Next Steps