ortoni-report 2.0.3 → 2.0.4

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.
@@ -1,46 +1,208 @@
1
1
  <header class="has-text-centered title is-4">Suite</header>
2
- <div class="columns">
2
+
3
+ <div class="columns is-multiline">
3
4
  <div class="column is-half">
4
- <div class="content">
5
- {{#if authorName}}
6
- <p class="is-flex is-align-items-center mb-2">
7
- <span class="icon has-text-link is-small mr-2">
8
- <i class="fa-solid fa-user-tie"></i>
9
- </span>
10
- <span class="is-size-6">{{authorName}}</span>
11
- </p>
12
- {{/if}}
13
- {{#if testType}}
14
- <p class="is-flex is-align-items-center mb-2">
15
- <span class="icon has-text-primary is-small mr-2">
16
- <i class="fas fa-code-branch" style="color: thistle;"></i>
17
- </span>
18
- <span class="is-size-6">{{testType}}</span>
19
- </p>
20
- {{/if}}
21
- <p class="is-flex is-align-items-center mb-2">
22
- <span class="icon has-text-primary is-small mr-2">
23
- <i class="fas fa-stopwatch" style="color: peachpuff;"></i>
24
- </span>
25
- <span class="is-size-6">{{totalDuration}}</span>
26
- </p>
27
- <p class="is-flex is-align-items-center mb-2">
28
- <span class="icon has-text-success is-small mr-2">
5
+ <div class="field">
6
+ <label class="label" for="Success Rate">Success Rate</label>
7
+ <p class="is-flex is-align-items-center">
8
+ <span class="icon has-text-success mr-2">
29
9
  <i class="fas fa-chart-pie"></i>
30
10
  </span>
31
- <span class="is-size-6 has-text-weight-bold">{{successRate}} %</span>
11
+ <span class="is-size-5 has-text-weight-bold">{{successRate}} %</span>
32
12
  </p>
33
- <p class="is-flex is-align-items-center mb-2">
34
- <span class="icon has-text-info is-small mr-2">
13
+ </div>
14
+ <div class="field">
15
+ <label class="label" for="Last Run">Last Run</label>
16
+ <p class="is-flex is-align-items-center">
17
+ <span class="icon has-text-info mr-2">
35
18
  <i class="fas fa-calendar-alt"></i>
36
19
  </span>
37
- <span class="is-size-6">{{lastRunDate}}</span>
20
+ <span class="is-size-5">{{lastRunDate}}</span>
21
+ </p>
22
+ </div>
23
+ <div class="field">
24
+ <label class="label" for="Duration">Duration</label>
25
+ <p class="is-flex is-align-items-center">
26
+ <span class="icon has-text-warning mr-2">
27
+ <i class="fas fa-stopwatch"></i>
28
+ </span>
29
+ <span class="is-size-5">{{totalDuration}}</span>
38
30
  </p>
39
31
  </div>
40
32
  </div>
41
33
  <div class="column is-half">
34
+ <div class="content">
35
+ <div class="content">
36
+ {{#if authorName}}
37
+ <div class="field"></div>
38
+ <label class="label" for="Tester">Tester</label>
39
+ <p class="is-flex is-align-items-center">
40
+ <span class="icon has-text-info mr-2">
41
+ <i class="fas fa-user-tie"></i>
42
+ </span>
43
+ <span class="is-size-5">{{authorName}}</span>
44
+ </p>
45
+ </div>
46
+ {{/if}}
47
+ {{#if testType}}
48
+ <div class="field">
49
+ <label class="label" for="test Type">Test Type</label>
50
+ <p class="is-flex is-align-items-center">
51
+ <span class="icon has-text-primary mr-2">
52
+ <i class="fas fa-code-branch"></i>
53
+ </span>
54
+ <span class="is-size-5">{{testType}}</span>
55
+ </p>
56
+ </div>
57
+ {{/if}}
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <div class="columns">
62
+ <div class="column is-half">
63
+ <h2 class="is-4 has-text-weight-bold">Summary</h2>
64
+ <hr class="has-background-primary">
42
65
  <div class="chart-container">
43
66
  <canvas id="testChart"></canvas>
44
67
  </div>
45
68
  </div>
69
+ <div class="column is-half">
70
+ <h2 class="is-4 has-text-weight-bold">Projects</h2>
71
+ <hr class="has-background-primary">
72
+ <div class="chart-container">
73
+ <canvas id="projectChart"></canvas>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ <div class="columns">
78
+ <div class="column">
79
+ <h2 class="is-4 has-text-weight-bold">Each Projects</h2>
80
+ <hr class="has-background-primary">
81
+ <div class="chart-container">
82
+ <canvas id="projectbarChart"></canvas>
83
+ </div>
84
+ </div>
85
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
86
+ <script>
87
+ const overallChart = document.getElementById('testChart');
88
+ new Chart(overallChart, {
89
+ type: "doughnut",
90
+ data: {
91
+ labels: ['Passed', 'Failed', 'Skipped', 'Flaky'],
92
+ datasets: [{
93
+ data: [{{ passCount }}, {{ failCount }}, {{ skipCount }}, {{ flakyCount }}],
94
+ backgroundColor: ['#28a745', '#ff6685', '#66d1ff', '#ffb70f']
95
+ }]
96
+ },
97
+ options: {
98
+ responsive: true,
99
+ maintainAspectRatio: false,
100
+ plugins: {
101
+ legend: {
102
+ position: 'bottom',
103
+ labels: {
104
+ filter: function (legendItem, chartData) {
105
+ const value = chartData.datasets[0].data[legendItem.index];
106
+ return value !== 0;
107
+ }
108
+ }
109
+ },
110
+ tooltip: {
111
+ callbacks: {
112
+ label: function(tooltipItem) {
113
+ const total = tooltipItem.dataset.data.reduce((a, b) => a + b, 0);
114
+ const value = tooltipItem.raw;
115
+ const percentage = ((value / total) * 100).toFixed(2);
116
+ return `${tooltipItem.label}: ${value} tests (${percentage}%)`;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ });
123
+ const projectChart = document.getElementById('projectChart');
124
+ const projectbarChart = document.getElementById('projectbarChart');
125
+
126
+ const projectNames = {{{ json projectNames }}};
127
+ const totalTests = {{{ json totalTests }}};
128
+ function generateRandomColor() {
129
+ const letters = '0123456789ABCDEF';
130
+ let color = '#';
131
+ for (let i = 0; i < 6; i++) {
132
+ color += letters[Math.floor(Math.random() * 16)];
133
+ }
134
+ return color;
135
+ }
136
+ const backgroundColors = totalTests.map(() => generateRandomColor());
137
+ new Chart(projectChart, {
138
+ type: 'doughnut',
139
+ data: {
140
+ labels: projectNames,
141
+ datasets: [{
142
+ data: totalTests,
143
+ backgroundColor: backgroundColors
144
+ }]
145
+ },
146
+ options: {
147
+ responsive: true,
148
+ maintainAspectRatio: false,
149
+ plugins: {
150
+ legend: {
151
+ position: 'bottom'
152
+ },
153
+ tooltip: {
154
+ callbacks: {
155
+ label: function (tooltipItem) {
156
+ return tooltipItem.label + ': ' + tooltipItem.raw + ' tests';
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ });
163
+ const passedTests = {{ json passedTests }};
164
+ const failedTests = {{ json failedTests }};
165
+ const skippedTests = {{ json skippedTests }};
166
+ const retryTests = {{ json retryTests }};
167
+ new Chart(projectbarChart, {
168
+ type: 'bar',
169
+ data: {
170
+ labels: projectNames,
171
+ datasets: [
172
+ {
173
+ label: 'Passed',
174
+ data: passedTests,
175
+ backgroundColor: '#28a745',
176
+ },
177
+ {
178
+ label: 'Failed',
179
+ data: failedTests,
180
+ backgroundColor: '#ff6685',
181
+ },
182
+ {
183
+ label: 'Skipped',
184
+ data: skippedTests,
185
+ backgroundColor: '#66d1ff',
186
+ },
187
+ {
188
+ label: 'Flaky',
189
+ data: retryTests,
190
+ backgroundColor: '#ffb70f',
191
+ }
192
+ ]
193
+ },
194
+ options: {
195
+ responsive: true,
196
+ maintainAspectRatio: false,
197
+ scales: {
198
+ x: {
199
+ beginAtZero: true
200
+ },
201
+ y: {
202
+ beginAtZero: true
203
+ }
204
+ }
205
+ }
206
+ });
207
+ </script>
46
208
  </div>
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "ortoni-report",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Playwright Report By LetCode with Koushik",
5
- "bin": {
6
- "ortoni-report": "./dist/cli/cli.js"
7
- },
8
5
  "scripts": {
9
6
  "tsc": "tsc",
10
7
  "build": "tsup",
@@ -36,12 +33,12 @@
36
33
  "devDependencies": {
37
34
  "@playwright/test": "^1.44.1",
38
35
  "@types/node": "^22.0.2",
39
- "colors": "^1.4.0",
40
- "commander": "^12.1.0",
36
+ "@types/ws": "^8.5.12",
37
+ "ansi-to-html": "^0.7.2",
41
38
  "handlebars": "^4.7.8",
42
39
  "tsup": "^6.5.0",
43
40
  "typescript": "^4.9.4",
44
- "parcel": "^2.12.0"
41
+ "ws": "^8.18.0"
45
42
  },
46
43
  "main": "dist/ortoni-report.js",
47
44
  "module": "dist/ortoni-report.mjs",
package/readme.md CHANGED
@@ -4,7 +4,7 @@ Welcome to **Ortoni Report**, a robust HTML report generator tailored for Playwr
4
4
 
5
5
  Experience the live report: [Ortoni Report](https://ortoni.netlify.app/)
6
6
 
7
- ![Ortoni Report Preview](https://raw.githubusercontent.com/ortoniKC/ortoni-report/refs/heads/V2.0.3/ortoni-report.PNG)
7
+ ![Ortoni Report Preview](https://raw.githubusercontent.com/ortoniKC/ortoni-report/refs/heads/V2.0.4/Ortoni-report.png)
8
8
 
9
9
  ## Key Features
10
10
 
@@ -120,6 +120,10 @@ We value your feedback and contributions! For issues, suggestions, or contributi
120
120
 
121
121
  Thank you for choosing Ortoni Report. We're committed to enhancing your Playwright testing experience.
122
122
 
123
+ ### Support
124
+ UPI: ortoni@axl (Koushik Chatterjee)
125
+
126
+
123
127
  ---
124
128
 
125
129
  **LetCode with Koushik**
package/dist/cli/cli.js DELETED
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
5
- };
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const commander_1 = require("commander");
10
- const child_process_1 = require("child_process");
11
- const utils_1 = require("../utils/utils");
12
- const findParcelBinary = () => {
13
- const localParcel = path_1.default.resolve(__dirname, '../../node_modules/.bin/parcel');
14
- const projectParcel = path_1.default.resolve(process.cwd(), 'node_modules/.bin/parcel');
15
- return fs_1.default.existsSync(localParcel) ? localParcel : projectParcel;
16
- };
17
- commander_1.program
18
- .name('ortoni-report')
19
- .description('Ortoni Report by LetCode with Koushik')
20
- .version('1.0.0');
21
- commander_1.program
22
- .command('gr')
23
- .description('Bundle Ortoni Report')
24
- .option('-f, --filename <filename>', 'Specify the filename for the generated report', 'ortoni-report.html')
25
- .action((options) => {
26
- const filename = (0, utils_1.ensureHtmlExtension)(options.filename);
27
- const reportPath = path_1.default.resolve(process.cwd(), filename);
28
- if (!fs_1.default.existsSync(reportPath)) {
29
- console.error(`${filename} not found. Please ensure the report has been generated.`);
30
- process.exit(1);
31
- }
32
- // Resolve the path to the local parcel binary
33
- const parcelPath = findParcelBinary();
34
- const parcelCommand = `${parcelPath} build ${reportPath} --dist-dir ortoni-report --public-url ./`;
35
- console.log('Bundling Ortoni Report...');
36
- (0, child_process_1.exec)(parcelCommand, (error, stdout, stderr) => {
37
- if (error) {
38
- console.error(`Error: ${error.message}`);
39
- return;
40
- }
41
- if (stderr) {
42
- console.error(`stderr: ${stderr}`);
43
- return;
44
- }
45
- console.log(`stdout: ${stdout}`);
46
- console.log('Report bundled successfully.');
47
- });
48
- });
49
- commander_1.program.parse(process.argv);