ortoni-report 3.0.1 → 3.0.3

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/changelog.md CHANGED
@@ -1,56 +1,96 @@
1
1
  # Change Log:
2
2
 
3
+ ## v3.0.3
4
+
5
+ #### 📦 New Features
6
+
7
+ - Added a "Copy" button next to test spec file line numbers for quick sharing or navigation.
8
+ - Enabled support to open Markdown files, useful for AI-generated code snippets or documentation.
9
+
10
+ #### 🐛 Bug Fixes
11
+
12
+ - Fixed extra top spacing issue on the Analytics page.
13
+
14
+ #### 👌 Improvements
15
+
16
+ - Displayed test trends in ascending order for better chronological clarity.
17
+ - Skipped copying the trace folder when disabled via user configuration to optimize report generation.
18
+
19
+ ## v3.0.2
20
+
21
+ #### 📦 New Features
22
+
23
+ 1. Test Analytics dashboard
24
+
25
+ - Shows summary of total runs, totals test, passed, failed, pass rate and average duration
26
+ - Trends over time - upto 30 runs
27
+ - Top flaky test list
28
+ - slowest test list with average duration
29
+
30
+ #### 👌 Improvements
31
+
32
+ 1. Set chart option as pie or doughnut for summary and projects
33
+
3
34
  ## v3.0.1
4
35
 
5
36
  #### 👌 Improvements
6
37
 
7
38
  1. **Logo**:
8
- - Add project specific logo to the dashboard page
9
- - If logo is present then Dashboar text is hidden
39
+
40
+ - Add project specific logo to the dashboard page
41
+ - If logo is present then Dashboar text is hidden
10
42
 
11
43
  2. **Bundler size**:
12
- - Reduced bundler package size from 1.20 mB to 104 kB
13
- - Reduced bundler unpacked size from 5 mB to 760 kB
14
44
 
15
- 3. **Test History**
16
- - Improved test history UI
45
+ - Reduced bundler package size from 1.20 mB to 104 kB
46
+ - Reduced bundler unpacked size from 5 mB to 760 kB
47
+
48
+ 3. **Test History**
49
+
50
+ - Improved test history UI
17
51
 
18
52
  4. **Chart**
19
- - Improved chart layout with plot area chart for summary
53
+
54
+ - Improved chart layout with plot area chart for summary
20
55
 
21
56
  #### 🐛 Fixes
22
57
 
23
58
  1. Percentage is taking retry also in count #64
24
59
 
25
-
26
60
  ## v3.0.0
27
61
 
28
62
  #### 📦 New Features
63
+
29
64
  1. **SideBar**:
30
65
 
31
- - Navbar is removed and a new side bar is introduces.
32
- - Summay and Tests in 2 different section
66
+ - Navbar is removed and a new side bar is introduces.
67
+ - Summay and Tests in 2 different section
33
68
 
34
69
  2. **New Color Scheme**:
35
- - All new design to enhance the user viewing and exploring options
36
- - New Color scheme supports both dark and light theme
70
+
71
+ - All new design to enhance the user viewing and exploring options
72
+ - New Color scheme supports both dark and light theme
37
73
 
38
74
  3. **Meta section**:
39
- - User can add meta information about the project or release cycle (Refer to the example)
75
+
76
+ - User can add meta information about the project or release cycle (Refer to the example)
40
77
 
41
78
  4. **Overall redisgn**:
42
- - A new fresh UI look and perfomance increase
43
79
 
80
+ - A new fresh UI look and perfomance increase
44
81
 
45
82
  ## v2.0.9
46
83
 
47
84
  #### 📦 New Features
85
+
48
86
  - **Command to Open Report (CLI)**: Introduced a new command to open the Ortoni Report directly for streamlined access.
87
+
49
88
  ```
50
89
  npx ortoni-report show-report
51
90
  ```
52
91
 
53
92
  #### 👌 Improvements
93
+
54
94
  - **Database Optimization**: Enhanced database operations with transactions and indexing for better performance and reliability.
55
95
  - **CSS and UI Enhancements**:
