@zohodesk/testinglibrary 4.1.1 → 4.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/testinglibrary",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "main": "./build/index.js",
5
5
  "scripts": {
6
6
  "postinstall": "node bin/postinstall.js",
@@ -23,37 +23,46 @@
23
23
  "dependencies": {
24
24
  "@babel/code-frame": "7.27.1",
25
25
  "@babel/preset-react": "7.28.5",
26
+ "@babel/runtime": "7.28.6",
26
27
  "@playwright/test": "1.56.1",
27
28
  "@reportportal/agent-js-playwright": "5.2.2",
28
29
  "@testing-library/jest-dom": "6.9.1",
29
- "babel-jest": "30.2.0",
30
+ "@testing-library/react": "12.1.5",
31
+ "@types/react": "16.14.70",
32
+ "@types/react-dom": "16.9.25",
33
+ "@types/jest": "29.5.12",
34
+ "@zohodesk/unit-testing-framework": "0.0.35-experimental",
35
+ "babel-jest": "29.7.0",
30
36
  "babel-plugin-transform-dynamic-import": "2.1.0",
37
+ "commander": "13.1.0",
31
38
  "fast-glob": "3.3.3",
32
- "jest": "30.2.0",
33
- "jest-environment-jsdom": "30.2.0",
39
+ "identity-obj-proxy": "3.0.0",
40
+ "jest": "29.7.0",
41
+ "jest-environment-jsdom": "29.7.0",
42
+ "jest-transform-stub": "2.0.0",
34
43
  "jsonpath": "1.1.1",
35
44
  "msw": "2.11.6",
36
45
  "playwright": "1.56.1",
37
46
  "playwright-bdd": "8.4.2",
38
47
  "properties-reader": "2.3.0",
48
+ "react": "16.14.0",
49
+ "react-dom": "16.14.0",
39
50
  "supports-color": "10.2.2"
40
51
  },
41
52
  "bin": {
42
53
  "ZDTestingFramework": "./bin/cli.js"
43
54
  },
44
55
  "peerDependencies": {
45
- "eslint": "*",
46
- "react": "*",
47
- "react-dom": "*"
56
+ "eslint": "*"
48
57
  },
49
58
  "devDependencies": {
50
- "@babel/cli": "7.28.3",
51
- "@babel/core": "7.28.4",
52
- "@babel/node": "7.28.0",
59
+ "@babel/cli": "7.28.6",
60
+ "@babel/core": "7.29.0",
61
+ "@babel/node": "7.29.0",
53
62
  "@babel/plugin-transform-runtime": "7.28.3",
54
- "@babel/preset-env": "7.28.3",
55
- "@babel/runtime": "7.28.4",
56
- "commander": "14.0.2",
57
- "jest-html-reporter": "4.3.0"
63
+ "@babel/preset-env": "7.29.0",
64
+ "@babel/preset-typescript": "7.26.0",
65
+ "jest-html-reporter": "4.3.0",
66
+ "ts-jest": "29.3.2"
58
67
  }
59
68
  }
