A WebdriverIO plugin to report in spec style
—
Core configuration options for customizing reporter behavior, output formatting, and integration features.
Main configuration interface for customizing all aspects of the spec reporter.
/**
* Configuration options for SpecReporter
*/
interface SpecReporterOptions {
/**
* Enable/disable Sauce Labs sharable links
* By default test results in Sauce Labs can only be viewed by team members.
* This option enables sharable links that can be viewed by anybody.
* @default true
*/
sauceLabsSharableLinks?: boolean;
/**
* Custom symbols for different test states
* @default {passed: '✓', skipped: '-', failed: '✖', pending: '?', retried: '↻'}
*/
symbols?: Partial<Symbols>;
/**
* Show only failed test results
* @default false
*/
onlyFailures?: boolean;
/**
* Include console logs from steps in report
* @default false
*/
addConsoleLogs?: boolean;
/**
* Enable real-time test status output during execution
* @default false
*/
realtimeReporting?: boolean;
/**
* Show/hide preface on each line ('[MultiRemote ...]')
* @default true
*/
showPreface?: boolean;
/**
* Enable/disable colored terminal output
* @default true
*/
color?: boolean;
}Usage Examples:
import SpecReporter from "@wdio/spec-reporter";
// Basic configuration
const reporter = new SpecReporter({
color: true,
onlyFailures: false
});
// Advanced configuration with custom symbols
const reporter = new SpecReporter({
symbols: {
passed: '[PASS]',
failed: '[FAIL]',
skipped: '[SKIP]'
},
addConsoleLogs: true,
realtimeReporting: true,
sauceLabsSharableLinks: false
});
// WebdriverIO configuration
export const config = {
reporters: [
['spec', {
sauceLabsSharableLinks: true,
symbols: {
passed: '✅',
failed: '❌',
skipped: '⏭️'
},
onlyFailures: false,
addConsoleLogs: true,
realtimeReporting: false,
showPreface: true,
color: true
}]
]
};Custom symbols for different test states to personalize output appearance.
/**
* Custom symbols for different test states
*/
interface Symbols {
/** Symbol for passed tests */
passed: string;
/** Symbol for skipped tests */
skipped: string;
/** Symbol for pending tests */
pending: string;
/** Symbol for failed tests */
failed: string;
/** Symbol for retried tests */
retried: string;
}Usage Examples:
// Unicode symbols
const unicodeSymbols = {
passed: '✅',
failed: '❌',
skipped: '⏭️',
pending: '⏳',
retried: '🔄'
};
// Text-based symbols
const textSymbols = {
passed: '[PASS]',
failed: '[FAIL]',
skipped: '[SKIP]',
pending: '[PENDING]',
retried: '[RETRY]'
};
// Minimal symbols
const minimalSymbols = {
passed: '+',
failed: 'x',
skipped: '-'
};Configuration for capturing and displaying console output during test execution.
interface ConsoleOptions {
/** Include console logs in report output */
addConsoleLogs: boolean;
}Usage Examples:
// Enable console log capture
const reporter = new SpecReporter({
addConsoleLogs: true
});
// Console logs will appear in test output:
// Running: chrome (v91) on macOS Big Sur
//
// » /tests/example.test.js
// Example Test Suite
// ✓ should pass test
//
// .........Console Logs.........
// console.log('Debug information')
// console.warn('Warning message')Options for enabling live test status updates during execution.
interface RealtimeOptions {
/** Enable real-time test status output */
realtimeReporting: boolean;
}Usage Examples:
// Enable realtime reporting
const reporter = new SpecReporter({
realtimeReporting: true
});
// Output will show tests as they execute:
// [chrome 91 macOS Big Sur #0-0] ------------------------------------------------------------------
// [chrome 91 macOS Big Sur #0-0] Suite started:
// [chrome 91 macOS Big Sur #0-0] » /tests/example.test.js
// [chrome 91 macOS Big Sur #0-0] ✓ should pass test » [ /tests/example.test.js ]Environment-based configuration options that override settings.
interface EnvironmentConfig {
/** Force disable all terminal coloring when set to '0' */
FORCE_COLOR?: string;
}Usage Examples:
# Disable all colors
FORCE_COLOR=0 npx wdio run wdio.conf.js
# Enable colors (default)
FORCE_COLOR=1 npx wdio run wdio.conf.jsInstall with Tessl CLI
npx tessl i tessl/npm-wdio--spec-reporter