56
96
  - Improved tabbed design for steps, errors, and logs (#50), ensuring an organized and intuitive user experience.
@@ -62,32 +102,37 @@ npx ortoni-report show-report
62
102
  ## v2.0.8
63
103
 
64
104
  #### 🐛 Fixes
105
+
65
106
  - **Peer Dependency**: Added peer dependecy to avoid external package conflict
66
107
 
67
108
  ## v2.0.7
68
109
 
69
110
  #### 📦 New Features
111
+
70
112
  - **Test History Display**: Added support for displaying test history up to the last 10 executions, providing better insight into recent test performance.
71
113
  - **Console Error Reporting**: Enhanced with console error display and the ability to skip report generation if no tests are found.
72
114
  - **Console Log Configuration**: Introduced a new `console` boolean configuration option to toggle the display of test console logs, set to `true` by default.
73
115
 
74
116
  #### 👌 Improvements
117
+
75
118
  - **UI and CSS Enhancements**:
76
119
  - Updated CSS color scheme and implemented minor UI tweaks for a more polished look.
77
120
  - Added project-specific icons for Chromium, Firefox, and WebKit to make test projects easily identifiable.
78
121
 
79
122
  #### 🐛 Fixes
80
- - **Trace Link Bug (#38)**: Fixed an issue where the trace link only captured the origin and not the pathname, ensuring accurate trace navigation.
81
-
82
123
 
124
+ - **Trace Link Bug (#38)**: Fixed an issue where the trace link only captured the origin and not the pathname, ensuring accurate trace navigation.
83
125
 
84
126
  ## v2.0.6
85
127
 
86
128
  #### 🐛 Fixes
129
+
87
130
  - **Trace Path in Pipeline**: Resolved issue with incorrect trace file path in CI/CD pipeline, ensuring trace paths are properly resolved.
88
131
 
89
132
  #### 👌 Improvements
133
+
90
134
  - **Search Functionality**:
135
+
91
136
  - **Removed from Navbar**: Search functionality has been removed from the navbar to enhance navigation simplicity.
92
137
  - **Added to Test Panel**: Search functionality has been relocated to the test panel for more intuitive test filtering.
93
138
 
@@ -97,17 +142,20 @@ npx ortoni-report show-report
97
142
  ## v2.0.5
98
143
 
99
144
  ### 🚀 New Features
145
+
100
146
  - **Open report in localhost**: Introduced the ability to open the report on localhost with configurable options:
101
147
  - `open?: "always" | "never" | "on-failure"`.
102
148
  - **Open Trace viewer within the same browser**: Added functionality to view the Playwright trace within the same browser tab, enhancing the user experience.
103
149
 
104
150
  ### ✨ Improvements
151
+
105
152
  - **Perfect Test content UI**: Enhanced the UI of the test content for a more polished and user-friendly interface.
106
153
  - **Refactored code with multiple classes and utilities**: Codebase has been refactored for better organization, incorporating multiple classes and utilities to improve maintainability and scalability.
107
154
 
108
155
  ## Version 2.0.4
109
156
 
110
157
  ### 🚀 New Features
158
+
111
159
  - **Tags & Annotations**: Added support for tags and annotations, allowing for more detailed reporting and metadata.
112
160
  - **Project charts & summary UI**: Enhanced the user interface of project charts and the summary section for better presentation and usability.
113
161
 
@@ -116,21 +164,24 @@ npx ortoni-report show-report
116
164
  - **Snippets color**: Improved the color scheme of code snippets for better readability.
117
165
 
118
166
  ### 🛠 Fixes
167
+
119
168
  - **Console warning**: Resolved a console warning issue, improving overall stability.
120
169
 
121
170
  ### Documentation
122
- - **Removed colors package**: Updated documentation to reflect the removal of the `colors` package.
123
171
 
172
+ - **Removed colors package**: Updated documentation to reflect the removal of the `colors` package.
124
173
 
125
174
  ## Version 2.0.3
126
175
 
127
176
  #### 🚀 New Features
177
+
128
178
  - **Add screenshot attachment as pagination**: Now supports adding screenshot attachments for easier navigation and pagination.
129
179
  - **Bulma Inline CSS**: Integrated Bulma inline CSS for improved styling.
130
180
  - **Show card if the count has value**: Cards will now appear only when a valid count is present.
131
181
  - **Folder Path**: Introduced a new feature to store the result in the folder path.
132
182
 
133
183
  #### ✨ Improvements
184
+
134
185
  - **Chart JS as CDN**: Enhanced performance by switching Chart.js to be served via CDN.
135
186
  - **Theme icon, navbar & summary icons**: Refined the design of theme icons, navbar, and summary icons for a better user experience.
136
187
  - **User meta icons**: Updated and improved the appearance of user meta icons.
@@ -145,23 +196,24 @@ npx ortoni-report show-report
145
196
 
146
197
  - **Show or Hide Projects in Test List**
147
198
  - You can now show or hide specific projects in the test list.
148
- - ```showProject: true``` from config
149
-
199
+ - `showProject: true` from config
150
200
  - **Document Title from Config**
201
+
151
202
  - The document title is now configurable via the configuration file, allowing you to customize it to your preference.
152
203
 
153
204
  - **Display Tags in Test Section**
205
+
154
206
  - Tags associated with tests are now displayed within the test section, giving you a clearer overview of test categories.
155
207
 
156
208
  - **Project and Tags Added to Filter**
157
209
  - We've added the ability to filter tests by both project and tags, enhancing the granularity of your test views.
158
-
159
210
  - **Display Selected Status on UI**
160
211
  - The selected status filter is now visible on the UI, making it easier to track the current filter settings.
161
212
 
162
213
  #### 🛠 Fixes
163
214
 
164
215
  - **Project Drop-down Z-Index on Screenshot**
216
+
165
217
  - Resolved an issue where the project drop-down menu was being overlapped by screenshots. The z-index has been adjusted for proper layering.
166
218
 
167
219
  - **Project Filter Hide Test Steps**
@@ -170,17 +222,19 @@ npx ortoni-report show-report
170
222
  #### ✨ Improvements
171
223
 
172
224
  - **Hide Skipped Tests on All Tests Filter**
225
+
173
226
  - Skipped tests are now hidden by default when using the "All Tests" filter, providing a cleaner and more focused view of relevant tests.
174
227
 
175
228
  - **Colorful Dashboard**
176
229
  - We've enhanced the visual appeal of the dashboard with more vibrant and intuitive colors, making it easier to navigate and interpret results.
177
230
 
178
-
179
231
  ## Version 2.0.1
232
+
180
233
  - Fixed local and root path issue of Parcel bundler.
181
234
  - Local config issue
182
235
 
183
236
  ## Version 2.0.0
237
+
184
238
  - Fixed local and root path issue of Parcel bundler.
185
239
 
186
240
  ## Version 1.1.9
@@ -193,9 +247,9 @@ npx ortoni-report show-report
193
247
  ### Command-Line Interface
194
248
 
195
249
  - **Generate Report Command**: Added a new CLI command to generate and bundle the report:
196
- ```sh
197
- npx ortoni-report gr
198
- ```
250
+ ```sh
251
+ npx ortoni-report gr
252
+ ```
199
253
  This command allows users to easily generate the report with a single command.
200
254
 
201
255
  ### Enhancements
@@ -203,27 +257,31 @@ npx ortoni-report show-report
203
257
  - **Bundled Report**: The generated report is now bundled into a single file, making it easier to zip and share.
204
258
  - **Storage Location**: The bundled report is stored in the `project/ortoni-report` folder for better organization and accessibility.
205
259
 
206
-
207
260
  ## Version 1.1.8
208
261
 
209
262
  ### Fixed
263
+
210
264
  - CSS issue
211
265
 
212
266
  ## Version 1.1.7
213
267
 
214
268
  ### Fixed
269
+
215
270
  - Layout issue where the test column extends off-screen
216
- - Screenshot layout of tests executed on mobile viewport
271
+ - Screenshot layout of tests executed on mobile viewport
217
272
 
218
273
  ### New
274
+
219
275
  - Add custom project/organization logo
220
276
  - Exception handling in `ortoni-report.ts`
221
277
  - Added docs to the `OrtoniReportConfig`
222
278
 
223
279
  ### Improved
280
+
224
281
  - Margin on Test List for better spacing
225
282
 
226
283
  ## Version 1.1.6
284
+
227
285
  - Implemented debounce function to reduce search event handling frequency.
228
286
  - Modified steps details to open only if a test has errors, enhancing UI clarity.
229
287
  - Optimized data load by removing unnecessary inner steps, improving performance.
@@ -233,18 +291,15 @@ npx ortoni-report show-report
233
291
  - Introduced user option to choose between base64 images and file path for screenshots.
234
292
 
235
293
  ## Version 1.1.5
294
+
236
295
  - Added config properly to readme
237
296
 
238
297
  ## Version 1.1.4
239
298
 
240
299
  1. **CSS Enhancement**: Updated CSS framework to Bulma for improved visualization and mobile responsiveness.
241
-
242
300
  2. **Screenshots**: Implemented screenshot attachment as base64 images for enhanced report details.
243
-
244
301
  3. **Toggle Theme Button**: Added a toggle theme button allowing users to switch between dark and light themes for better readability.
245
-
246
302
  4. **Project Filtering**: Implemented filtering of tests by projects (e.g., chromium, firefox) to streamline test result views.
247
-
248
303
  5. **Configuration Option**: Introduced `OrtoniReportConfig` for customizable report settings:
249
304
  ```typescript
250
305
  import {OrtoniReportConfig} from "ortoni-report";
@@ -258,16 +313,17 @@ npx ortoni-report show-report
258
313
  ```
259
314
  6. **Design Improvements**: Made overall design enhancements and added CSS transitions for smoother user interactions.
260
315
 
261
-
262
316
  ## Version 1.1.3
263
317
 
264
318
  **New Features:**
319
+
265
320
  - Added detailed steps to the testDetails section in the HTML report.
266
321
  - Introduced a new flaky icon for better visual representation in the report.
267
322
  - Display of test steps in the HTML report.
268
323
  - Added a filter for retry tests to better categorize and display them.
269
324
 
270
325
  **Improved:**
326
+
271
327
  - Updated the package dependencies to remove vulnerabilities.
272
328
  - Enhanced time formatting to include milliseconds in the duration display.
273
329
  - Enhanced the calculation and display of the success rate in the HTML report.
@@ -275,21 +331,25 @@ npx ortoni-report show-report
275
331
  ## Version 1.1.2
276
332
 
277
333
  **New Features:**
334
+
278
335
  - **Ellipsis Styling for Test Names:** Long test names are now truncated with ellipsis for better readability.
279
336
  - **Retry, Pass, Fail, and Skip Indicators:** Added visual indicators (images) to denote the status of each test, including retries.
280
337
  - **Enhanced `msToTime` Function:** Duration now includes milliseconds for more precise time tracking.
281
338
  - **Summary Filters:** Clicking on summary filters (passed, failed & other) to display the selected filter.
282
339
 
283
340
  **Improvements:**
341
+
284
342
  - **Unified Status Handling:** The `applyFilter` function now treats `failed` and `timedOut` statuses as the same for consistent filtering.
285
343
  - **Date and Time Formatting:** Passed date in the format `DD-MMM-YYYY` and included time for more detailed reporting.
286
344
  - **Success Rate and Last Run Data:** Added the ability to pass `successRate` and `lastRun` data to the `onEnd` method for comprehensive report details.
287
345
 
288
346
  **Bug Fixes:**
347
+
289
348
  - Fixed issues with conditionals in Handlebars for status checking.
290
349
  - Improved event listener attachment for filtering and search functionalities.
291
350
 
292
351
  **Notes:**
352
+
293
353
  - Screenshot handling has been enhanced with modal dialogs, using Pico.css for styling.
294
354
 
295
355
  This release includes several visual and functional enhancements aimed at improving the usability and readability of the Playwright test reports. The added features and improvements will help users better understand test outcomes and statuses at a glance.
@@ -297,27 +357,32 @@ This release includes several visual and functional enhancements aimed at improv
297
357
  ### Version 1.1.0
298
358
 
299
359
  ## New Features
360
+
300
361
  - **Search Functionality:**
301
362
  - Added a search bar to filter tests by their title.
302
363
  - Display the relevant test name, project, and test file name while hiding others during search.
303
364
  - Reset search form to show all tests when cleared.
304
365
 
305
- ## Improvements
366
+ ## Improvements
367
+
306
368
  - **Page Zoom:**
307
369
  - Set the HTML page zoom to 90% for better display on different screen sizes.
308
370
 
309
371
  ## Bug Fixes
372
+
310
373
  - **Event Listeners:**
311
374
  - Fixed an issue where test details would not display when clicking on filtered search results.
312
375
  - Ensured event listeners are correctly reattached after filtering search results.
313
376
 
314
377
  ## Style Adjustments
378
+
315
379
  - **CSS Adjustments:**
316
380
  - Adjusted body zoom for better overall display: `body { zoom: 0.9; }`
317
381
 
318
382
  ---
319
383
 
320
384
  ### Instructions for Users
385
+
321
386
  - Use the search bar to quickly find specific tests by their title.
322
387
  - Clear the search input to reset the view and display all tests.
323
388
  - Note that the page zoom has been set to 90% for optimal display.
@@ -325,6 +390,7 @@ This release includes several visual and functional enhancements aimed at improv
325
390
  ### Version 1.0.9
326
391
 
327
392
  **Added:**
393
+
328
394
  1. Added functionality to highlight selected test result in the list
329
395
  2. Implemented search functionality to filter test results based on user input
330
396
  3. Added reset functionality to display all tests when the search bar is cleared
@@ -335,14 +401,16 @@ This release includes several visual and functional enhancements aimed at improv
335
401
  8. Added flaky test (Retry results)
336
402
 
337
403
  **Fixed**
404
+
338
405
  1. File path based on unix/windows machine [ISSUE#1](https://github.com/ortoniKC/ortoni-report/issues/1)
339
406
  2. Log & Error message display where it shows the actual html element
340
407
  3. Skip test duration of 0s for the skipper test
341
408
  4. Fixed Absolute path of test files
342
409
 
343
410
  **Changed:**
411
+
344
412
  1. Modified the `displayTestDetails` function to remove highlights when displaying test details
345
413
  2. Updated the `searchTests` function to show all tests when the search query is empty
346
414
  3. Improved time format to HH:MM:SS
347
415
 
348
- These changes improve the user experience by allowing users to easily search for specific tests and providing visual feedback when selecting a test result from the list.
416
+ These changes improve the user experience by allowing users to easily search for specific tests and providing visual feedback when selecting a test result from the list.
@@ -0,0 +1,76 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
4
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
5
+ }) : x)(function(x) {
6
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
+ throw Error('Dynamic require of "' + x + '" is not supported');
8
+ });
9
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
10
+
11
+ // src/utils/expressServer.ts
12
+ import express from "express";
13
+ import path from "path";
14
+ import { spawn } from "child_process";
15
+ function startReportServer(reportFolder, reportFilename, port = 2004, open) {
16
+ const app = express();
17
+ app.use(express.static(reportFolder));
18
+ app.get("/", (_req, res) => {
19
+ try {
20
+ res.sendFile(path.resolve(reportFolder, reportFilename));
21
+ } catch (error) {
22
+ console.error("Ortoni-Report: Error sending report file:", error);
23
+ res.status(500).send("Error loading report");
24
+ }
25
+ });
26
+ try {
27
+ const server = app.listen(port, () => {
28
+ console.log(
29
+ `Server is running at http://localhost:${port}
30
+ Press Ctrl+C to stop.`
31
+ );
32
+ if (open === "always" || open === "on-failure") {
33
+ try {
34
+ openBrowser(`http://localhost:${port}`);
35
+ } catch (error) {
36
+ console.error("Ortoni-Report: Error opening browser:", error);
37
+ }
38
+ }
39
+ });
40
+ server.on("error", (error) => {
41
+ if (error.code === "EADDRINUSE") {
42
+ console.error(
43
+ `Ortoni-Report: Port ${port} is already in use. Trying a different port...`
44
+ );
45
+ } else {
46
+ console.error("Ortoni-Report: Server error:", error);
47
+ }
48
+ });
49
+ } catch (error) {
50
+ console.error("Ortoni-Report: Error starting the server:", error);
51
+ }
52
+ }
53
+ function openBrowser(url) {
54
+ const platform = process.platform;
55
+ let command;
56
+ try {
57
+ if (platform === "win32") {
58
+ command = "cmd";
59
+ spawn(command, ["/c", "start", url]);
60
+ } else if (platform === "darwin") {
61
+ command = "open";
62
+ spawn(command, [url]);
63
+ } else {
64
+ command = "xdg-open";
65
+ spawn(command, [url]);
66
+ }
67
+ } catch (error) {
68
+ console.error("Ortoni-Report: Error opening the browser:", error);
69
+ }
70
+ }
71
+
72
+ export {
73
+ __require,
74
+ __publicField,
75
+ startReportServer
76
+ };
@@ -0,0 +1,69 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ // src/utils/expressServer.ts
6
+ import express from "express";
7
+ import path from "path";
8
+ import { spawn } from "child_process";
9
+ function startReportServer(reportFolder, reportFilename, port = 2004, open) {
10
+ const app = express();
11
+ app.use(express.static(reportFolder));
12
+ app.get("/", (_req, res) => {
13
+ try {
14
+ res.sendFile(path.resolve(reportFolder, reportFilename));
15
+ } catch (error) {
16
+ console.error("Ortoni-Report: Error sending report file:", error);
17
+ res.status(500).send("Error loading report");
18
+ }
19
+ });
20
+ try {
21
+ const server = app.listen(port, () => {
22
+ console.log(
23
+ `Server is running at http://localhost:${port}
24
+ Press Ctrl+C to stop.`
25
+ );
26
+ if (open === "always" || open === "on-failure") {
27
+ try {
28
+ openBrowser(`http://localhost:${port}`);
29
+ } catch (error) {
30
+ console.error("Ortoni-Report: Error opening browser:", error);
31
+ }
32
+ }
33
+ });
34
+ server.on("error", (error) => {
35
+ if (error.code === "EADDRINUSE") {
36
+ console.error(
37
+ `Ortoni-Report: Port ${port} is already in use. Trying a different port...`
38
+ );
39
+ } else {
40
+ console.error("Ortoni-Report: Server error:", error);
41
+ }
42
+ });
43
+ } catch (error) {
44
+ console.error("Ortoni-Report: Error starting the server:", error);
45
+ }
46
+ }
47
+ function openBrowser(url) {
48
+ const platform = process.platform;
49
+ let command;
50
+ try {
51
+ if (platform === "win32") {
52
+ command = "cmd";
53
+ spawn(command, ["/c", "start", url]);
54
+ } else if (platform === "darwin") {
55
+ command = "open";
56
+ spawn(command, [url]);
57
+ } else {
58
+ command = "xdg-open";
59
+ spawn(command, [url]);
60
+ }
61
+ } catch (error) {
62
+ console.error("Ortoni-Report: Error opening the browser:", error);
63
+ }
64
+ }
65
+
66
+ export {
67
+ __publicField,
68
+ startReportServer
69
+ };
@@ -0,0 +1,72 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
8
+ // src/utils/expressServer.ts
9
+ import express from "express";
10
+ import path from "path";
11
+ import { spawn } from "child_process";
12
+ function startReportServer(reportFolder, reportFilename, port = 2004, open) {
13
+ const app = express();
14
+ app.use(express.static(reportFolder));
15
+ app.get("/", (_req, res) => {
16
+ try {
17
+ res.sendFile(path.resolve(reportFolder, reportFilename));
18
+ } catch (error) {
19
+ console.error("Ortoni-Report: Error sending report file:", error);
20
+ res.status(500).send("Error loading report");
21
+ }
22
+ });
23
+ try {
24
+ const server = app.listen(port, () => {
25
+ console.log(
26
+ `Server is running at http://localhost:${port}
27
+ Press Ctrl+C to stop.`
28
+ );
29
+ if (open === "always" || open === "on-failure") {
30
+ try {
31
+ openBrowser(`http://localhost:${port}`);
32
+ } catch (error) {
33
+ console.error("Ortoni-Report: Error opening browser:", error);
34
+ }
35
+ }
36
+ });
37
+ server.on("error", (error) => {
38
+ if (error.code === "EADDRINUSE") {
39
+ console.error(
40
+ `Ortoni-Report: Port ${port} is already in use. Trying a different port...`
41
+ );
42
+ } else {
43
+ console.error("Ortoni-Report: Server error:", error);
44
+ }
45
+ });
46
+ } catch (error) {
47
+ console.error("Ortoni-Report: Error starting the server:", error);
48
+ }
49
+ }
50
+ function openBrowser(url) {
51
+ const platform = process.platform;
52
+ let command;
53
+ try {
54
+ if (platform === "win32") {
55
+ command = "cmd";
56
+ spawn(command, ["/c", "start", url]);
57
+ } else if (platform === "darwin") {
58
+ command = "open";
59
+ spawn(command, [url]);
60
+ } else {
61
+ command = "xdg-open";
62
+ spawn(command, [url]);
63
+ }
64
+ } catch (error) {
65
+ console.error("Ortoni-Report: Error opening the browser:", error);
66
+ }
67
+ }
68
+
69
+ export {
70
+ __require,
71
+ startReportServer
72
+ };
package/dist/cli/cli.js CHANGED
@@ -43,8 +43,10 @@ function startReportServer(reportFolder, reportFilename, port = 2004, open) {
43
43
  });