@@ -0,0 +1,277 @@
1
+ <html><head><meta charset="utf-8"/><title>Unit Report</title><style type="text/css">:root {
2
+ --text-primary: #111;
3
+ --text-secondary: #4f4f4f;
4
+ --success: #006633;
5
+ --success-bright: #80ffbf;
6
+ --danger: #cc071e;
7
+ --danger-bright: #fbdfe0;
8
+ --warning: #995c00;
9
+ --warning-bright: #ffeea8;
10
+ --panel: #eee;
11
+ --border: #949494;
12
+ --disabled: #6b6b6b;
13
+ }
14
+
15
+ html,
16
+ body {
17
+ font-family: Arial, Helvetica, sans-serif;
18
+ font-size: 16px;
19
+ margin: 0;
20
+ padding: 0;
21
+ color: var(--text-primary);
22
+ }
23
+ body {
24
+ padding: 2rem 1rem;
25
+ }
26
+ .jesthtml-content {
27
+ margin: 0 auto;
28
+ max-width: 70rem;
29
+ }
30
+ header {
31
+ display: flex;
32
+ align-items: center;
33
+ }
34
+ #title {
35
+ margin: 0;
36
+ flex-grow: 1;
37
+ }
38
+ #logo {
39
+ height: 4rem;
40
+ }
41
+ #timestamp {
42
+ color: var(--text-secondary);
43
+ margin-top: 0.5rem;
44
+ }
45
+
46
+ #metadata-container {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: 2rem;
50
+ margin-bottom: 2rem;
51
+ }
52
+
53
+ .additional-information-container {
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: 0.5rem;
57
+ color: var(--text-secondary);
58
+ }
59
+
60
+ /** SUMMARY */
61
+ #summary {
62
+ color: var(--text-primary);
63
+ display: flex;
64
+ font-family: monospace;
65
+ font-size: 1rem;
66
+ }
67
+ #summary > div {
68
+ margin-right: 0.5rem;
69
+ background: var(--panel);
70
+ padding: 1rem;
71
+ min-width: 15rem;
72
+ }
73
+ #summary > div:last-child {
74
+ margin-right: 0;
75
+ }
76
+ @media only screen and (max-width: 720px) {
77
+ #summary {
78
+ flex-direction: column;
79
+ }
80
+ #summary > div {
81
+ margin-right: 0;
82
+ margin-top: 1rem;
83
+ }
84
+ #summary > div:first-child {
85
+ margin-top: 0;
86
+ }
87
+ }
88
+
89
+ .summary-total {
90
+ font-weight: bold;
91
+ margin-bottom: 0.5rem;
92
+ }
93
+ .summary-passed {
94
+ color: var(--success);
95
+ border-left: 0.4rem solid var(--success);
96
+ padding-left: 0.5rem;
97
+ margin-bottom: 0.15rem;
98
+ }
99
+ .summary-failed,
100
+ .summary-obsolete-snapshots {
101
+ color: var(--danger);
102
+ border-left: 0.4rem solid var(--danger);
103
+ padding-left: 0.5rem;
104
+ margin-bottom: 0.15rem;
105
+ }
106
+ .summary-pending {
107
+ color: var(--warning);
108
+ border-left: 0.4rem solid var(--warning);
109
+ padding-left: 0.5rem;
110
+ margin-bottom: 0.15rem;
111
+ }
112
+ .summary-empty {
113
+ color: var(--disabled);
114
+ border-left: 0.4rem solid var(--disabled);
115
+ margin-bottom: 0.15rem;
116
+ }
117
+
118
+ .test-result {
119
+ padding: 1rem;
120
+ margin-bottom: 0.25rem;
121
+ }
122
+ .test-result:last-child {
123
+ border: 0;
124
+ }
125
+ .test-result.passed {
126
+ background-color: var(--success-bright);
127
+ color: var(--success);
128
+ }
129
+ .test-result.failed {
130
+ background-color: var(--danger-bright);
131
+ color: var(--danger);
132
+ }
133
+ .test-result.pending {
134
+ background-color: var(--warning-bright);
135
+ color: var(--warning);
136
+ }
137
+
138
+ .test-info {
139
+ display: flex;
140
+ justify-content: space-between;
141
+ }
142
+ .test-suitename {
143
+ width: 20%;
144
+ text-align: left;
145
+ font-weight: bold;
146
+ word-break: break-word;
147
+ }
148
+ .test-title {
149
+ width: 40%;
150
+ text-align: left;
151
+ font-style: italic;
152
+ }
153
+ .test-status {
154
+ width: 20%;
155
+ text-align: right;
156
+ }
157
+ .test-duration {
158
+ width: 10%;
159
+ text-align: right;
160
+ font-size: 0.85rem;
161
+ }
162
+
163
+ .failureMessages {
164
+ padding: 0 1rem;
165
+ margin-top: 1rem;
166
+ border-top: 1px dashed var(--danger);
167
+ }
168
+ .failureMessages.suiteFailure {
169
+ border-top: none;
170
+ }
171
+ .failureMsg {
172
+ white-space: pre-wrap;
173
+ white-space: -moz-pre-wrap;
174
+ white-space: -pre-wrap;
175
+ white-space: -o-pre-wrap;
176
+ word-wrap: break-word;
177
+ }
178
+
179
+ .suite-container {
180
+ margin-bottom: 1rem;
181
+ }
182
+ .suite-info {
183
+ padding: 1rem;
184
+ background-color: var(--panel);
185
+ color: var(--text-secondary);
186
+ border: 0.15rem solid;
187
+ border-color: var(--panel);
188
+ display: flex;
189
+ align-items: center;
190
+ margin-bottom: 0.25rem;
191
+ }
192
+ .suite-info:hover {
193
+ border-color: var(--border);
194
+ cursor: pointer;
195
+ }
196
+ .suite-info .suite-path {
197
+ word-break: break-all;
198
+ flex-grow: 1;
199
+ font-family: monospace;
200
+ font-size: 1rem;
201
+ }
202
+ .suite-info .suite-time {
203
+ margin-left: 1rem;
204
+ padding: 0.2rem 0.3rem;
205
+ font-size: 0.85rem;
206
+ }
207
+ .suite-info .suite-time.warn {
208
+ background-color: var(--danger);
209
+ color: #fff;
210
+ }
211
+ .suite-info:before {
212
+ content: "\2303";
213
+ display: inline-block;
214
+ margin-right: 1rem;
215
+ transform: rotate(180deg) translateY(0.15rem);
216
+ }
217
+ .suite-container[open] .suite-info:before {
218
+ transform: rotate(0deg) translateY(0.15rem);
219
+ }
220
+
221
+ /* CONSOLE LOGS */
222
+ .suite-consolelog {
223
+ margin-bottom: 0.25rem;
224
+ padding: 1rem;
225
+ background-color: var(--panel);
226
+ }
227
+ .suite-consolelog-header {
228
+ font-weight: bold;
229
+ }
230
+ .suite-consolelog-item {
231
+ padding: 0.5rem;
232
+ }
233
+ .suite-consolelog-item pre {
234
+ margin: 0.5rem 0;
235
+ white-space: pre-wrap;
236
+ white-space: -moz-pre-wrap;
237
+ white-space: -pre-wrap;
238
+ white-space: -o-pre-wrap;
239
+ word-wrap: break-word;
240
+ }
241
+ .suite-consolelog-item-origin {
242
+ color: var(--text-secondary);
243
+ font-weight: bold;
244
+ }
245
+ .suite-consolelog-item-message {
246
+ color: var(--text-primary);
247
+ font-size: 1rem;
248
+ padding: 0 0.5rem;
249
+ }
250
+
251
+ /* OBSOLETE SNAPSHOTS */
252
+ .suite-obsolete-snapshots {
253
+ margin-bottom: 0.25rem;
254
+ padding: 1rem;
255
+ background-color: var(--danger-bright);
256
+ color: var(--danger);
257
+ }
258
+ .suite-obsolete-snapshots-header {
259
+ font-weight: bold;
260
+ }
261
+ .suite-obsolete-snapshots-item {
262
+ padding: 0.5rem;
263
+ }
264
+ .suite-obsolete-snapshots-item pre {
265
+ margin: 0.5rem 0;
266
+ white-space: pre-wrap;
267
+ white-space: -moz-pre-wrap;
268
+ white-space: -pre-wrap;
269
+ white-space: -o-pre-wrap;
270
+ word-wrap: break-word;
271
+ }
272
+ .suite-obsolete-snapshots-item-message {
273
+ color: var(--text-primary);
274
+ font-size: 1rem;
275
+ padding: 0 0.5rem;
276
+ }
277
+ </style></head><body><main class="jesthtml-content"><header><h1 id="title">Unit Report</h1></header><section id="metadata-container"><div id="timestamp">Started: 2026-06-03 18:32:48</div><div id="summary"><div id="suite-summary"><div class="summary-total">Suites (1)</div><div class="summary-passed ">1 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div><div id="test-summary"><div class="summary-total">Tests (12)</div><div class="summary-passed ">12 passed</div><div class="summary-failed summary-empty">0 failed</div><div class="summary-pending summary-empty">0 pending</div></div></div></section><details id="suite-1" class="suite-container" open=""><summary class="suite-info"><div class="suite-path">/Users/muthu-19817/git/testing-framework/src/test/core/playwright/buildInFixtures/__tests__/caseTimeout.test.js</div><div class="suite-time">0.367s</div></summary><div class="suite-tests"><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">returns null when no timeout tag is present</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">returns null when tags is not an array</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">parses @timeout_&lt;n&gt; as seconds for Chrome (factor 1)</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">applies Firefox 2x multiplier</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">returns 0 (no timeout) when tag is @timeout_0, regardless of browser</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">uses the first matching tag and logs a warning when multiple are present</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">ignores malformed timeout-like tags</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">resolveCaseTimeoutMs</div><div class="test-title">ignores non-string entries in tags</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">caseTimeout fixture</div><div class="test-title">is registered as an auto fixture</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">caseTimeout fixture</div><div class="test-title">calls testInfo.setTimeout with scaled value when tag matches</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">caseTimeout fixture</div><div class="test-title">does not call testInfo.setTimeout when no tag is present</div><div class="test-status">passed</div><div class="test-duration"> </div></div></div><div class="test-result passed"><div class="test-info"><div class="test-suitename">caseTimeout fixture</div><div class="test-title">passes 0 through to testInfo.setTimeout for @timeout_0</div><div class="test-status">passed</div><div class="test-duration">0.001s</div></div></div></div></details></main></body></html>
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = generateReport;
8
- var _child_process = require("child_process");
9
- var _path = _interopRequireDefault(require("path"));
10
- var _logger = require("../../utils/logger");
11
- var _rootPath = require("../../utils/rootPath");
12
- var _readConfigFile = require("./readConfigFile");
13
- async function generateReport() {
14
- // await preProcessReport()
15
- const userArgs = process.argv.slice(3);
16
- const playwrightPath = _path.default.resolve((0, _rootPath.getExecutableBinaryPath)('playwright'));
17
- const command = playwrightPath;
18
- const {
19
- reportPath: htmlPath
20
- } = (0, _readConfigFile.generateConfigFromFile)();
21
- const args = ['show-report', htmlPath].concat(userArgs);
22
- const childProcess = (0, _child_process.spawn)(command, args, {
23
- stdio: 'inherit'
24
- });
25
- childProcess.on('error', error => {
26
- _logger.Logger.log(_logger.Logger.FAILURE_TYPE, error);
27
- });
28
- childProcess.on('exit', (code, signal) => {
29
- _logger.Logger.log(_logger.Logger.FAILURE_TYPE, `Child Process Exited with Code ${code} and Signal ${signal}`);
30
- process.exit();
31
- });
32
- process.on('exit', () => {
33
- _logger.Logger.log(_logger.Logger.INFO_TYPE, 'Terminating Playwright Process...');
34
- childProcess.kill();
35
- return;
36
- });
37
- process.on('SIGINT', () => {
38
- _logger.Logger.log(_logger.Logger.INFO_TYPE, 'Cleaning up...');
39
- childProcess.kill();
40
- process.exit();
41
- });
42
- }