Ortoni Report is a comprehensive HTML report generator designed specifically for Playwright test suites. It provides visually appealing, feature-rich reports with advanced analytics, debugging tools, and AI-powered insights to simplify test result analysis and management.
- Visual Reports: Clean, navigable HTML reports with dashboards, test details, analytics, and more.
- Sharding Support: Merge multiple parallel/sharded test runs into a single consolidated report.
- History Tracking: SQLite-based persistence of test runs for trends and analytics.
- AI Integration: "Suggest Fix" feature using LLMs (OpenAI, Gemini, Claude, Ollama).
- CLI Tools: Commands to view reports and merge shards.
- Customization: Themes, branding, metadata, and flexible configurations.
- Language: TypeScript
- Build Tool: tsup (for CJS/ESM bundles)
- UI: React + Shadcn UI (for the HTML report interface)
- Database: SQLite (for history and analytics)
- Server: Express (for local report serving)
- Dependencies: Playwright, Commander (CLI), Express, SQLite3, etc.
- GitHub: https://github.com/ortoniKC/ortoni-report
- Author: Koushik Chatterjee (LetCode with Koushik)
- License: GPL-3.0-only
Ortoni Report operates as a Playwright custom reporter with additional CLI utilities. The architecture is modular, separating concerns into reporters, helpers, utilities, and types.
- Reporter Integration: Hooks into Playwright's test lifecycle (onBegin, onTestEnd, onEnd, onExit).
- Data Processing: Processes test results, attachments (screenshots, videos, traces), and metadata.
- Report Generation: Generates HTML reports or shard JSON files.
- Persistence: Optionally saves data to SQLite for history/analytics.
- Serving: Starts a local Express server to view reports.
- UI: UI is handled here
src/
├── cli.ts # CLI entry point (Commander.js commands)
├── ortoni-report.ts # Main Playwright reporter class
├── mergeData.ts # Logic for merging shard reports
├── helpers/ # Core business logic modules
│ ├── databaseManager.ts # SQLite operations for history
│ ├── fileManager.ts # File I/O for reports/assets
│ ├── HTMLGenerator.ts # HTML report generation
│ ├── resultProcessor.ts # Test result parsing
│ ├── serverManager.ts # Express server management
│ ├── markdownConverter.ts
│ └── templateLoader.ts
├── types/ # TypeScript interfaces
│ ├── reporterConfig.ts # Configuration options
│ └── testResults.ts # Test data structures
└── utils/ # Utility functions
├── attachFiles.ts
├── expressServer.ts
├── groupProjects.ts
├── utils.ts
└── ...
- OrtoniReport: Main reporter implementing Playwright's
Reporterinterface. - OrtoniReportConfig: Configuration interface for customization.
- TestResultData: Structure for individual test results.
- DatabaseManager: Handles SQLite interactions for history.
- HTMLGenerator: Builds the final HTML report with analytics.
- Implements Playwright's reporter lifecycle.
- Handles sharding: In shard mode, writes JSON files instead of full HTML.
- Processes test results, saves to DB, generates reports, and starts server.
- Uses Commander.js for command-line interface.
- Commands:
show-report: Serve existing report via Express.merge-report: Merge shard JSONs into final HTML.
- Combines shard files deterministically.
- Handles duration summation, config merging, and history saving.
- Priority for
saveHistory: options > shard config > default true.
- Manages SQLite DB for test run history.
- Saves/retrieves runs, results, summaries, trends, flaky/slow tests.
- Prepares data for the React-based UI.
- Fetches analytics from DB if available.
- Handles file writing, directory creation, asset copying.
- Starts Express server for local report viewing.
- Parses Playwright test data into
TestResultData.
- Node.js (v16+ recommended)
- npm or yarn
- Playwright project
npm install -g ortoni-report
# or
npm install ortoni-report --save-devAdd to playwright.config.ts:
import { OrtoniReportConfig } from "ortoni-report";
const config: OrtoniReportConfig = {
open: "always", // or "never", "on-failure"
folderPath: "ortoni-report",
filename: "index.html",
title: "My Test Report",
projectName: "My Project",
base64Image: false,
saveHistory: true,
meta: { Environment: "QA" },
};
export default defineConfig({
reporter: [["ortoni-report", config]],
});npx playwright testReports generate automatically based on config.
npx ortoni-report show-report --dir ortoni-report --file index.html --port 2004Starts server at http://localhost:2004.
npx ortoni-report merge-report --dir ortoni-report --file merged.html --save-historyMerges shards and generates final report.
For parallel runs, Playwright shards produce JSON files. Use merge-report to combine.
- Fork the repo.
- Clone:
git clone https://github.com/your-username/ortoni-report.git - Install deps:
npm install - Build:
npm run build
- Code Style: TypeScript, follow existing patterns.
- Testing: Run tests in
tests/with Playwright. - Linting: Use ESLint/Prettier if configured.
- Commits: Descriptive messages, follow conventional commits.
- UI Enhancements: Improve React components in the HTML report.
- New Features: Add analytics, integrations (e.g., more LLMs).
- Bug Fixes: Address issues in GitHub.
- Documentation: Update README, add examples.
- Build:
npm run build(uses tsup for CJS/ESM). - Pack:
npm run packfor local testing. - Release:
npm run release(publishes to npm).
- Test thoroughly.
- Update CHANGELOG.md.
- Ensure backward compatibility.
- Reference issues.
- TypeScript: Compiled with
tsc(config in tsconfig.json). - Bundling: tsup bundles to
dist/(CJS and ESM). - Entry Points:
src/ortoni-report.tsandsrc/cli.ts. - Externals: Playwright, SQLite, Express, etc., not bundled.
npm run tsc: Type check.npm run build: Full build.npm run release: Publish to npm.
- Recommend to have a sepearate project to create test
- Located in
tests/:demo-todo-app.spec.ts,example.spec.ts. - Run with Playwright:
npx playwright test.
- After changes, run tests to ensure reporter works.
- Test sharding and merging manually.
- No explicit coverage tool mentioned; rely on Playwright's test runs.
- Need to add unit testing
@playwright/test: ^1.58.0ansi-to-html,commander,express,sqlite3, etc.
- TypeScript, tsup, @types/*.
- LLMs: OpenAI, Gemini, Claude, Ollama.
- Trace Viewer: Playwright's built-in.
- Export to PDF/other formats.
- Direct JIRA integration for bug creation based on LLM description
- Cloud storage for longer history availability and live dashboad
- Report with index if multiple markets/env project dependents present (project specific)
- Issues: https://github.com/ortoniKC/ortoni-report/issues
- Discussions: GitHub repo.
- Author: Koushik Chatterjee (ortoni@axl UPI, buymeacoffee.com/letcode)