44
44
  try {
45
45
  const server = app.listen(port, () => {
46
- console.log(`Server is running at http://localhost:${port}
47
- Press Ctrl+C to stop.`);
46
+ console.log(
47
+ `Server is running at http://localhost:${port}
48
+ Press Ctrl+C to stop.`
49
+ );
48
50
  if (open === "always" || open === "on-failure") {
49
51
  try {
50
52
  openBrowser(`http://localhost:${port}`);
@@ -55,7 +57,9 @@ Press Ctrl+C to stop.`);
55
57
  });
56
58
  server.on("error", (error) => {
57
59
  if (error.code === "EADDRINUSE") {
58
- console.error(`Ortoni-Report: Port ${port} is already in use. Trying a different port...`);
60
+ console.error(
61
+ `Ortoni-Report: Port ${port} is already in use. Trying a different port...`
62
+ );
59
63
  } else {
60
64
  console.error("Ortoni-Report: Server error:", error);
61
65
  }
package/dist/cli/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startReportServer
4
- } from "../chunk-ZSIRUQUA.mjs";
4
+ } from "../chunk-A6HCKATU.mjs";
5
5
 
6
6
  // src/cli/cli.ts
7
7
  import { program } from "commander";
@@ -84,6 +84,10 @@ interface OrtoniReportConfig {
84
84
  * @example { "key": "value" } as string
85
85
  */
86
86
  meta?: Record<string, string>;
87
+ /**
88
+ * Chart type on the dashboard.
89
+ * @example "doughnut" | "pie" */
90
+ chartType?: "doughnut" | "pie";
87
91
  }
88
92
 
89
93
  declare class OrtoniReport implements Reporter {
@@ -101,6 +105,7 @@ declare class OrtoniReport implements Reporter {
101
105
  private dbManager;
102
106
  private shouldGenerateReport;
103
107
  private showConsoleLogs;
108
+ private skipTraceViewer;
104
109
  constructor(ortoniConfig?: OrtoniReportConfig);
105
110
  private reportsCount;
106
111
  onBegin(config: FullConfig, _suite: Suite): Promise<void>;