@pilaf/reporting 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/package.json +6 -2
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# @pilaf/reporting
|
|
2
|
+
|
|
3
|
+
HTML report generation for Pilaf test results.
|
|
4
|
+
|
|
5
|
+
Generates interactive, browser-based reports from Pilaf test execution data.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @pilaf/reporting
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
const { ReportGenerator } = require('@pilaf/reporting');
|
|
17
|
+
|
|
18
|
+
const generator = new ReportGenerator({
|
|
19
|
+
templatePath: './path/to/template.html',
|
|
20
|
+
cssPath: './path/to/styles.css'
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const reportData = {
|
|
24
|
+
suiteName: 'My Plugin Tests',
|
|
25
|
+
stories: [
|
|
26
|
+
{
|
|
27
|
+
name: 'Test Story',
|
|
28
|
+
status: 'passed',
|
|
29
|
+
startTime: Date.now(),
|
|
30
|
+
endTime: Date.now(),
|
|
31
|
+
steps: [
|
|
32
|
+
{ name: 'Step 1', action: 'execute_command', response: '...' }
|
|
33
|
+
],
|
|
34
|
+
consoleLogs: []
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
startTime: Date.now(),
|
|
38
|
+
endTime: Date.now()
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Generate HTML report
|
|
42
|
+
const outputPath = generator.generate(reportData, './target/report.html');
|
|
43
|
+
console.log(`Report saved to: ${outputPath}`);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Report Data Structure
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
{
|
|
50
|
+
suiteName: string, // Test suite name
|
|
51
|
+
stories: [
|
|
52
|
+
{
|
|
53
|
+
name: string, // Story name
|
|
54
|
+
status: 'passed' | 'failed',
|
|
55
|
+
file: string, // Source file path
|
|
56
|
+
startTime: number, // Timestamp
|
|
57
|
+
endTime: number,
|
|
58
|
+
steps: [
|
|
59
|
+
{
|
|
60
|
+
name: string, // Step name
|
|
61
|
+
action: string, // Action type
|
|
62
|
+
response: any, // Action response
|
|
63
|
+
timestamp: number
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
consoleLogs: [
|
|
67
|
+
{
|
|
68
|
+
timestamp: number,
|
|
69
|
+
message: string
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
startTime: number,
|
|
75
|
+
endTime: number
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Custom Templates
|
|
80
|
+
|
|
81
|
+
You can provide custom HTML templates:
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
const generator = new ReportGenerator({
|
|
85
|
+
templatePath: './my-template.html',
|
|
86
|
+
cssPath: './my-styles.css'
|
|
87
|
+
});
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The template should be a valid HTML file with a Vue.js app that receives the report data as a JavaScript object.
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilaf/reporting",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/cavarest/pilaf"
|
|
8
|
+
},
|
|
5
9
|
"files": [
|
|
6
10
|
"lib/*.js",
|
|
7
11
|
"lib/**/*.js",
|
|
@@ -15,4 +19,4 @@
|
|
|
15
19
|
"access": "public"
|
|
16
20
|
},
|
|
17
21
|
"dependencies": {}
|
|
18
|
-
}
|
|
22
|
+
}
|