Skip to content

Commit 65648fb

Browse files
Copilotkobenguyent
andcommitted
Changes before error encountered
Co-authored-by: kobenguyent <[email protected]>
1 parent f1f4172 commit 65648fb

File tree

6 files changed

+1735
-1002
lines changed

6 files changed

+1735
-1002
lines changed

docs/plugins.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,67 @@ Sample custom reporter for CodeceptJS.
587587
588588
- `config` &#x20;
589589
590+
## htmlReporter
591+
592+
Generates comprehensive HTML reports showing:
593+
594+
- Test statistics with interactive pie chart
595+
- Feature/Scenario details with collapsible sections
596+
- Individual step results with execution timing
597+
- Hook execution details (Before/After hooks)
598+
- Test artifacts (screenshots, etc.) with modal viewing
599+
- Clean, formatted error messages with ANSI color code stripping
600+
601+
The HTML reporter provides a modern, responsive interface that works across all screen sizes and can be easily shared with stakeholders.
602+
603+
#### Configuration
604+
605+
```js
606+
exports.config = {
607+
plugins: {
608+
htmlReporter: {
609+
enabled: true,
610+
output: './output', // Directory for the report
611+
reportFileName: 'report.html', // Name of the HTML file
612+
includeArtifacts: true, // Include screenshots/artifacts
613+
showSteps: true, // Show individual test steps
614+
showSkipped: true, // Show skipped tests
615+
},
616+
},
617+
}
618+
```
619+
620+
#### Features
621+
622+
- **Interactive Test Results**: Click-to-expand test details with comprehensive information
623+
- **Step-by-Step Details**: Shows individual test steps with proper method names (e.g., `I.seeFile()`, `I.amInPath()`), status indicators, and timing
624+
- **Test Statistics**: Visual cards displaying totals, passed, failed, and pending test counts with pie chart visualization
625+
- **Hook Information**: Displays Before/After hook execution details with timing and status
626+
- **Error Information**: Clean, formatted error messages for failed tests with ANSI color code stripping
627+
- **Artifacts Support**: Display screenshots and other test artifacts with modal viewing capability
628+
- **Responsive Design**: Mobile-friendly layout that works across all screen sizes
629+
- **Professional Styling**: Modern, clean interface with color-coded status indicators
630+
631+
#### Usage
632+
633+
Run tests normally and the HTML report will be automatically generated at the specified output location (default: `output/report.html`).
634+
635+
The generated HTML includes embedded CSS and JavaScript for a self-contained, interactive report that can be easily shared with stakeholders.
636+
637+
#### Example Report Features
638+
639+
- Click on any test to see detailed steps and timing information
640+
- Visual pie chart shows test distribution at a glance
641+
- Hook execution details show Before/After operations
642+
- Screenshots and artifacts display in modal overlays
643+
- Mobile-responsive design works on all devices
644+
645+
![HTML Reporter Example](./shared/html-reporter-screenshot.png)
646+
647+
### Parameters
648+
649+
- `config` **[Object][1]** Plugin configuration (optional, default `{}`)
650+
590651
## eachElement
591652
592653
Provides `eachElement` global function to iterate over found elements to perform actions on them.
257 KB
Loading

0 commit comments

Comments
 (0)