@testchimp/playwright 0.1.7 → 0.1.9
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/dist/explorechimp/axe-compact.d.ts +7 -0
- package/dist/explorechimp/axe-compact.d.ts.map +1 -0
- package/dist/explorechimp/axe-compact.js +56 -0
- package/dist/explorechimp/axe-compact.js.map +1 -0
- package/dist/explorechimp/clean-html.d.ts +6 -0
- package/dist/explorechimp/clean-html.d.ts.map +1 -0
- package/dist/explorechimp/clean-html.js +117 -0
- package/dist/explorechimp/clean-html.js.map +1 -0
- package/dist/explorechimp/index.d.ts +44 -0
- package/dist/explorechimp/index.d.ts.map +1 -0
- package/dist/explorechimp/index.js +495 -0
- package/dist/explorechimp/index.js.map +1 -0
- package/dist/explorechimp/perf-metrics.d.ts +15 -0
- package/dist/explorechimp/perf-metrics.d.ts.map +1 -0
- package/dist/explorechimp/perf-metrics.js +485 -0
- package/dist/explorechimp/perf-metrics.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts +13 -15
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +38 -41
- package/dist/runtime.js.map +1 -1
- package/dist/runtime.mjs +2 -1
- package/dist/testchimp-reporter.d.ts +2 -0
- package/dist/testchimp-reporter.d.ts.map +1 -1
- package/dist/testchimp-reporter.js +14 -2
- package/dist/testchimp-reporter.js.map +1 -1
- package/dist/utils.d.ts +14 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +50 -0
- package/dist/utils.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Browser performance metrics for ExploreChimp local runs — mirrors scriptservice
|
|
4
|
+
* `helpers/watcher.ts` (PerformanceObserver pipeline + getMetricsSince / resetMetrics).
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.parseExploreChimpLongTaskThresholdMs = parseExploreChimpLongTaskThresholdMs;
|
|
8
|
+
exports.installExploreChimpPerfMetricsObservers = installExploreChimpPerfMetricsObservers;
|
|
9
|
+
exports.collectMetricsSince = collectMetricsSince;
|
|
10
|
+
exports.resetExploreChimpPerfMetricsBuffers = resetExploreChimpPerfMetricsBuffers;
|
|
11
|
+
function parseExploreChimpLongTaskThresholdMs() {
|
|
12
|
+
const raw = process.env.EXPLORECHIMP_LONG_TASK_THRESHOLD_MS?.trim();
|
|
13
|
+
if (!raw)
|
|
14
|
+
return 50;
|
|
15
|
+
const n = Number(raw);
|
|
16
|
+
return Number.isFinite(n) && n > 0 ? n : 50;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Injects observers on every new document (Playwright init script). Idempotent per document.
|
|
20
|
+
*/
|
|
21
|
+
async function installExploreChimpPerfMetricsObservers(page, longTaskThresholdMs) {
|
|
22
|
+
await page.addInitScript(({ longTaskThresholdMs: threshold }) => {
|
|
23
|
+
const g = globalThis;
|
|
24
|
+
g.__longTaskThreshold = threshold;
|
|
25
|
+
if (g.__exploreChimpPerfInstalled)
|
|
26
|
+
return;
|
|
27
|
+
g.__exploreChimpPerfInstalled = true;
|
|
28
|
+
g.__perfMetrics = g.__perfMetrics || { entries: [], cls: 0, startTime: Date.now() };
|
|
29
|
+
g.__layoutShiftEntries = g.__layoutShiftEntries || [];
|
|
30
|
+
function observeLcp() {
|
|
31
|
+
try {
|
|
32
|
+
const lcpObserver = new PerformanceObserver((list) => {
|
|
33
|
+
for (const entry of list.getEntries()) {
|
|
34
|
+
const e = entry;
|
|
35
|
+
g.__perfMetrics.entries.push({
|
|
36
|
+
type: 'lcp',
|
|
37
|
+
value: e.renderTime || e.loadTime || 0,
|
|
38
|
+
timestamp: Date.now(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
lcpObserver.observe({ type: 'largest-contentful-paint', buffered: true });
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
/* LCP not supported */
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function observeFcp() {
|
|
49
|
+
try {
|
|
50
|
+
const paintObserver = new PerformanceObserver((list) => {
|
|
51
|
+
for (const entry of list.getEntries()) {
|
|
52
|
+
const pe = entry;
|
|
53
|
+
if (pe.name === 'first-contentful-paint') {
|
|
54
|
+
g.__perfMetrics.entries.push({
|
|
55
|
+
type: 'fcp',
|
|
56
|
+
value: pe.startTime || 0,
|
|
57
|
+
timestamp: Date.now(),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
paintObserver.observe({ type: 'paint', buffered: true });
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
/* paint not supported */
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function observeCls() {
|
|
69
|
+
try {
|
|
70
|
+
const clsObserver = new PerformanceObserver((list) => {
|
|
71
|
+
for (const entry of list.getEntries()) {
|
|
72
|
+
const le = entry;
|
|
73
|
+
if (!le.hadRecentInput) {
|
|
74
|
+
g.__perfMetrics.cls += le.value || 0;
|
|
75
|
+
g.__perfMetrics.entries.push({
|
|
76
|
+
type: 'cls',
|
|
77
|
+
value: le.value || 0,
|
|
78
|
+
cumulative: g.__perfMetrics.cls,
|
|
79
|
+
timestamp: Date.now(),
|
|
80
|
+
});
|
|
81
|
+
const sources = (le.sources || []).map((source) => {
|
|
82
|
+
const s = source;
|
|
83
|
+
const node = s.node;
|
|
84
|
+
const currentRect = s.currentRect;
|
|
85
|
+
let element;
|
|
86
|
+
if (node && currentRect) {
|
|
87
|
+
const tag = node.tagName?.toLowerCase();
|
|
88
|
+
const role = node.getAttribute?.('role') || undefined;
|
|
89
|
+
const id = node.id || undefined;
|
|
90
|
+
const syntheticId = node.getAttribute?.('data-synthetic-id') || undefined;
|
|
91
|
+
const ariaLabel = node.getAttribute?.('aria-label') || undefined;
|
|
92
|
+
let text;
|
|
93
|
+
try {
|
|
94
|
+
const tc = node.textContent || '';
|
|
95
|
+
if (tc.trim())
|
|
96
|
+
text = tc.trim().substring(0, 100);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
/* ignore */
|
|
100
|
+
}
|
|
101
|
+
let className;
|
|
102
|
+
try {
|
|
103
|
+
const ca = node.getAttribute?.('class') || String(node.className || '');
|
|
104
|
+
if (ca)
|
|
105
|
+
className = ca.substring(0, 100);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
/* ignore */
|
|
109
|
+
}
|
|
110
|
+
element = { tag, role, text, id, className, syntheticId, ariaLabel };
|
|
111
|
+
}
|
|
112
|
+
const viewportWidth = window.innerWidth || 1;
|
|
113
|
+
const viewportHeight = window.innerHeight || 1;
|
|
114
|
+
const cr = currentRect || { left: 0, top: 0, width: 0, height: 0 };
|
|
115
|
+
const boundingBox = {
|
|
116
|
+
xPct: (cr.left / viewportWidth) * 100,
|
|
117
|
+
yPct: (cr.top / viewportHeight) * 100,
|
|
118
|
+
widthPct: (cr.width / viewportWidth) * 100,
|
|
119
|
+
heightPct: (cr.height / viewportHeight) * 100,
|
|
120
|
+
};
|
|
121
|
+
return { element, boundingBox };
|
|
122
|
+
});
|
|
123
|
+
g.__layoutShiftEntries.push({
|
|
124
|
+
value: le.value || 0,
|
|
125
|
+
cumulative: g.__perfMetrics.cls,
|
|
126
|
+
timestamp: Date.now(),
|
|
127
|
+
sources,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
clsObserver.observe({ type: 'layout-shift', buffered: true });
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
/* CLS not supported */
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function observeLongTasks() {
|
|
139
|
+
try {
|
|
140
|
+
const longTaskObserver = new PerformanceObserver((list) => {
|
|
141
|
+
for (const entry of list.getEntries()) {
|
|
142
|
+
const lt = entry;
|
|
143
|
+
const duration = lt.duration;
|
|
144
|
+
const th = g.__longTaskThreshold || 50;
|
|
145
|
+
if (duration <= th)
|
|
146
|
+
continue;
|
|
147
|
+
let bestAttribution = lt.attribution?.[0];
|
|
148
|
+
let scriptUrl = '';
|
|
149
|
+
if (lt.attribution && lt.attribution.length > 0) {
|
|
150
|
+
for (const attr of lt.attribution) {
|
|
151
|
+
if (attr.containerSrc && attr.containerSrc.trim() !== '') {
|
|
152
|
+
bestAttribution = attr;
|
|
153
|
+
scriptUrl = attr.containerSrc;
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (!scriptUrl) {
|
|
158
|
+
for (const attr of lt.attribution) {
|
|
159
|
+
if (attr.containerType && attr.containerType !== 'unknown') {
|
|
160
|
+
bestAttribution = attr;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const attributionName = bestAttribution?.name || lt.name || 'unknown';
|
|
167
|
+
const attributionType = bestAttribution?.entryType || (lt.name ? 'longtask' : 'unknown');
|
|
168
|
+
g.__perfMetrics.entries.push({
|
|
169
|
+
type: 'longtask',
|
|
170
|
+
value: duration,
|
|
171
|
+
timestamp: Date.now(),
|
|
172
|
+
name: lt.name || 'unknown',
|
|
173
|
+
startTime: lt.startTime || 0,
|
|
174
|
+
attributionName,
|
|
175
|
+
attributionType,
|
|
176
|
+
containerType: bestAttribution?.containerType || (lt.name === 'self' ? 'window' : 'unknown'),
|
|
177
|
+
containerSrc: scriptUrl || bestAttribution?.containerSrc || '',
|
|
178
|
+
containerId: bestAttribution?.containerId || '',
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
longTaskObserver.observe({ type: 'longtask', buffered: true });
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
/* longtask not supported */
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
function determineResourceType(initiatorType, url) {
|
|
189
|
+
if (initiatorType === 'script' || url.endsWith('.js'))
|
|
190
|
+
return 'script';
|
|
191
|
+
if (initiatorType === 'link' || url.endsWith('.css'))
|
|
192
|
+
return 'stylesheet';
|
|
193
|
+
if (initiatorType === 'img' || /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(url))
|
|
194
|
+
return 'image';
|
|
195
|
+
if (/\.(woff|woff2|ttf|otf|eot)$/i.test(url))
|
|
196
|
+
return 'font';
|
|
197
|
+
if (initiatorType === 'xmlhttprequest' || initiatorType === 'fetch')
|
|
198
|
+
return 'fetch';
|
|
199
|
+
return 'other';
|
|
200
|
+
}
|
|
201
|
+
function buildLocatorFromElement(element) {
|
|
202
|
+
const testId = element.getAttribute('data-testid');
|
|
203
|
+
if (testId)
|
|
204
|
+
return `getByTestId('${testId}')`;
|
|
205
|
+
const id = element.id;
|
|
206
|
+
if (id)
|
|
207
|
+
return `#${id}`;
|
|
208
|
+
const ariaLabel = element.getAttribute('aria-label');
|
|
209
|
+
if (ariaLabel)
|
|
210
|
+
return `getByLabel('${ariaLabel}')`;
|
|
211
|
+
const role = element.getAttribute('role') || element.tagName.toLowerCase();
|
|
212
|
+
const name = ariaLabel || element.textContent?.trim() || '';
|
|
213
|
+
if (name)
|
|
214
|
+
return `getByRole('${role}', { name: '${name.substring(0, 50)}' })`;
|
|
215
|
+
const tag = element.tagName.toLowerCase();
|
|
216
|
+
const text = element.textContent?.trim();
|
|
217
|
+
if (text)
|
|
218
|
+
return `getByText('${text.substring(0, 50)}')`;
|
|
219
|
+
return element.tagName.toLowerCase() + (element.className ? `.${String(element.className).split(' ')[0]}` : '');
|
|
220
|
+
}
|
|
221
|
+
function observeEventTiming() {
|
|
222
|
+
try {
|
|
223
|
+
g.__interactionMetrics = g.__interactionMetrics || [];
|
|
224
|
+
const PerfEvtCtor = typeof PerformanceEventTiming !== 'undefined' ? PerformanceEventTiming : undefined;
|
|
225
|
+
const eventTimingObserver = new PerformanceObserver((list) => {
|
|
226
|
+
for (const entry of list.getEntries()) {
|
|
227
|
+
if (entry.entryType !== 'event')
|
|
228
|
+
continue;
|
|
229
|
+
if (PerfEvtCtor && !(entry instanceof PerfEvtCtor))
|
|
230
|
+
continue;
|
|
231
|
+
const eventEntry = entry;
|
|
232
|
+
const eventName = eventEntry.name;
|
|
233
|
+
if (eventName !== 'click' && eventName !== 'dblclick' && eventName !== 'change')
|
|
234
|
+
continue;
|
|
235
|
+
const target = eventEntry.target;
|
|
236
|
+
if (!target)
|
|
237
|
+
continue;
|
|
238
|
+
if (eventName === 'change') {
|
|
239
|
+
const tagName = target.tagName;
|
|
240
|
+
const inputType = target.type;
|
|
241
|
+
const isSelect = tagName === 'SELECT';
|
|
242
|
+
const isCheckbox = tagName === 'INPUT' && inputType === 'checkbox';
|
|
243
|
+
const isRadio = tagName === 'INPUT' && inputType === 'radio';
|
|
244
|
+
if (!isSelect && !isCheckbox && !isRadio)
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const somId = target.getAttribute('tc-som-id');
|
|
248
|
+
const syntheticId = target.getAttribute('data-synthetic-id');
|
|
249
|
+
const elementId = somId ?? syntheticId ?? undefined;
|
|
250
|
+
const rect = target.getBoundingClientRect();
|
|
251
|
+
const viewportWidth = window.innerWidth;
|
|
252
|
+
const viewportHeight = window.innerHeight;
|
|
253
|
+
const boundingBox = {
|
|
254
|
+
xPct: (rect.left / viewportWidth) * 100,
|
|
255
|
+
yPct: (rect.top / viewportHeight) * 100,
|
|
256
|
+
widthPct: (rect.width / viewportWidth) * 100,
|
|
257
|
+
heightPct: (rect.height / viewportHeight) * 100,
|
|
258
|
+
};
|
|
259
|
+
const locator = buildLocatorFromElement(target);
|
|
260
|
+
const inputDelay = eventEntry.processingStart - eventEntry.startTime;
|
|
261
|
+
const processingDuration = eventEntry.processingEnd - eventEntry.processingStart;
|
|
262
|
+
const presentationDelay = eventEntry.duration - (eventEntry.processingEnd - eventEntry.startTime);
|
|
263
|
+
if (!g.__interactionMetrics)
|
|
264
|
+
g.__interactionMetrics = [];
|
|
265
|
+
const MAX_INTERACTION_METRICS = 200;
|
|
266
|
+
if (g.__interactionMetrics.length >= MAX_INTERACTION_METRICS)
|
|
267
|
+
g.__interactionMetrics.shift();
|
|
268
|
+
g.__interactionMetrics.push({
|
|
269
|
+
duration: eventEntry.duration,
|
|
270
|
+
inputDelay,
|
|
271
|
+
processingDuration,
|
|
272
|
+
presentationDelay,
|
|
273
|
+
eventType: eventEntry.name,
|
|
274
|
+
timestamp: Date.now(),
|
|
275
|
+
targetElementId: elementId,
|
|
276
|
+
targetLocator: locator,
|
|
277
|
+
boundingBox,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
const eventObserverOptions = { type: 'event', buffered: true };
|
|
282
|
+
eventObserverOptions.durationThreshold = 80;
|
|
283
|
+
eventTimingObserver.observe(eventObserverOptions);
|
|
284
|
+
}
|
|
285
|
+
catch {
|
|
286
|
+
/* Event Timing not supported */
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function observeResourceTiming() {
|
|
290
|
+
try {
|
|
291
|
+
if (g.performance.setResourceTimingBufferSize) {
|
|
292
|
+
g.performance.setResourceTimingBufferSize(500);
|
|
293
|
+
}
|
|
294
|
+
g.__resourceTimings = g.__resourceTimings || [];
|
|
295
|
+
const resourceTimingObserver = new PerformanceObserver((list) => {
|
|
296
|
+
for (const entry of list.getEntries()) {
|
|
297
|
+
if (entry.entryType !== 'resource')
|
|
298
|
+
continue;
|
|
299
|
+
const resourceEntry = entry;
|
|
300
|
+
const dnsLookup = Math.max(0, resourceEntry.domainLookupEnd - resourceEntry.domainLookupStart);
|
|
301
|
+
const tcpConnection = Math.max(0, resourceEntry.connectEnd - resourceEntry.connectStart);
|
|
302
|
+
const tlsNegotiation = resourceEntry.secureConnectionStart > 0
|
|
303
|
+
? Math.max(0, resourceEntry.connectEnd - resourceEntry.secureConnectionStart)
|
|
304
|
+
: 0;
|
|
305
|
+
const requestTime = Math.max(0, resourceEntry.responseStart - resourceEntry.requestStart);
|
|
306
|
+
const responseTime = Math.max(0, resourceEntry.responseEnd - resourceEntry.responseStart);
|
|
307
|
+
const duration = Math.max(0, resourceEntry.responseEnd - resourceEntry.fetchStart);
|
|
308
|
+
const initiatorType = resourceEntry.initiatorType || 'other';
|
|
309
|
+
const resourceType = determineResourceType(initiatorType, resourceEntry.name);
|
|
310
|
+
if (!g.__resourceTimings)
|
|
311
|
+
g.__resourceTimings = [];
|
|
312
|
+
const MAX_RESOURCE_TIMINGS = 200;
|
|
313
|
+
if (g.__resourceTimings.length >= MAX_RESOURCE_TIMINGS)
|
|
314
|
+
g.__resourceTimings.shift();
|
|
315
|
+
g.__resourceTimings.push({
|
|
316
|
+
url: resourceEntry.name,
|
|
317
|
+
initiatorType,
|
|
318
|
+
duration,
|
|
319
|
+
dnsLookupMs: dnsLookup > 0 ? dnsLookup : undefined,
|
|
320
|
+
tcpConnectionMs: tcpConnection > 0 ? tcpConnection : undefined,
|
|
321
|
+
tlsNegotiationMs: tlsNegotiation > 0 ? tlsNegotiation : undefined,
|
|
322
|
+
requestTimeMs: requestTime > 0 ? requestTime : undefined,
|
|
323
|
+
responseTimeMs: responseTime > 0 ? responseTime : undefined,
|
|
324
|
+
transferSizeBytes: resourceEntry.transferSize > 0 ? resourceEntry.transferSize : undefined,
|
|
325
|
+
encodedSizeBytes: resourceEntry.encodedBodySize > 0 ? resourceEntry.encodedBodySize : undefined,
|
|
326
|
+
decodedSizeBytes: resourceEntry.decodedBodySize > 0 ? resourceEntry.decodedBodySize : undefined,
|
|
327
|
+
fromCache: resourceEntry.transferSize === 0 && resourceEntry.decodedBodySize > 0,
|
|
328
|
+
timestamp: Date.now(),
|
|
329
|
+
resourceType,
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
resourceTimingObserver.observe({ type: 'resource', buffered: true });
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
/* resource timing not supported */
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
observeLcp();
|
|
340
|
+
observeFcp();
|
|
341
|
+
observeCls();
|
|
342
|
+
observeLongTasks();
|
|
343
|
+
observeEventTiming();
|
|
344
|
+
observeResourceTiming();
|
|
345
|
+
}, { longTaskThresholdMs });
|
|
346
|
+
}
|
|
347
|
+
/** Same semantics as watcher.getMetricsSince — filters perf entries by wall-clock `since`. */
|
|
348
|
+
async function collectMetricsSince(page, sinceTimestamp) {
|
|
349
|
+
return page.evaluate((since) => {
|
|
350
|
+
const w = globalThis;
|
|
351
|
+
function fallbackFromPerformanceTimeline() {
|
|
352
|
+
const nav = performance.getEntriesByType('navigation')[0];
|
|
353
|
+
const paint = performance.getEntriesByType('paint');
|
|
354
|
+
const fcp = paint.find((p) => p.name === 'first-contentful-paint')?.startTime ?? 0;
|
|
355
|
+
const lcpEntries = performance.getEntriesByType('largest-contentful-paint');
|
|
356
|
+
const lastLcp = lcpEntries.length > 0 ? lcpEntries[lcpEntries.length - 1] : null;
|
|
357
|
+
const lcpMs = lastLcp
|
|
358
|
+
? (lastLcp.renderTime ??
|
|
359
|
+
lastLcp.loadTime ??
|
|
360
|
+
0)
|
|
361
|
+
: 0;
|
|
362
|
+
let cls = 0;
|
|
363
|
+
try {
|
|
364
|
+
const shifts = performance.getEntriesByType('layout-shift');
|
|
365
|
+
for (const s of shifts) {
|
|
366
|
+
if (!s.hadRecentInput)
|
|
367
|
+
cls += s.value ?? 0;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
catch {
|
|
371
|
+
/* ignore */
|
|
372
|
+
}
|
|
373
|
+
const mem = performance.memory;
|
|
374
|
+
return {
|
|
375
|
+
lcp: lcpMs,
|
|
376
|
+
fcp,
|
|
377
|
+
cls,
|
|
378
|
+
collectedAt: String(Date.now()),
|
|
379
|
+
longTasksCount: 0,
|
|
380
|
+
longTasksTotalMs: 0,
|
|
381
|
+
memoryHeapUsedMb: mem?.usedJSHeapSize ? mem.usedJSHeapSize / (1024 * 1024) : undefined,
|
|
382
|
+
memoryHeapTotalMb: mem?.totalJSHeapSize ? mem.totalJSHeapSize / (1024 * 1024) : undefined,
|
|
383
|
+
tbt: nav ? Math.max(0, (nav.loadEventEnd - nav.fetchStart) * 0.01) : 0,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
if (!w.__perfMetrics) {
|
|
387
|
+
return fallbackFromPerformanceTimeline();
|
|
388
|
+
}
|
|
389
|
+
const allEntries = w.__perfMetrics.entries || [];
|
|
390
|
+
const entries = allEntries.filter((e) => e.timestamp >= since);
|
|
391
|
+
const lcpEntries = entries.filter((e) => e.type === 'lcp');
|
|
392
|
+
const lcp = lcpEntries.length > 0 ? lcpEntries[lcpEntries.length - 1].value : undefined;
|
|
393
|
+
const fcpEntries = entries.filter((e) => e.type === 'fcp');
|
|
394
|
+
const fcp = fcpEntries.length > 0 ? fcpEntries[0].value : undefined;
|
|
395
|
+
const cls = w.__perfMetrics.cls;
|
|
396
|
+
const longTasks = entries.filter((e) => e.type === 'longtask');
|
|
397
|
+
const longTasksCount = longTasks.length;
|
|
398
|
+
const longTasksTotalMs = longTasks.reduce((sum, task) => sum + task.value, 0);
|
|
399
|
+
const tbt = longTasks.reduce((sum, task) => sum + Math.max(0, task.value - 50), 0);
|
|
400
|
+
const longTaskDetails = longTasks.map((task) => ({
|
|
401
|
+
name: task.name || 'unknown',
|
|
402
|
+
startTime: task.startTime || 0,
|
|
403
|
+
duration: task.value,
|
|
404
|
+
attributionName: task.attributionName || 'unknown',
|
|
405
|
+
attributionType: task.attributionType || 'unknown',
|
|
406
|
+
containerType: task.containerType || 'unknown',
|
|
407
|
+
containerSrc: task.containerSrc || '',
|
|
408
|
+
containerId: task.containerId || '',
|
|
409
|
+
}));
|
|
410
|
+
let memoryHeapUsedMb;
|
|
411
|
+
let memoryHeapTotalMb;
|
|
412
|
+
const perfMem = performance
|
|
413
|
+
.memory;
|
|
414
|
+
if (perfMem) {
|
|
415
|
+
memoryHeapUsedMb = perfMem.usedJSHeapSize / (1024 * 1024);
|
|
416
|
+
memoryHeapTotalMb = perfMem.totalJSHeapSize / (1024 * 1024);
|
|
417
|
+
}
|
|
418
|
+
let interactionLatencies;
|
|
419
|
+
if (w.__interactionMetrics && w.__interactionMetrics.length > 0) {
|
|
420
|
+
const filtered = w.__interactionMetrics.filter((entry) => entry.timestamp >= since);
|
|
421
|
+
if (filtered.length > 0)
|
|
422
|
+
interactionLatencies = filtered;
|
|
423
|
+
}
|
|
424
|
+
let resourceTimings;
|
|
425
|
+
if (w.__resourceTimings && w.__resourceTimings.length > 0) {
|
|
426
|
+
const filtered = w.__resourceTimings.filter((entry) => entry.timestamp >= since);
|
|
427
|
+
if (filtered.length > 0)
|
|
428
|
+
resourceTimings = filtered;
|
|
429
|
+
}
|
|
430
|
+
let layoutShiftEntries;
|
|
431
|
+
if (w.__layoutShiftEntries && w.__layoutShiftEntries.length > 0) {
|
|
432
|
+
const filtered = w.__layoutShiftEntries.filter((entry) => entry.timestamp >= since);
|
|
433
|
+
w.__layoutShiftEntries = w.__layoutShiftEntries.filter((entry) => entry.timestamp < since);
|
|
434
|
+
if (filtered.length > 0)
|
|
435
|
+
layoutShiftEntries = filtered;
|
|
436
|
+
}
|
|
437
|
+
const base = {
|
|
438
|
+
lcp,
|
|
439
|
+
fcp,
|
|
440
|
+
cls,
|
|
441
|
+
tbt,
|
|
442
|
+
longTasksCount,
|
|
443
|
+
longTasksTotalMs,
|
|
444
|
+
longTaskDetails,
|
|
445
|
+
memoryHeapUsedMb,
|
|
446
|
+
memoryHeapTotalMb,
|
|
447
|
+
collectedAt: Date.now(),
|
|
448
|
+
};
|
|
449
|
+
if (interactionLatencies)
|
|
450
|
+
base.interactionLatencies = interactionLatencies;
|
|
451
|
+
if (resourceTimings)
|
|
452
|
+
base.resourceTimings = resourceTimings;
|
|
453
|
+
if (layoutShiftEntries)
|
|
454
|
+
base.layoutShiftEntries = layoutShiftEntries;
|
|
455
|
+
const hasAny = lcp !== undefined ||
|
|
456
|
+
fcp !== undefined ||
|
|
457
|
+
cls !== undefined ||
|
|
458
|
+
tbt > 0 ||
|
|
459
|
+
longTasksCount > 0 ||
|
|
460
|
+
(interactionLatencies && interactionLatencies.length > 0) ||
|
|
461
|
+
(resourceTimings && resourceTimings.length > 0);
|
|
462
|
+
if (!hasAny) {
|
|
463
|
+
return fallbackFromPerformanceTimeline();
|
|
464
|
+
}
|
|
465
|
+
return base;
|
|
466
|
+
}, sinceTimestamp);
|
|
467
|
+
}
|
|
468
|
+
/** Clears in-page metric buffers (watcher.resetMetrics). */
|
|
469
|
+
async function resetExploreChimpPerfMetricsBuffers(page) {
|
|
470
|
+
await page.evaluate(() => {
|
|
471
|
+
const w = globalThis;
|
|
472
|
+
if (w.__perfMetrics) {
|
|
473
|
+
w.__perfMetrics.entries = [];
|
|
474
|
+
w.__perfMetrics.cls = 0;
|
|
475
|
+
w.__perfMetrics.startTime = Date.now();
|
|
476
|
+
}
|
|
477
|
+
if (w.__interactionMetrics)
|
|
478
|
+
w.__interactionMetrics = [];
|
|
479
|
+
if (w.__resourceTimings)
|
|
480
|
+
w.__resourceTimings = [];
|
|
481
|
+
if (w.__layoutShiftEntries)
|
|
482
|
+
w.__layoutShiftEntries = [];
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
//# sourceMappingURL=perf-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perf-metrics.js","sourceRoot":"","sources":["../../src/explorechimp/perf-metrics.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAIH,oFAKC;AAKD,0FAgZC;AAGD,kDA4JC;AAGD,kFAiBC;AA7kBD,SAAgB,oCAAoC;IAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,IAAI,EAAE,CAAC;IACpE,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,MAAM,CAAC,GA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AG,CAAC,CAAC;YACzD,CAAC,eAAe,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,+BAA+B,EAAE,CAAC;QAC3C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,cAAc,CAAC,CAAC;AACrB,CAAC;AAED,4DAA4D;AACrD,KAAK,UAAU,mCAAmC,CAAC,IAAU;IAClE,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;QACvB,MAAM,CAAC,GAAG,UAKT,CAAC;QACF,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC;YACpB,CAAC,CAAC,aAAa,CAAC,OAAO,GAAG,EAAE,CAAC;YAC7B,CAAC,CAAC,aAAa,CAAC,GAAG,GAAG,CAAC,CAAC;YACxB,CAAC,CAAC,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,CAAC,oBAAoB;YAAE,CAAC,CAAC,oBAAoB,GAAG,EAAE,CAAC;QACxD,IAAI,CAAC,CAAC,iBAAiB;YAAE,CAAC,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAClD,IAAI,CAAC,CAAC,oBAAoB;YAAE,CAAC,CAAC,oBAAoB,GAAG,EAAE,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,12 +19,14 @@
|
|
|
19
19
|
* });
|
|
20
20
|
*
|
|
21
21
|
* Environment Variables:
|
|
22
|
-
* - TESTCHIMP_API_KEY (required):
|
|
23
|
-
* - TESTCHIMP_PROJECT_ID (optional):
|
|
24
|
-
* -
|
|
22
|
+
* - TESTCHIMP_API_KEY (required for backend calls): resolves project + organization server-side
|
|
23
|
+
* - TESTCHIMP_PROJECT_ID (optional): only when not inferable from API key (legacy paths)
|
|
24
|
+
* - TESTCHIMP_BACKEND_URL (optional): Featureservice base URL (defaults used by reporter)
|
|
25
25
|
* - TESTCHIMP_TESTS_FOLDER (optional): Base folder for relative path calculation
|
|
26
26
|
* - TESTCHIMP_RELEASE (optional): Release/version identifier
|
|
27
27
|
* - TESTCHIMP_ENV (optional): Environment name (e.g., staging, prod)
|
|
28
|
+
* Runtime (`@testchimp/playwright/runtime`): use `installTrueCoverage` or `installTestChimp` (same behavior).
|
|
29
|
+
* ExploreChimp: set `EXPLORECHIMP_ENABLED=true`, use `test('…', async ({ markScreenState }) => …)`; `TESTCHIMP_BATCH_INVOCATION_ID`, sources/regex envs as documented in the runtime module.
|
|
28
30
|
*/
|
|
29
31
|
export { TestChimpReporter } from './testchimp-reporter';
|
|
30
32
|
export { TestChimpApiClient } from './api-client';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,eAAe,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,12 +20,14 @@
|
|
|
20
20
|
* });
|
|
21
21
|
*
|
|
22
22
|
* Environment Variables:
|
|
23
|
-
* - TESTCHIMP_API_KEY (required):
|
|
24
|
-
* - TESTCHIMP_PROJECT_ID (optional):
|
|
25
|
-
* -
|
|
23
|
+
* - TESTCHIMP_API_KEY (required for backend calls): resolves project + organization server-side
|
|
24
|
+
* - TESTCHIMP_PROJECT_ID (optional): only when not inferable from API key (legacy paths)
|
|
25
|
+
* - TESTCHIMP_BACKEND_URL (optional): Featureservice base URL (defaults used by reporter)
|
|
26
26
|
* - TESTCHIMP_TESTS_FOLDER (optional): Base folder for relative path calculation
|
|
27
27
|
* - TESTCHIMP_RELEASE (optional): Release/version identifier
|
|
28
28
|
* - TESTCHIMP_ENV (optional): Environment name (e.g., staging, prod)
|
|
29
|
+
* Runtime (`@testchimp/playwright/runtime`): use `installTrueCoverage` or `installTestChimp` (same behavior).
|
|
30
|
+
* ExploreChimp: set `EXPLORECHIMP_ENABLED=true`, use `test('…', async ({ markScreenState }) => …)`; `TESTCHIMP_BATCH_INVOCATION_ID`, sources/regex envs as documented in the runtime module.
|
|
29
31
|
*/
|
|
30
32
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
31
33
|
if (k2 === undefined) k2 = k;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;;;;;;;;;;;;;;;;;AAEH,2DAAyD;AAAhD,uHAAA,iBAAiB,OAAA;AAC1B,2CAAkD;AAAzC,gHAAA,kBAAkB,OAAA;AAC3B,0CAAwB;AACxB,0CAAwB;AAExB,uDAAuD;AACvD,6DAAyD;AACzD,kBAAe,sCAAiB,CAAC"}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* TestChimp Playwright runtime: TrueCoverage CI metadata (`installTrueCoverage` / `installTestChimp`) and,
|
|
3
|
+
* when `EXPLORECHIMP_ENABLED`, ExploreChimp local analytics (same installs — no separate ExploreChimp install).
|
|
4
4
|
*
|
|
5
|
-
* Prefer `installTrueCoverage(mergedTest)` on the same `test` object your specs use
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
5
|
+
* Prefer `installTrueCoverage(mergedTest)` (or `installTestChimp`) on the same `test` object your specs use.
|
|
6
|
+
* Screen/state markers: `test('…', async ({ markScreenState }) => { await markScreenState('Screen', 'state'); })`.
|
|
7
|
+
* The same `markScreenState` fixture records a Playwright `test.step` when ExploreChimp is off, and runs ExploreChimp analytics when it is on.
|
|
8
|
+
* Side-effect `import '@testchimp/playwright/runtime'` still registers on the root `@playwright/test` instance.
|
|
9
9
|
*/
|
|
10
|
+
import { isExploreChimpEnabled } from './explorechimp';
|
|
11
|
+
/** Bound screen/state marker from the `markScreenState` Playwright fixture. */
|
|
12
|
+
export type MarkScreenStateFixture = (screenName: string, stateName?: string) => Promise<void>;
|
|
10
13
|
/**
|
|
11
14
|
* Register TrueCoverage CI metadata injection on the given Playwright `test` object
|
|
12
|
-
* (including `mergeTests(...)` output).
|
|
15
|
+
* (including `mergeTests(...)` output). When `EXPLORECHIMP_ENABLED`, also applies ExploreChimp page wiring.
|
|
13
16
|
*/
|
|
14
17
|
export declare function installTrueCoverage(test: any): any;
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
* @param screenName logical screen (e.g. "Login", "Dashboard")
|
|
20
|
-
* @param stateName optional state within the screen; defaults to `"default"`
|
|
21
|
-
*/
|
|
22
|
-
export declare function markScreenState(screenName: string, stateName?: string): Promise<void>;
|
|
18
|
+
/** Same behavior as {@link installTrueCoverage} — umbrella name for TrueCoverage + ExploreChimp (via env). */
|
|
19
|
+
export declare const installTestChimp: typeof installTrueCoverage;
|
|
20
|
+
export { isExploreChimpEnabled };
|
|
23
21
|
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,OAAO,EAGL,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAKxB,+EAA+E;AAC/E,MAAM,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAmB/F;;;GAGG;AAEH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,GAAG,GAAG,CAsDlD;AAED,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,4BAAsB,CAAC;AAEpD,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|