Skip to content

Commit f6ed861

Browse files
authored
docs: add example plugin implementation (#735)
* docs: add example plugin implementation
1 parent 513cfe5 commit f6ed861

File tree

23 files changed

+5290
-0
lines changed

23 files changed

+5290
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ hot
1616
tmp
1717
**/playwright-report
1818
**/html-report/*
19+
examples/**
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# HTML Reporter Plugin Example
2+
3+
## What it does
4+
5+
Adds a collapsible "Random Number" section to test results that fetches a random number from the server when expanded.
6+
7+
![Screenshot](plugin-screenshot.png)
8+
9+
## Project Structure
10+
11+
```
12+
├── ui/ # Frontend plugin (React + Redux)
13+
├── server/ # Express middleware
14+
├── preset-for-config/ # Config preset factory
15+
└── package.json
16+
```
17+
18+
## Building
19+
20+
```bash
21+
npm install
22+
npm run build
23+
```
24+
25+
## Usage
26+
27+
1. Install the plugin in your project (or link it locally using `npm link random-number-plugin-example` for development)
28+
29+
2. Update your `testplane.config.ts`:
30+
31+
```ts
32+
import randomNumberPluginUI from 'random-number-plugin-example';
33+
34+
export default {
35+
// ... other config
36+
plugins: {
37+
'html-reporter/testplane': {
38+
enabled: true,
39+
// Enable plugins and add plugin preset to html-reporter config
40+
pluginsEnabled: true,
41+
plugins: randomNumberPluginUI(),
42+
},
43+
},
44+
};
45+
```
46+
47+
3. Run your tests with html-reporter enabled — the plugin section will appear in test results.

0 commit comments

Comments
 (0)