ortoni-report 4.0.2-beta.0 → 4.0.2

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.
@@ -8,9 +8,9 @@ import {
8
8
  extractSuites,
9
9
  normalizeFilePath,
10
10
  startReportServer
11
- } from "./chunk-JEIWNUQY.mjs";
11
+ } from "./chunk-4RZ5C7KY.mjs";
12
12
 
13
- // src/helpers/resultProcessor .ts
13
+ // src/helpers/resultProcessor.ts
14
14
  import AnsiToHtml from "ansi-to-html";
15
15
  import path2 from "path";
16
16
 
@@ -1272,7 +1272,7 @@ function getFileExtension(contentType) {
1272
1272
  return extensions[contentType] || "unknown";
1273
1273
  }
1274
1274
 
1275
- // src/helpers/resultProcessor .ts
1275
+ // src/helpers/resultProcessor.ts
1276
1276
  var TestResultProcessor = class {
1277
1277
  constructor(projectRoot) {
1278
1278
  this.ansiToHtml = new AnsiToHtml({ fg: "var(--snippet-color)" });
@@ -1343,7 +1343,7 @@ var ServerManager = class {
1343
1343
  constructor(ortoniConfig) {
1344
1344
  this.ortoniConfig = ortoniConfig;
1345
1345
  }
1346
- startServer(folderPath, outputFilename, overAllStatus) {
1346
+ async startServer(folderPath, outputFilename, overAllStatus) {
1347
1347
  const openOption = this.ortoniConfig.open || "never";
1348
1348
  const hasFailures = overAllStatus === "failed";
1349
1349
  if (openOption === "always" || openOption === "on-failure" && hasFailures) {
@@ -1353,6 +1353,8 @@ var ServerManager = class {
1353
1353
  this.ortoniConfig.port,
1354
1354
  openOption
1355
1355
  );
1356
+ await new Promise((_resolve) => {
1357
+ });
1356
1358
  }
1357
1359
  }
1358
1360
  };
@@ -1391,7 +1393,7 @@ var OrtoniReport = class {
1391
1393
  await this.dbManager.initialize(
1392
1394
  path3.join(this.folderPath, "ortoni-data-history.sqlite")
1393
1395
  );
1394
- this.config = config?.shard;
1396
+ this.shardConfig = config?.shard;
1395
1397
  }
1396
1398
  onStdOut(chunk, _test, _result) {
1397
1399
  if (this.reportsCount == 1 && this.showConsoleLogs) {
@@ -1408,7 +1410,7 @@ var OrtoniReport = class {
1408
1410
  );
1409
1411
  this.results.push(testResult);
1410
1412
  } catch (error) {
1411
- console.error("OrtoniReport: Error processing test end:", error);
1413
+ console.error("Ortoni Report: Error processing test end:", error);
1412
1414
  }
1413
1415
  }
1414
1416
  printsToStdio() {
@@ -1427,17 +1429,29 @@ var OrtoniReport = class {
1427
1429
  (r) => r.status !== "skipped"
1428
1430
  );
1429
1431
  const totalDuration = result.duration;
1430
- if (this.config && this.config.total > 1) {
1431
- const shard = this.config;
1432
+ if (this.shardConfig && this.shardConfig.total > 1) {
1433
+ const shard = this.shardConfig;
1432
1434
  const shardFile = `ortoni-shard-${shard.current}-of-${shard.total}.json`;
1433
1435
  const shardData = {
1434
- status: result.status,
1435
- duration: totalDuration,
1436
+ // status: result.status,
1437
+ totalDuration,
1436
1438
  results: this.results,
1437
- projectSet: Array.from(this.projectSet)
1439
+ projectSet: Array.from(this.projectSet),
1440
+ userConfig: {
1441
+ projectName: this.ortoniConfig.projectName,
1442
+ authorName: this.ortoniConfig.authorName,
1443
+ type: this.ortoniConfig.testType,
1444
+ title: this.ortoniConfig.title
1445
+ },
1446
+ userMeta: {
1447
+ meta: this.ortoniConfig.meta
1448
+ }
1438
1449
  };
1439
- this.fileManager.writeRawFile(shardFile, shardData);
1440
- console.log(`\u{1F4E6} OrtoniReport wrote shard file: ${shardFile}`);
1450
+ const shardFilePath = this.fileManager.writeRawFile(
1451
+ shardFile,
1452
+ shardData
1453
+ );
1454
+ console.info(`Ortoni Report: Shard data written to ${shardFilePath}`);
1441
1455
  this.shouldGenerateReport = false;
1442
1456
  return;
1443
1457
  }
@@ -1450,21 +1464,21 @@ var OrtoniReport = class {
1450
1464
  this.results,
1451
1465
  this.projectSet
1452
1466
  );
1453
- this.outputPath = this.fileManager.writeReportFile(
1467
+ this.outputPath = await this.fileManager.writeReportFile(
1454
1468
  this.outputFilename,
1455
1469
  finalReportData
1456
1470
  );
1457
1471
  } else {
1458
- console.error("OrtoniReport: Error saving test run to database");
1472
+ console.error("Ortoni Report: Error saving test run to database");
1459
1473
  }
1460
1474
  } else {
1461
1475
  console.error(
1462
- "OrtoniReport: Report generation skipped due to error in Playwright worker!"
1476
+ "Ortoni Report: Report generation skipped due to error in Playwright worker!"
1463
1477
  );
1464
1478
  }
1465
1479
  } catch (error) {
1466
1480
  this.shouldGenerateReport = false;
1467
- console.error("OrtoniReport: Error generating report:", error);
1481
+ console.error("Ortoni Report: Error generating report:", error);
1468
1482
  }
1469
1483
  }
1470
1484
  async onExit() {
@@ -1472,17 +1486,15 @@ var OrtoniReport = class {
1472
1486
  await this.dbManager.close();
1473
1487
  if (this.shouldGenerateReport) {
1474
1488
  this.fileManager.copyTraceViewerAssets(this.skipTraceViewer);
1475
- console.info(`Ortoni HTML report generated at ${this.outputPath}`);
1476
- this.serverManager.startServer(
1489
+ console.info(`Ortoni Report generated at ${this.outputPath}`);
1490
+ await this.serverManager.startServer(
1477
1491
  this.folderPath,
1478
1492
  this.outputFilename,
1479
1493
  this.overAllStatus
1480
1494
  );
1481
- await new Promise((_resolve) => {
1482
- });
1483
1495
  }
1484
1496
  } catch (error) {
1485
- console.error("OrtoniReport: Error in onExit:", error);
1497
+ console.error("Ortoni Report: Error in onExit:", error);
1486
1498
  }
1487
1499
  }
1488
1500
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ortoni-report",
3
- "version": "4.0.2-beta.0",
3
+ "version": "4.0.2",
4
4
  "description": "Playwright Report By LetCode with Koushik",
5
5
  "scripts": {
6
6
  "tsc": "tsc",
@@ -8,10 +8,11 @@
8
8
  "release": "npm publish"
9
9
  },
10
10
  "bin": {
11
- "ortoni-report": "./dist/cli/cli.js"
11
+ "ortoni-report": "./dist/cli.js"
12
12
  },
13
13
  "files": [
14
- "dist",
14
+ "dist/",
15
+ "dist/index.html",
15
16
  "README.md",
16
17
  "CHANGELOG.md"
17
18
  ],
@@ -52,5 +53,11 @@
52
53
  },
53
54
  "main": "dist/ortoni-report.js",
54
55
  "module": "dist/ortoni-report.mjs",
55
- "types": "dist/ortoni-report.d.ts"
56
+ "types": "dist/ortoni-report.d.ts",
57
+ "exports": {
58
+ ".": {
59
+ "require": "./dist/ortoni-report.js",
60
+ "import": "./dist/ortoni-report.mjs"
61
+ }
62
+ }
56
63
  }
package/readme.md CHANGED
@@ -14,14 +14,17 @@ A comprehensive and visually appealing HTML report generator tailored for Playwr
14
14
 
15
15
  - **Sidebar Navigation**: Enjoy a clean and structured layout for seamless navigation.
16
16
  - **Sections**:
17
+
17
18
  - **Dashboard**: High-level overview of test analytics and trends.
18
19
  - **Tests**: Dive into individual test details including logs, screenshots, and errors.
19
20
  - **Analytics**: Track overall execution metrics, trends, and flaky/slow test insights.
20
21
  - **Glance**: See all the tests in a single Tabular view
22
+
21
23
  - **Hierarchical Grouping**: Tests are organized by filename, suite, and project for better traceability.
22
24
  - **Test History View**: Access up to 10 recent executions, categorized by suite and project with test Status, Duration.
23
25
  - **Configurable Integration**: Easy setup with Playwright using TypeScript/JavaScript, along with customizable preferences.
24
26
  - **Advanced Filtering**: Filter by Project, Tags, and Status
27
+ - **🔀 Merge Reports**: Combine multiple shard/parallel test run reports into a single **consolidated view** using CLI (`npx ortoni-report merge-report`)
25
28
 
26
29
  ### 2. **Detailed Reporting**
27
30
 
@@ -35,13 +38,13 @@ A comprehensive and visually appealing HTML report generator tailored for Playwr
35
38
  - Summary of total test runs, passed/failed counts, pass rate, and average duration.
36
39
  - **Trends Over Time**: Line chart showing test results across the last 30 runs.
37
40
  - **Top Flaky Tests**: Identify unstable tests quickly.
38
- - **Slowest Tests**: View tests with highest average durations.
41
+ - **Slowest Tests**: View tests with slowest average durations.
39
42
 
40
43
  - **Chart Visualizations**:
41
44
 
42
45
  - Charts for test summary, per-project breakdowns
43
46
  - Bar charts for project-specific comparisons.
44
- - **Line Chart for Trends**: Visualize execution status progression over time.
47
+ - **Line Chart for Trends**: Visualize execution status progression over time (only in local execution)
45
48
 
46
49
  - **Colorful UI**: Redesigned with vibrant, high-contrast visuals for improved readability and engagement.
47
50
 
@@ -58,8 +61,9 @@ A comprehensive and visually appealing HTML report generator tailored for Playwr
58
61
  - **Self-Contained Reports**: Easily share and review offline-friendly reports.
59
62
  - **Multi-Filters**: Combine filters for targeted test analysis.
60
63
  - **Meta Information**: Add custom user or environment metadata to reports.
61
- - **CLI**: Open the reporter anytime using the builin CLI
64
+ - **CLI**: Open the reporter anytime using the built-in CLI
62
65
  - **Open Markdown**: View markdown - Copy and use it in your AI prompt
66
+ - **Supports GitHub Actions** - [Refer the project for example](https://github.com/ortoniKC/pw-test)
63
67
 
64
68
  ---
65
69
 
@@ -70,20 +74,20 @@ A comprehensive and visually appealing HTML report generator tailored for Playwr
70
74
  Run the following command to install the **ortoni-report** package globally:
71
75
 
72
76
  ```bash
73
- npm install -D ortoni-report
77
+ npm install -g ortoni-report
74
78
  ```
75
79
 
76
- ### Step 2: Configure in `playwright.config.ts`
77
-
78
- Set up **Ortoni Report** in your Playwright configuration file with the following example:
80
+ ### Step 2: Configure in `playwright.config.[ts/js]`
79
81
 
80
82
  ```typescript
81
83
  import { defineConfig } from "@playwright/test";
82
84
  import { OrtoniReportConfig } from "ortoni-report";
83
85
  import * as os from "os";
84
86
 
87
+ // Everything is optional - use as per your requirement
88
+
85
89
  const reportConfig: OrtoniReportConfig = {
86
- open: process.env.CI ? "never" : "always", // default to never
90
+ open: process.env.CI ? "never" : "always",
87
91
  folderPath: "my-report",
88
92
  filename: "index.html",
89
93
  title: "Ortoni Test Report",
@@ -94,57 +98,28 @@ const reportConfig: OrtoniReportConfig = {
94
98
  base64Image: false,
95
99
  stdIO: false,
96
100
  meta: {
97
- "Test Cycle": "Aug 25, 2025",
98
- version: "3",
101
+ "Test Cycle": "Sep, 2025",
102
+ version: "4",
99
103
  description: "My automation suite",
100
- release: "0.3",
104
+ release: "0.1",
101
105
  platform: os.type(),
102
106
  },
103
107
  };
104
108
 
105
109
  export default defineConfig({
110
+ ... playwright config
106
111
  reporter: [["ortoni-report", reportConfig]],
107
- // Other Playwright configurations
112
+ ... playwright config
108
113
  });
109
114
  ```
110
115
 
111
- ### Configure in `playwright.config.js`
112
-
113
- ```javascript
114
- import { defineConfig } from "@playwright/test";
115
-
116
- const reportConfig = {
117
- open: process.env.CI ? "never" : "always", // default to never
118
- folderPath: "my-report",
119
- filename: "index.html",
120
- title: "Ortoni Test Report",
121
- showProject: false,
122
- projectName: "Your Project title",
123
- testType: "Functional",
124
- authorName: os.userInfo().username,
125
- base64Image: false,
126
- stdIO: false,
127
- meta: {
128
- "Test Cycle": "Aug 25, 2025",
129
- version: "3",
130
- description: "My automation suite",
131
- release: "0.3",
132
- platform: os.type(),
133
- },
134
- };
135
-
136
- export default defineConfig({
137
- reporter: [["ortoni-report", reportConfig]],
138
- // Other Playwright configurations
139
- });
140
- ```
116
+ ---
141
117
 
142
118
  ## Using the Ortoni Report CLI
143
119
 
144
120
  ### Command: `show-report`
145
121
 
146
- This command starts a local Express server and serves the generated Ortoni report. You can open the report in your default browser.
147
- Trace viewer and markdown support only in local server or cloud server
122
+ This command starts a local Express server and serves the generated Ortoni report.
148
123
 
149
124
  #### Options
150
125
 
@@ -154,42 +129,36 @@ Trace viewer and markdown support only in local server or cloud server
154
129
 
155
130
  #### Example Usage
156
131
 
157
- 1. **Default Usage**
132
+ ```bash
133
+ npx ortoni-report show-report
134
+ ```
158
135
 
159
- ```bash
160
- npx ortoni-report show-report
161
- ```
136
+ or
162
137
 
163
- This will:
138
+ ```bash
139
+ npx ortoni-report show-report --dir custom-folder --file my-report.html --port 3000
140
+ ```
164
141
 
165
- - Look for the report file `ortoni-report.html` in the `ortoni-report` folder.
166
- - Start the server on port `2004`.
142
+ ---
167
143
 
168
- 2. **Custom folder and file Options**
169
- ```bash
170
- npx ortoni-report show-report --dir custom-folder --file my-report.html --port 3000
171
- ```
172
- This will:
173
- - Look for the file `my-report.html` in `custom-folder`.
174
- - Start the server on port `3000`.
144
+ ### Command: `merge-report` _\[New]_
175
145
 
176
- #### Errors and Troubleshooting
146
+ This command **merges multiple Ortoni reports** (from shard executions or parallel test runs) into a single consolidated report.
177
147
 
178
- - If the specified file or folder does not exist, you will see an error like:
179
- ```
180
- Error: The file "my-report.html" does not exist in the folder "custom-folder".
181
- ```
182
- Ensure the file and folder paths are correct.
148
+ #### Options
183
149
 
184
- #### Accessing the Report
150
+ - **`-d, --dir <path>`**: Folder containing the shard files (folderPath - provided in ortoni-config). Defaults to ortoni-report.
151
+ - **`-f, --file <filename>`**: Name of the merged report file. Defaults to ortoni-report.html.
185
152
 
186
- Once the server is running, open your browser and navigate to:
153
+ #### Example Usage
187
154
 
188
- ```
189
- http://localhost:<port>
155
+ ```bash
156
+ npx ortoni-report merge-report
190
157
  ```
191
158
 
192
- Replace `<port>` with the port number you specified or the default port (`2004`). The report will automatically open in your default browser if the `always` option is enabled.
159
+ ```bash
160
+ npx ortoni-report merge-report --dir my-folder --file final-report.html
161
+ ```
193
162
 
194
163
  ---
195
164
 
@@ -197,27 +166,43 @@ Replace `<port>` with the port number you specified or the default port (`2004`)
197
166
 
198
167
  Stay up-to-date with the latest features, improvements, and bug fixes by reviewing the [Changelog](https://github.com/ortoniKC/ortoni-report/blob/main/changelog.md).
199
168
 
169
+ ---
170
+
200
171
  ## License
201
172
 
202
173
  This project is licensed under the terms of the [LICENSE](https://github.com/ortoniKC/ortoni-report/blob/main/LICENSE.md).
203
174
 
175
+ ---
176
+
177
+ ## Contributors
178
+
179
+ 1. [Prabhash Dissanayake](https://github.com/prabhash-dissanayake-yl) - [PR](https://github.com/ortoniKC/ortoni-report/pull/99)
180
+
204
181
  ## Feedback and Contributions
205
182
 
206
- I encourage you to share feedback and contribute to improving Ortoni Report! For issues, suggestions, or contributions, please visit our [GitHub repository](https://github.com/ortoniKC/ortoni-report).
183
+ I encourage you to share feedback and contribute to improving Ortoni Report!
184
+ For issues, suggestions, or contributions, please visit our [GitHub repository](https://github.com/ortoniKC/ortoni-report).
185
+
186
+ ---
207
187
 
208
188
  ## Support
209
189
 
210
190
  If you'd like to support this project, you can donate via UPI:
211
191
 
212
- ![UPI Payment](https://raw.githubusercontent.com/ortoniKC/ortoniKC/refs/heads/main/ortoni.png)
192
+ UPI id: ortoni@axl [Koushik Chatterjee]
213
193
 
214
194
  [Buy me coffee](https://buymeacoffee.com/letcode) | [Paypal](https://paypal.me/koushik1677?country.x=IN&locale.x=en_GB)
215
195
 
216
- Thank you for using **Ortoni Report**! I'm committed to providing you with a superior Playwright testing experience.
217
-
218
196
  ---
219
197
 
220
- **Developer & Designer**
221
- [Koushik Chatterjee](https://letcode.in/contact)
198
+ **With love**
199
+ Developed and designed by [Koushik Chatterjee](https://letcode.in/contact)
200
+
201
+ **Tech Stack**
202
+
203
+ 1. Report generated using Playwright custom report
204
+ 2. UI - React and Shadcn UI
205
+ 3. DB - sqlite
206
+ 4. Local host - express
222
207
 
223
208
  **LetCode with Koushik**