playwright-opentelemetry 0.4.0 → 0.6.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.
- package/dist/config-B9i3jm5s.d.cts +15 -0
- package/dist/config-B9i3jm5s.d.mts +15 -0
- package/dist/fixture/factory.cjs +3 -0
- package/dist/fixture/factory.d.cts +2 -0
- package/dist/fixture/factory.d.mts +2 -0
- package/dist/fixture/factory.mjs +2 -0
- package/dist/fixture-1Zc7Gp0b.d.cts +61 -0
- package/dist/fixture-C85kKbWA.cjs +416 -0
- package/dist/fixture-CQtQM60Z.mjs +410 -0
- package/dist/fixture-IJvYGCtD.d.mts +61 -0
- package/dist/fixture.cjs +16 -0
- package/dist/fixture.d.cts +17 -0
- package/dist/fixture.d.mts +13 -26
- package/dist/fixture.mjs +4 -313
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/otel-B-kvMiiq.d.cts +18 -0
- package/dist/otel-B-kvMiiq.d.mts +18 -0
- package/dist/reporter-DaCojFom.d.cts +25 -0
- package/dist/reporter-DaCojFom.d.mts +25 -0
- package/dist/reporter-S_gsTMix.mjs +429 -0
- package/dist/reporter-XVwaSQDK.cjs +436 -0
- package/dist/reporter.cjs +4 -0
- package/dist/reporter.d.cts +2 -0
- package/dist/reporter.d.mts +2 -2
- package/dist/reporter.mjs +1 -1
- package/dist/trace-context-88H-vhOr.cjs +286 -0
- package/dist/trace-context-e11YEu8B.mjs +205 -0
- package/package.json +13 -1
- package/dist/index-BNfDd8Mg.d.mts +0 -45
- package/dist/reporter-BTiwJ6bu.mjs +0 -461
- package/dist/trace-files-B6bmvwUq.mjs +0 -218
package/dist/fixture.mjs
CHANGED
|
@@ -1,316 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import path from "node:path";
|
|
1
|
+
import { t as createPlaywrightOtelTest } from "./fixture-CQtQM60Z.mjs";
|
|
3
2
|
import { test as test$1 } from "@playwright/test";
|
|
4
|
-
|
|
5
|
-
const BROWSER_PAGE_SPAN_NAME = "browser.page";
|
|
6
|
-
const BROWSER_SERVICE_NAME = "playwright-browser";
|
|
7
|
-
const SPAN_STATUS_CODE_UNSET$1 = 0;
|
|
8
|
-
var BrowserPageTracker = class {
|
|
9
|
-
testId;
|
|
10
|
-
outputDir;
|
|
11
|
-
nextPageId = 1;
|
|
12
|
-
pageIds = /* @__PURE__ */ new WeakMap();
|
|
13
|
-
activePageSpans = /* @__PURE__ */ new WeakMap();
|
|
14
|
-
lastFrameUrls = /* @__PURE__ */ new WeakMap();
|
|
15
|
-
constructor(testId, outputDir) {
|
|
16
|
-
this.testId = testId;
|
|
17
|
-
this.outputDir = outputDir;
|
|
18
|
-
}
|
|
19
|
-
registerPage(page) {
|
|
20
|
-
this.pageIdFor(page);
|
|
21
|
-
this.lastFrameUrls.set(page, page.url());
|
|
22
|
-
}
|
|
23
|
-
startDocumentNavigation(request) {
|
|
24
|
-
if (!isMainFrameNavigationRequest(request)) return;
|
|
25
|
-
const page = pageForRequest(request);
|
|
26
|
-
if (!page) return;
|
|
27
|
-
this.startPageSpan(page, request.url(), "document");
|
|
28
|
-
}
|
|
29
|
-
handleFrameNavigated(page, url) {
|
|
30
|
-
const previousUrl = this.lastFrameUrls.get(page);
|
|
31
|
-
this.lastFrameUrls.set(page, url);
|
|
32
|
-
if (!previousUrl || previousUrl === "about:blank") return;
|
|
33
|
-
if (!shouldCreateSameDocumentPageSpan(previousUrl, url, this.activePageSpans.get(page)?.url)) return;
|
|
34
|
-
this.startPageSpan(page, url, "same-document", previousUrl);
|
|
35
|
-
}
|
|
36
|
-
getActivePageSpanId(request) {
|
|
37
|
-
const page = pageForRequest(request);
|
|
38
|
-
if (!page) return;
|
|
39
|
-
return this.activePageSpans.get(page)?.spanId;
|
|
40
|
-
}
|
|
41
|
-
startPageSpan(page, url, navigationType, previousUrl) {
|
|
42
|
-
const pageId = this.pageIdFor(page);
|
|
43
|
-
const traceId = getOrCreateTraceId(this.outputDir, this.testId);
|
|
44
|
-
const spanId = generateSpanId();
|
|
45
|
-
const parentSpanId = getCurrentSpanId(this.outputDir, this.testId);
|
|
46
|
-
const startTime = /* @__PURE__ */ new Date();
|
|
47
|
-
const attributes = pageAttributes(pageId, url, navigationType, previousUrl);
|
|
48
|
-
const span = {
|
|
49
|
-
traceId,
|
|
50
|
-
spanId,
|
|
51
|
-
parentSpanId,
|
|
52
|
-
name: BROWSER_PAGE_SPAN_NAME,
|
|
53
|
-
startTime,
|
|
54
|
-
endTime: startTime,
|
|
55
|
-
status: { code: SPAN_STATUS_CODE_UNSET$1 },
|
|
56
|
-
attributes,
|
|
57
|
-
serviceName: BROWSER_SERVICE_NAME
|
|
58
|
-
};
|
|
59
|
-
this.activePageSpans.set(page, {
|
|
60
|
-
pageId,
|
|
61
|
-
spanId,
|
|
62
|
-
url
|
|
63
|
-
});
|
|
64
|
-
this.lastFrameUrls.set(page, url);
|
|
65
|
-
writeBrowserPageSpan(this.outputDir, this.testId, span);
|
|
66
|
-
}
|
|
67
|
-
pageIdFor(page) {
|
|
68
|
-
const existing = this.pageIds.get(page);
|
|
69
|
-
if (existing) return existing;
|
|
70
|
-
const pageId = `page-${this.nextPageId++}`;
|
|
71
|
-
this.pageIds.set(page, pageId);
|
|
72
|
-
return pageId;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
function pageAttributes(pageId, url, navigationType, previousUrl) {
|
|
76
|
-
const attributes = {
|
|
77
|
-
"browser.resource.type": "page",
|
|
78
|
-
"browser.page.id": pageId,
|
|
79
|
-
"browser.page.navigation.type": navigationType,
|
|
80
|
-
"url.full": url
|
|
81
|
-
};
|
|
82
|
-
try {
|
|
83
|
-
const parsedUrl = new URL(url);
|
|
84
|
-
attributes["url.path"] = parsedUrl.pathname;
|
|
85
|
-
if (parsedUrl.search) attributes["url.query"] = parsedUrl.search.slice(1);
|
|
86
|
-
} catch {}
|
|
87
|
-
if (previousUrl) attributes["browser.page.previous_url"] = previousUrl;
|
|
88
|
-
return attributes;
|
|
89
|
-
}
|
|
90
|
-
function isMainFrameNavigationRequest(request) {
|
|
91
|
-
if (!request.isNavigationRequest()) return false;
|
|
92
|
-
try {
|
|
93
|
-
const frame = request.frame();
|
|
94
|
-
return frame === frame.page().mainFrame();
|
|
95
|
-
} catch {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
function pageForRequest(request) {
|
|
100
|
-
try {
|
|
101
|
-
return request.frame().page();
|
|
102
|
-
} catch {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
function stripHash(url) {
|
|
107
|
-
try {
|
|
108
|
-
const parsed = new URL(url);
|
|
109
|
-
parsed.hash = "";
|
|
110
|
-
return parsed.toString();
|
|
111
|
-
} catch {
|
|
112
|
-
return url.split("#")[0] ?? url;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function shouldCreateSameDocumentPageSpan(previousUrl, nextUrl, activePageUrl) {
|
|
116
|
-
if (activePageUrl && stripHash(activePageUrl) === stripHash(nextUrl)) return false;
|
|
117
|
-
return stripHash(previousUrl) !== stripHash(nextUrl);
|
|
118
|
-
}
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/fixture/network-propagator.ts
|
|
121
|
-
/**
|
|
122
|
-
* Intercepts network requests to propagate trace context via traceparent header.
|
|
123
|
-
* Also records the parent span ID for later correlation by the response handler.
|
|
124
|
-
*
|
|
125
|
-
* This function only:
|
|
126
|
-
* 1. Creates a span ID for the request
|
|
127
|
-
* 2. Injects the traceparent header
|
|
128
|
-
* 3. Writes a parent file with the current parent span ID
|
|
129
|
-
*
|
|
130
|
-
* The actual span data (timing, status, attributes) is captured by
|
|
131
|
-
* fixtureCaptureRequestResponse when the response is received.
|
|
132
|
-
*
|
|
133
|
-
* @param options - The propagator options
|
|
134
|
-
*/
|
|
135
|
-
async function fixtureOtelHeaderPropagator({ route, request, testId, outputDir, parentSpanId: parentSpanIdOverride }) {
|
|
136
|
-
const traceId = getOrCreateTraceId(outputDir, testId);
|
|
137
|
-
const parentSpanId = parentSpanIdOverride ?? getCurrentSpanId(outputDir, testId);
|
|
138
|
-
const traceHeader = `00-${traceId}-${generateSpanId()}-01`;
|
|
139
|
-
writeNetworkSpanParent({
|
|
140
|
-
outputDir,
|
|
141
|
-
testId,
|
|
142
|
-
parentSpanId,
|
|
143
|
-
traceHeader
|
|
144
|
-
});
|
|
145
|
-
await route.fallback({ headers: {
|
|
146
|
-
...request.headers(),
|
|
147
|
-
traceparent: traceHeader
|
|
148
|
-
} });
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
//#region src/fixture/request-response-capture.ts
|
|
152
|
-
/**
|
|
153
|
-
* Detects the resource type based on Content-Type header with URL extension fallback.
|
|
154
|
-
* This categorization mirrors Chrome DevTools Network tab behavior.
|
|
155
|
-
*
|
|
156
|
-
* @param contentType - The Content-Type response header value (may be null)
|
|
157
|
-
* @param url - The request URL (used as fallback)
|
|
158
|
-
* @returns The detected resource type
|
|
159
|
-
*/
|
|
160
|
-
function detectResourceType(contentType, url) {
|
|
161
|
-
if (contentType) {
|
|
162
|
-
const mimeType = contentType.split(";")[0].trim().toLowerCase();
|
|
163
|
-
if (mimeType !== "application/octet-stream") {
|
|
164
|
-
if (mimeType === "text/html" || mimeType === "application/xhtml+xml") return "document";
|
|
165
|
-
if (mimeType === "application/javascript" || mimeType === "text/javascript" || mimeType === "application/x-javascript" || mimeType === "application/ecmascript" || mimeType === "text/ecmascript" || mimeType === "module" || mimeType === "application/wasm") return "script";
|
|
166
|
-
if (mimeType === "text/css") return "stylesheet";
|
|
167
|
-
if (mimeType.startsWith("image/")) return "image";
|
|
168
|
-
if (mimeType.startsWith("font/") || mimeType === "application/font-woff" || mimeType === "application/font-woff2" || mimeType === "application/x-font-ttf" || mimeType === "application/x-font-opentype") return "font";
|
|
169
|
-
if (mimeType.startsWith("video/") || mimeType.startsWith("audio/")) return "media";
|
|
170
|
-
if (mimeType === "application/json" || mimeType === "text/plain" || mimeType === "application/xml" || mimeType === "text/xml" || mimeType.endsWith("+json") || mimeType.endsWith("+xml")) return "fetch";
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
const resourceType = detectResourceTypeFromUrl(url);
|
|
174
|
-
if (resourceType) return resourceType;
|
|
175
|
-
return "other";
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Detects resource type from URL file extension.
|
|
179
|
-
* Used as fallback when Content-Type header is missing or generic.
|
|
180
|
-
*/
|
|
181
|
-
function detectResourceTypeFromUrl(url) {
|
|
182
|
-
try {
|
|
183
|
-
const lastSegment = new URL(url).pathname.toLowerCase().split("/").pop() || "";
|
|
184
|
-
const dotIndex = lastSegment.lastIndexOf(".");
|
|
185
|
-
if (dotIndex === -1) return null;
|
|
186
|
-
const extension = lastSegment.slice(dotIndex + 1);
|
|
187
|
-
if (extension === "html" || extension === "htm" || extension === "xhtml") return "document";
|
|
188
|
-
if (extension === "js" || extension === "mjs" || extension === "cjs" || extension === "jsx" || extension === "ts" || extension === "tsx" || extension === "wasm") return "script";
|
|
189
|
-
if (extension === "css") return "stylesheet";
|
|
190
|
-
if (extension === "png" || extension === "jpg" || extension === "jpeg" || extension === "gif" || extension === "svg" || extension === "webp" || extension === "ico" || extension === "bmp" || extension === "avif") return "image";
|
|
191
|
-
if (extension === "woff" || extension === "woff2" || extension === "ttf" || extension === "otf" || extension === "eot") return "font";
|
|
192
|
-
if (extension === "mp4" || extension === "webm" || extension === "ogg" || extension === "mp3" || extension === "wav" || extension === "m4a" || extension === "aac" || extension === "flac" || extension === "avi" || extension === "mov") return "media";
|
|
193
|
-
if (extension === "json" || extension === "xml") return "fetch";
|
|
194
|
-
return null;
|
|
195
|
-
} catch {
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* OpenTelemetry SpanKind values
|
|
201
|
-
* @see https://opentelemetry.io/docs/specs/otel/trace/api/#spankind
|
|
202
|
-
*/
|
|
203
|
-
const SPAN_KIND_CLIENT = 3;
|
|
204
|
-
/**
|
|
205
|
-
* OpenTelemetry SpanStatusCode values
|
|
206
|
-
* @see https://opentelemetry.io/docs/specs/otel/trace/api/#set-status
|
|
207
|
-
*/
|
|
208
|
-
const SPAN_STATUS_CODE_UNSET = 0;
|
|
209
|
-
const SPAN_STATUS_CODE_ERROR = 2;
|
|
210
|
-
/**
|
|
211
|
-
* Captures request/response data and writes the complete network span.
|
|
212
|
-
* Called from page.on("response") after the request has completed.
|
|
213
|
-
*
|
|
214
|
-
* This function:
|
|
215
|
-
* 1. Extracts the traceparent header to find the parent file
|
|
216
|
-
* 2. Reads the parent span ID from the parent file
|
|
217
|
-
* 3. Builds the complete span with all HTTP attributes
|
|
218
|
-
* 4. Writes the network span for the reporter to collect
|
|
219
|
-
*
|
|
220
|
-
* @param options - The capture options
|
|
221
|
-
*/
|
|
222
|
-
async function fixtureCaptureRequestResponse({ request, response, testId, outputDir }) {
|
|
223
|
-
const url = request.url();
|
|
224
|
-
const method = request.method();
|
|
225
|
-
const statusCode = response.status();
|
|
226
|
-
const traceHeader = await request.headerValue("traceparent");
|
|
227
|
-
if (!traceHeader) return;
|
|
228
|
-
const parentSpanId = readNetworkSpanParent(outputDir, testId, traceHeader);
|
|
229
|
-
if (!parentSpanId) return;
|
|
230
|
-
const parts = traceHeader.split("-");
|
|
231
|
-
if (parts.length !== 4) return;
|
|
232
|
-
const [, traceId, spanId] = parts;
|
|
233
|
-
const timing = request.timing();
|
|
234
|
-
const startTime = new Date(timing.startTime);
|
|
235
|
-
const endTime = timing.responseEnd >= 0 ? new Date(timing.startTime + timing.responseEnd) : new Date(timing.startTime);
|
|
236
|
-
const parsedUrl = new URL(url);
|
|
237
|
-
const serverAddress = parsedUrl.hostname;
|
|
238
|
-
const serverPort = parsedUrl.port !== "" ? Number.parseInt(parsedUrl.port, 10) : parsedUrl.protocol === "https:" ? 443 : 80;
|
|
239
|
-
let statusCodeValue = SPAN_STATUS_CODE_UNSET;
|
|
240
|
-
if (statusCode >= 400) statusCodeValue = SPAN_STATUS_CODE_ERROR;
|
|
241
|
-
const resourceType = detectResourceType(await response.headerValue("content-type"), url);
|
|
242
|
-
const attributes = {
|
|
243
|
-
"http.request.method": method,
|
|
244
|
-
"url.full": url,
|
|
245
|
-
"url.path": parsedUrl.pathname,
|
|
246
|
-
"server.address": serverAddress,
|
|
247
|
-
"server.port": serverPort,
|
|
248
|
-
"http.response.status_code": statusCode,
|
|
249
|
-
"http.resource.type": resourceType
|
|
250
|
-
};
|
|
251
|
-
if (parsedUrl.search) attributes["url.query"] = parsedUrl.search.slice(1);
|
|
252
|
-
if (statusCodeValue === SPAN_STATUS_CODE_ERROR) attributes["error.type"] = statusCode.toString();
|
|
253
|
-
writeNetworkSpan(outputDir, testId, traceHeader, {
|
|
254
|
-
traceId,
|
|
255
|
-
spanId,
|
|
256
|
-
parentSpanId,
|
|
257
|
-
name: `HTTP ${method}`,
|
|
258
|
-
kind: SPAN_KIND_CLIENT,
|
|
259
|
-
startTime,
|
|
260
|
-
endTime,
|
|
261
|
-
status: { code: statusCodeValue },
|
|
262
|
-
attributes,
|
|
263
|
-
serviceName: "playwright-browser"
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
//#endregion
|
|
3
|
+
export * from "@playwright/test";
|
|
267
4
|
//#region src/fixture/index.ts
|
|
268
|
-
const test = test$1
|
|
269
|
-
testTraceInfo: [async ({ playwright }, use, testInfo) => {
|
|
270
|
-
const outputDir = path.dirname(testInfo.outputDir);
|
|
271
|
-
await use({
|
|
272
|
-
testId: testInfo.testId,
|
|
273
|
-
outputDir
|
|
274
|
-
});
|
|
275
|
-
}, { auto: true }],
|
|
276
|
-
browserPageTracker: [async ({ testTraceInfo: { testId, outputDir } }, use) => {
|
|
277
|
-
await use(new BrowserPageTracker(testId, outputDir));
|
|
278
|
-
}, { auto: true }],
|
|
279
|
-
context: async ({ context, testTraceInfo: { testId, outputDir }, browserPageTracker }, use) => {
|
|
280
|
-
context.route("**", async (route, request) => {
|
|
281
|
-
browserPageTracker.startDocumentNavigation(request);
|
|
282
|
-
await fixtureOtelHeaderPropagator({
|
|
283
|
-
route,
|
|
284
|
-
request,
|
|
285
|
-
testId,
|
|
286
|
-
outputDir,
|
|
287
|
-
parentSpanId: browserPageTracker.getActivePageSpanId(request) ?? null
|
|
288
|
-
});
|
|
289
|
-
});
|
|
290
|
-
await use(context);
|
|
291
|
-
},
|
|
292
|
-
page: async ({ page, testTraceInfo: { testId, outputDir }, browserPageTracker }, use) => {
|
|
293
|
-
browserPageTracker.registerPage(page);
|
|
294
|
-
page.on("framenavigated", (frame) => {
|
|
295
|
-
if (frame === page.mainFrame()) browserPageTracker.handleFrameNavigated(page, frame.url());
|
|
296
|
-
});
|
|
297
|
-
const pendingRequests = /* @__PURE__ */ new Map();
|
|
298
|
-
page.on("response", (response) => {
|
|
299
|
-
pendingRequests.set(response.request(), response);
|
|
300
|
-
});
|
|
301
|
-
page.on("requestfinished", async (request) => {
|
|
302
|
-
const response = pendingRequests.get(request);
|
|
303
|
-
pendingRequests.delete(request);
|
|
304
|
-
if (!response) return;
|
|
305
|
-
await fixtureCaptureRequestResponse({
|
|
306
|
-
request,
|
|
307
|
-
response,
|
|
308
|
-
testId,
|
|
309
|
-
outputDir
|
|
310
|
-
});
|
|
311
|
-
});
|
|
312
|
-
await use(page);
|
|
313
|
-
}
|
|
314
|
-
});
|
|
5
|
+
const test = createPlaywrightOtelTest(test$1);
|
|
315
6
|
//#endregion
|
|
316
|
-
export { test };
|
|
7
|
+
export { createPlaywrightOtelTest, test };
|
package/dist/index.cjs
ADDED
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions, t as PlaywrightOpentelemetryConfig } from "./config-B9i3jm5s.cjs";
|
|
2
|
+
import { t as PlaywrightOpentelemetryReporter } from "./reporter-DaCojFom.cjs";
|
|
3
|
+
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, PlaywrightOpentelemetryReporter as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions, t as PlaywrightOpentelemetryConfig } from "./config-B9i3jm5s.mjs";
|
|
2
|
+
import { t as PlaywrightOpentelemetryReporter } from "./reporter-DaCojFom.mjs";
|
|
3
|
+
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, PlaywrightOpentelemetryReporter as default };
|
package/dist/index.mjs
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/shared/otel.d.ts
|
|
2
|
+
type SpanAttributeValue = string | number | boolean | string[];
|
|
3
|
+
type Span = {
|
|
4
|
+
traceId: string;
|
|
5
|
+
spanId: string;
|
|
6
|
+
parentSpanId?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
startTime: Date;
|
|
9
|
+
endTime: Date;
|
|
10
|
+
attributes: Record<string, SpanAttributeValue>;
|
|
11
|
+
status: {
|
|
12
|
+
code: number;
|
|
13
|
+
};
|
|
14
|
+
kind?: number; /** Service name for this span (if different from default). */
|
|
15
|
+
serviceName?: string;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Span as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/shared/otel.d.ts
|
|
2
|
+
type SpanAttributeValue = string | number | boolean | string[];
|
|
3
|
+
type Span = {
|
|
4
|
+
traceId: string;
|
|
5
|
+
spanId: string;
|
|
6
|
+
parentSpanId?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
startTime: Date;
|
|
9
|
+
endTime: Date;
|
|
10
|
+
attributes: Record<string, SpanAttributeValue>;
|
|
11
|
+
status: {
|
|
12
|
+
code: number;
|
|
13
|
+
};
|
|
14
|
+
kind?: number; /** Service name for this span (if different from default). */
|
|
15
|
+
serviceName?: string;
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Span as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult, TestStep } from "@playwright/test/reporter";
|
|
2
|
+
|
|
3
|
+
//#region src/reporter/reporter.d.ts
|
|
4
|
+
declare class PlaywrightOpentelemetryReporter implements Reporter {
|
|
5
|
+
private spanBatches;
|
|
6
|
+
private pendingTraceArtifacts;
|
|
7
|
+
private rootDir?;
|
|
8
|
+
private playwrightVersion?;
|
|
9
|
+
private debug;
|
|
10
|
+
constructor();
|
|
11
|
+
onBegin(config: FullConfig, _suite: Suite): void;
|
|
12
|
+
onTestBegin(_test: TestCase, _result: TestResult): void;
|
|
13
|
+
onStepBegin(_test: TestCase, _result: TestResult, _step: TestStep): void;
|
|
14
|
+
onStepEnd(_test: TestCase, _result: TestResult, _step: TestStep): void;
|
|
15
|
+
onTestEnd(test: TestCase, result: TestResult): void;
|
|
16
|
+
onEnd(_result: FullResult): Promise<void>;
|
|
17
|
+
private prepareTraceArtifact;
|
|
18
|
+
private processTestStep;
|
|
19
|
+
onStdOut(chunk: string | Buffer, _test: TestCase, _result: TestResult): void;
|
|
20
|
+
onStdErr(chunk: string | Buffer, _test: TestCase, _result: TestResult): void;
|
|
21
|
+
printsToStdio(): boolean;
|
|
22
|
+
private sendScreenshotsZipToTraceApi;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { PlaywrightOpentelemetryReporter as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FullConfig, FullResult, Reporter, Suite, TestCase, TestResult, TestStep } from "@playwright/test/reporter";
|
|
2
|
+
|
|
3
|
+
//#region src/reporter/reporter.d.ts
|
|
4
|
+
declare class PlaywrightOpentelemetryReporter implements Reporter {
|
|
5
|
+
private spanBatches;
|
|
6
|
+
private pendingTraceArtifacts;
|
|
7
|
+
private rootDir?;
|
|
8
|
+
private playwrightVersion?;
|
|
9
|
+
private debug;
|
|
10
|
+
constructor();
|
|
11
|
+
onBegin(config: FullConfig, _suite: Suite): void;
|
|
12
|
+
onTestBegin(_test: TestCase, _result: TestResult): void;
|
|
13
|
+
onStepBegin(_test: TestCase, _result: TestResult, _step: TestStep): void;
|
|
14
|
+
onStepEnd(_test: TestCase, _result: TestResult, _step: TestStep): void;
|
|
15
|
+
onTestEnd(test: TestCase, result: TestResult): void;
|
|
16
|
+
onEnd(_result: FullResult): Promise<void>;
|
|
17
|
+
private prepareTraceArtifact;
|
|
18
|
+
private processTestStep;
|
|
19
|
+
onStdOut(chunk: string | Buffer, _test: TestCase, _result: TestResult): void;
|
|
20
|
+
onStdErr(chunk: string | Buffer, _test: TestCase, _result: TestResult): void;
|
|
21
|
+
printsToStdio(): boolean;
|
|
22
|
+
private sendScreenshotsZipToTraceApi;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { PlaywrightOpentelemetryReporter as t };
|