ortoni-report 2.0.9 → 3.0.0

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,209 +1,252 @@
1
- <header class="has-text-centered title is-4">Suite</header>
2
-
3
- <div class="columns is-multiline">
4
- <div class="column is-half">
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">
9
- <i class="fas fa-chart-pie"></i>
10
- </span>
11
- <span class="is-size-5 has-text-weight-bold">{{successRate}} %</span>
12
- </p>
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">
18
- <i class="fas fa-calendar-alt"></i>
19
- </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>
30
- </p>
31
- </div>
32
- </div>
33
- {{#if (or authorName testType)}}
34
- <div class="column is-half">
35
- <div class="content">
36
- {{#if authorName}}
37
- <div class="field">
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
-
48
- {{#if testType}}
49
- <div class="field">
50
- <label class="label" for="testType">Test Type</label>
51
- <p class="is-flex is-align-items-center">
52
- <span class="icon has-text-primary mr-2">
53
- <i class="fas fa-code-branch"></i>
54
- </span>
55
- <span class="is-size-5">{{testType}}</span>
56
- </p>
57
- </div>
58
- {{/if}}
59
- </div>
60
- </div>
61
- {{/if}}
62
- </div>
63
- <div class="columns">
64
- <div class="column is-half">
65
- <h2 class="is-4 has-text-weight-bold">Summary</h2>
66
- <hr class="has-background-primary">
67
- <div class="chart-container">
68
- <canvas id="testChart"></canvas>
69
- </div>
70
- </div>
71
- <div class="column is-half">
72
- <h2 class="is-4 has-text-weight-bold">Projects</h2>
73
- <hr class="has-background-primary">
74
- <div class="chart-container">
75
- <canvas id="projectChart"></canvas>
76
- </div>
77
- </div>
78
- </div>
79
- <div class="columns">
80
- <div class="column">
81
- <h2 class="is-4 has-text-weight-bold">Each Projects</h2>
82
- <hr class="has-background-primary">
83
- <div class="chart-container">
84
- <canvas id="projectbarChart"></canvas>
85
- </div>
86
- </div>
87
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
88
- <script>
89
- const overallChart = document.getElementById('testChart');
90
- new Chart(overallChart, {
91
- type: "doughnut",
92
- data: {
93
- labels: ['Passed', 'Failed', 'Skipped', 'Flaky'],
94
- datasets: [{
95
- data: [{{ passCount }}, {{ failCount }}, {{ skipCount }}, {{ flakyCount }}],
96
- backgroundColor: ['#28a745', '#ff6685', '#66d1ff', '#ffb70f']}]
97
- },
98
- options: {
99
- responsive: true,
100
- maintainAspectRatio: false,
101
- plugins: {
102
- legend: {
103
- position: 'bottom',
104
- labels: {
105
- filter: function (legendItem, chartData) {
106
- const value = chartData.datasets[0].data[legendItem.index];
107
- return value !== 0;
108
- }
109
- }
110
- },
111
- tooltip: {
112
- callbacks: {
113
- label: function (tooltipItem) {
114
- const total = tooltipItem.dataset.data.reduce((a, b) => a + b, 0);
115
- const value = tooltipItem.raw;
116
- const percentage = ((value / total) * 100).toFixed(2);
117
- return `${tooltipItem.label}: ${value} tests (${percentage}%)`;
118
- }
119
- }
120
- }
121
- }
122
- }
123
- });
124
- const projectChart = document.getElementById('projectChart');
125
- const projectbarChart = document.getElementById('projectbarChart');
126
-
127
- const projectNames = {{{ json projectNames }}};
128
- const totalTests = {{{ json totalTests }}};
129
- function generateRandomColor() {
130
- const letters = '0123456789ABCDEF';
131
- let color = '#';
132
- for (let i = 0; i < 6; i++) {
133
- color += letters[Math.floor(Math.random() * 16)];
134
- }
135
- return color;
136
- }
137
- const backgroundColors = totalTests.map(() => generateRandomColor());
138
- new Chart(projectChart, {
139
- type: 'doughnut',
140
- data: {
141
- labels: projectNames,
142
- datasets: [{
143
- data: totalTests,
144
- backgroundColor: backgroundColors
145
- }]
146
- },
147
- options: {
148
- responsive: true,
149
- maintainAspectRatio: false,
150
- plugins: {
151
- legend: {
152
- position: 'bottom'
153
- },
154
- tooltip: {
155
- callbacks: {
156
- label: function (tooltipItem) {
157
- return tooltipItem.label + ': ' + tooltipItem.raw + ' tests';
158
- }
159
- }
160
- }
161
- }
162
- }
163
- });
164
- const passedTests = {{ json passedTests }};
165
- const failedTests = {{ json failedTests }};
166
- const skippedTests = {{ json skippedTests }};
167
- const retryTests = {{ json retryTests }};
168
- new Chart(projectbarChart, {
169
- type: 'bar',
170
- data: {
171
- labels: projectNames,
172
- datasets: [
173
- {
174
- label: 'Passed',
175
- data: passedTests,
176
- backgroundColor: '#28a745',
177
- },
178
- {
179
- label: 'Failed',
180
- data: failedTests,
181
- backgroundColor: '#ff6685',
182
- },
183
- {
184
- label: 'Skipped',
185
- data: skippedTests,
186
- backgroundColor: '#66d1ff',
187
- },
188
- {
189
- label: 'Flaky',
190
- data: retryTests,
191
- backgroundColor: '#ffb70f',
192
- }
193
- ]
194
- },
195
- options: {
196
- responsive: true,
197
- maintainAspectRatio: false,
198
- scales: {
199
- x: {
200
- beginAtZero: true
201
- },
202
- y: {
203
- beginAtZero: true
204
- }
205
- }
206
- }
207
- });
208
- </script>
1
+ <div class="columns is-multiline">
2
+ <div class="column">
3
+ <div class="box">
4
+ <header class="title is-4">Result</header>
5
+ <div class="field">
6
+ <strong for="Success Rate">Success Rate</strong>
7
+ <p class="is-flex is-align-items-center">
8
+ <span class="icon has-text-success mr-2">
9
+ <i class="fas fa-chart-pie"></i>
10
+ </span>
11
+ <span class="is-size-5 has-text-weight-bold">{{successRate}} %</span>
12
+ </p>
13
+ </div>
14
+ <div class="field">
15
+ <strong for="Last Run">Last Run</strong>
16
+ <p class="is-flex is-align-items-center">
17
+ <span class="icon has-text-info mr-2">
18
+ <i class="fas fa-calendar-alt"></i>
19
+ </span>
20
+ <span class="is-size-5">{{lastRunDate}}</span>
21
+ </p>
22
+ </div>
23
+ <div class="field">
24
+ <strong for="Duration">Duration</strong>
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>
30
+ </p>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div class="column">
35
+ <div class="box">
36
+ <header class="title is-4">Suite</header>
37
+ {{#if (or authorName testType)}}
38
+ <div class="content">
39
+ {{#if projectName}}
40
+ <div class="field">
41
+ <strong for="ProjectName">Project Name</strong>
42
+ <p class="is-flex is-align-items-center">
43
+ <span class="icon has-text-info mr-2">
44
+ <i class="fa-solid fa-shield"></i>
45
+ </span>
46
+ <span class="is-size-5">{{projectName}}</span>
47
+ </p>
48
+ </div>
49
+ {{/if}}
50
+ {{#if authorName}}
51
+ <div class="field">
52
+ <strong for="Tester">Tester</strong>
53
+ <p class="is-flex is-align-items-center">
54
+ <span class="icon has-text-info mr-2">
55
+ <i class="fas fa-user-tie"></i>
56
+ </span>
57
+ <span class="is-size-5">{{authorName}}</span>
58
+ </p>
59
+ </div>
60
+ {{/if}}
61
+ {{#if testType}}
62
+ <div class="field">
63
+ <strong for="testType">Test Type</strong>
64
+ <p class="is-flex is-align-items-center">
65
+ <span class="icon has-text-info mr-2">
66
+ <i class="fas fa-code-branch"></i>
67
+ </span>
68
+ <span class="is-size-5">{{testType}}</span>
69
+ </p>
70
+ </div>
71
+ {{/if}}
72
+ </div>
73
+ {{/if}}
74
+ </div>
75
+ </div>
76
+ {{#if meta}}
77
+ <div class="column">
78
+ <div class="box">
79
+ <header class="title is-4">Meta Information</header>
80
+ {{#each meta}}
81
+ <p><strong>{{@key}}:</strong> {{this}}</p>
82
+ {{/each}}
83
+ </div>
84
+ </div>
85
+ {{/if}}
86
+
87
+ </div>
88
+
89
+ <div class="box">
90
+ <div class="columns">
91
+ <div class="column">
92
+ <h2 class="is-4 has-text-weight-bold">Summary</h2>
93
+ <hr class="has-background-primary">
94
+ <div class="chart-container">
95
+ <canvas id="testChart"></canvas>
96
+ </div>
97
+ </div>
98
+ <div class="column">
99
+ <h2 class="is-4 has-text-weight-bold">Projects</h2>
100
+ <hr class="has-background-primary">
101
+ <div class="chart-container">
102
+ <canvas id="projectChart"></canvas>
103
+ </div>
104
+ </div>
105
+ <div class="column">
106
+ <h2 class="is-4 has-text-weight-bold">Each Projects</h2>
107
+ <hr class="has-background-primary">
108
+ <div class="chart-container has-text-centered">
109
+ <canvas id="projectbarChart"></canvas>
110
+ </div>
111
+ </div>
112
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
113
+ <script>
114
+ const overallChart = document.getElementById('testChart');
115
+ new Chart(overallChart, {
116
+ type: "doughnut",
117
+ data: {
118
+ labels: ['Passed', 'Failed', 'Skipped', 'Flaky'],
119
+ datasets: [{
120
+ data: [{{ passCount }}, {{ failCount }}, {{ skipCount }}, {{ flakyCount }}],
121
+ backgroundColor: ['#28a745', '#ff6685', '#66d1ff', '#ffb70f']}]
122
+ },
123
+ options: {
124
+ responsive: true,
125
+ maintainAspectRatio: false,
126
+ plugins: {
127
+ legend: {
128
+ position: 'bottom',
129
+ labels: {
130
+ filter: function (legendItem, chartData) {
131
+ const value = chartData.datasets[0].data[legendItem.index];
132
+ return value !== 0;
133
+ }
134
+ }
135
+ },
136
+ tooltip: {
137
+ callbacks: {
138
+ label: function (tooltipItem) {
139
+ const total = tooltipItem.dataset.data.reduce((a, b) => a + b, 0);
140
+ const value = tooltipItem.raw;
141
+ const percentage = ((value / total) * 100).toFixed(2);
142
+ return `${tooltipItem.label}: ${value} tests (${percentage}%)`;
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ });
149
+ const projectChart = document.getElementById('projectChart');
150
+ const projectbarChart = document.getElementById('projectbarChart');
151
+
152
+ const projectNames = {{{ json projectNames }}};
153
+ const totalTests = {{{ json totalTests }}};
154
+ function generateRandomColor() {
155
+ const letters = '0123456789ABCDEF';
156
+ let color = '#';
157
+ for (let i = 0; i < 6; i++) {
158
+ color += letters[Math.floor(Math.random() * 16)];
159
+ }
160
+ return color;
161
+ }
162
+ const backgroundColors = totalTests.map(() => generateRandomColor());
163
+ new Chart(projectChart, {
164
+ type: 'doughnut',
165
+ data: {
166
+ labels: projectNames,
167
+ datasets: [{
168
+ data: totalTests,
169
+ backgroundColor: backgroundColors
170
+ }]
171
+ },
172
+ options: {
173
+ responsive: true,
174
+ maintainAspectRatio: false,
175
+ plugins: {
176
+ legend: {
177
+ position: 'bottom'
178
+ },
179
+ tooltip: {
180
+ callbacks: {
181
+ label: function (tooltipItem) {
182
+ return tooltipItem.label + ': ' + tooltipItem.raw + ' tests';
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ });
189
+ const passedTests = {{ json passedTests }};
190
+ const failedTests = {{ json failedTests }};
191
+ const skippedTests = {{ json skippedTests }};
192
+ const retryTests = {{ json retryTests }};
193
+ new Chart(projectbarChart, {
194
+ type: 'bar',
195
+ data: {
196
+ barPercentage: 1,
197
+ barThickness: 6,
198
+ maxBarThickness: 8,
199
+ minBarLength: 2,
200
+ labels: projectNames,
201
+ datasets: [
202
+ {
203
+ label: 'Passed',
204
+ data: passedTests,
205
+ backgroundColor: '#28a745',
206
+ },
207
+ {
208
+ label: 'Failed',
209
+ data: failedTests,
210
+ backgroundColor: '#ff6685',
211
+ },
212
+ {
213
+ label: 'Skipped',
214
+ data: skippedTests,
215
+ backgroundColor: '#66d1ff',
216
+ },
217
+ {
218
+ label: 'Flaky',
219
+ data: retryTests,
220
+ backgroundColor: '#ffb70f',
221
+ }
222
+ ]
223
+ },
224
+ options: {
225
+ indexAxis: 'y',
226
+ responsive: true,
227
+ maintainAspectRatio: false,
228
+ scales: {
229
+ x: {
230
+ beginAtZero: true,
231
+ ticks: {
232
+ autoSkip: false,
233
+ maxRotation: 45
234
+ }
235
+ },
236
+ y: {
237
+ beginAtZero: true
238
+ }
239
+ },
240
+ plugins: {
241
+ legend: {
242
+ display: true,
243
+ position: 'bottom'
244
+ }
245
+ },
246
+ barPercentage: 0.6,
247
+ categoryPercentage: 0.8,
248
+ }
249
+ });
250
+ </script>
251
+ </div>
209
252
  </div>
package/package.json CHANGED
@@ -1,57 +1,55 @@
1
- {
2
- "name": "ortoni-report",
3
- "version": "2.0.9",
4
- "description": "Playwright Report By LetCode with Koushik",
5
- "scripts": {
6
- "tsc": "tsc",
7
- "build": "tsup",
8
- "release": "npm publish"
9
- },
10
- "bin": {
11
- "ortoni-report": "./dist/cli/cli.js"
12
- },
13
- "files": [
14
- "dist",
15
- "README.md",
16
- "CHANGELOG.md"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/ortoniKC/ortoni-report"
21
- },
22
- "keywords": [
23
- "playwright report",
24
- "playwright letcode",
25
- "letcode koushik",
26
- "ortoni report",
27
- "ortoni-report",
28
- "playwright html"
29
- ],
30
- "author": "Koushik Chatterjee (LetCode with Koushik)",
31
- "license": "GPL-3.0-only",
32
- "bugs": {
33
- "url": "https://github.com/ortoniKC/ortoni-report/issues"
34
- },
35
- "homepage": "https://github.com/ortoniKC/ortoni-report#readme",
36
- "devDependencies": {
37
- "@playwright/test": "^1.49.0",
38
- "@types/express": "^5.0.0",
39
- "@types/node": "^22.0.2",
40
- "@types/sqlite3": "^3.1.11",
41
- "@types/ws": "^8.5.12",
42
- "ansi-to-html": "^0.7.2",
43
- "commander": "^12.1.0",
44
- "express": "^4.21.1",
45
- "handlebars": "^4.7.8",
46
- "tsup": "^6.5.0",
47
- "typescript": "^4.9.4"
48
- },
49
- "peerDependencies": {
50
- "sqlite": "^5.1.1",
51
- "sqlite3": "^5.1.7",
52
- "ws": "^8.18.0"
53
- },
54
- "main": "dist/ortoni-report.js",
55
- "module": "dist/ortoni-report.mjs",
56
- "types": "dist/ortoni-report.d.ts"
1
+ {
2
+ "name": "ortoni-report",
3
+ "version": "3.0.0",
4
+ "description": "Playwright Report By LetCode with Koushik",
5
+ "scripts": {
6
+ "tsc": "tsc",
7
+ "build": "tsup",
8
+ "release": "npm publish"
9
+ },
10
+ "bin": {
11
+ "ortoni-report": "./dist/cli/cli.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "README.md",
16
+ "CHANGELOG.md"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/ortoniKC/ortoni-report"
21
+ },
22
+ "keywords": [
23
+ "playwright report",
24
+ "playwright letcode",
25
+ "letcode koushik",
26
+ "ortoni report",
27
+ "ortoni-report",
28
+ "playwright html"
29
+ ],
30
+ "author": "Koushik Chatterjee (LetCode with Koushik)",
31
+ "license": "GPL-3.0-only",
32
+ "bugs": {
33
+ "url": "https://github.com/ortoniKC/ortoni-report/issues"
34
+ },
35
+ "homepage": "https://github.com/ortoniKC/ortoni-report#readme",
36
+ "devDependencies": {
37
+ "@playwright/test": "^1.49.0",
38
+ "@types/express": "^5.0.0",
39
+ "@types/node": "^22.0.2",
40
+ "@types/sqlite3": "^3.1.11",
41
+ "ansi-to-html": "^0.7.2",
42
+ "commander": "^12.1.0",
43
+ "express": "^4.21.1",
44
+ "handlebars": "^4.7.8",
45
+ "tsup": "^8.4.0",
46
+ "typescript": "^4.9.4"
47
+ },
48
+ "peerDependencies": {
49
+ "sqlite": "^5.1.1",
50
+ "sqlite3": "^5.1.7"
51
+ },
52
+ "main": "dist/ortoni-report.js",
53
+ "module": "dist/ortoni-report.mjs",
54
+ "types": "dist/ortoni-report.d.ts"
57
55
  }