playwright-opentelemetry 0.6.2 → 0.8.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-DtRqsWLc.mjs → config-BltzmZgg.mjs} +26 -4
- package/dist/{config-DyCIVAMs.cjs → config-Cc1BZNAB.cjs} +31 -3
- package/dist/config-Db932l_s.d.cts +27 -0
- package/dist/config-Db932l_s.d.mts +27 -0
- package/dist/fixture/factory.cjs +1 -1
- package/dist/fixture/factory.d.cts +1 -1
- package/dist/fixture/factory.d.mts +1 -1
- package/dist/fixture/factory.mjs +1 -1
- package/dist/fixture.cjs +1 -1
- package/dist/fixture.d.cts +3 -3
- package/dist/fixture.d.mts +3 -3
- package/dist/fixture.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{playwright-opentelemetry-fixture-S6naMJss.cjs → playwright-opentelemetry-fixture-BBMxdNJV.cjs} +6 -3
- package/dist/{playwright-opentelemetry-fixture-OLGl3MWO.d.cts → playwright-opentelemetry-fixture-Dx53ybJd.d.cts} +1 -1
- package/dist/{playwright-opentelemetry-fixture-B1ZK-LqY.mjs → playwright-opentelemetry-fixture-fBGMe1bl.mjs} +6 -3
- package/dist/{playwright-opentelemetry-fixture-BGWT93Zw.d.mts → playwright-opentelemetry-fixture-xHcfAc5d.d.mts} +1 -1
- package/dist/{reporter-BCfhex03.mjs → reporter-C_2H_1Ph.mjs} +67 -13
- package/dist/{reporter-B5naKhOY.cjs → reporter-Dtah1-91.cjs} +66 -12
- package/dist/reporter.cjs +1 -1
- package/dist/reporter.mjs +1 -1
- package/package.json +2 -2
- package/dist/config-2S21d575.d.cts +0 -16
- package/dist/config-2S21d575.d.mts +0 -16
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.8.0";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/shared/otel.ts
|
|
5
5
|
/** Generate a random 32-character hex trace ID. */
|
|
@@ -119,6 +119,26 @@ async function sendSpans(spans, options) {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
//#endregion
|
|
122
|
+
//#region src/shared/playwright-trace.ts
|
|
123
|
+
function shouldRetainPlaywrightTrace(trace, testInfo) {
|
|
124
|
+
const mode = normalizeTraceMode(trace);
|
|
125
|
+
const retry = testInfo?.retry ?? 0;
|
|
126
|
+
const testFailed = (testInfo?.status ?? "passed") !== (testInfo?.expectedStatus ?? "passed");
|
|
127
|
+
switch (mode) {
|
|
128
|
+
case "on": return true;
|
|
129
|
+
case "on-first-retry": return retry === 1;
|
|
130
|
+
case "on-all-retries": return retry > 0;
|
|
131
|
+
case "retain-on-failure": return testFailed;
|
|
132
|
+
case "retain-on-first-failure": return retry === 0 && testFailed;
|
|
133
|
+
case "retain-on-failure-and-retries": return testFailed || retry > 0;
|
|
134
|
+
case "off": return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function normalizeTraceMode(trace) {
|
|
138
|
+
const mode = typeof trace === "string" ? trace : trace?.mode ?? "off";
|
|
139
|
+
return mode === "retry-with-trace" ? "on-first-retry" : mode;
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
122
142
|
//#region src/fixture/trace-context.ts
|
|
123
143
|
const TRACE_CONTEXT_ATTACHMENT_NAME = "playwright-opentelemetry-trace-context";
|
|
124
144
|
const FIXTURE_SPANS_ATTACHMENT_NAME = "playwright-opentelemetry-fixture-spans";
|
|
@@ -141,9 +161,10 @@ async function createTestTraceContext(testInfo) {
|
|
|
141
161
|
});
|
|
142
162
|
return traceContext;
|
|
143
163
|
}
|
|
144
|
-
async function flushFixtureSpans(traceContext, config,
|
|
164
|
+
async function flushFixtureSpans(traceContext, config, options) {
|
|
145
165
|
if (traceContext.spans.length === 0) return;
|
|
146
|
-
if (
|
|
166
|
+
if (!shouldRetainPlaywrightTrace(options.trace, options.testInfo)) return;
|
|
167
|
+
if (config.storeTraceZip && options.testInfo) await options.testInfo.attach(FIXTURE_SPANS_ATTACHMENT_NAME, {
|
|
147
168
|
body: JSON.stringify({ spans: traceContext.spans.map(serializeSpanForAttachment) }),
|
|
148
169
|
contentType: "application/json"
|
|
149
170
|
});
|
|
@@ -198,6 +219,7 @@ function resolvePlaywrightOpentelemetryConfig(config, options = {}) {
|
|
|
198
219
|
...envTraceApiHeaders
|
|
199
220
|
},
|
|
200
221
|
storeTraceZip: config?.storeTraceZip === true,
|
|
222
|
+
trace: config?.trace ?? null,
|
|
201
223
|
propagateTraceHeaders: config?.propagateTraceHeaders ?? true,
|
|
202
224
|
serviceName: process.env.OTEL_SERVICE_NAME || config?.serviceName || "playwright-tests",
|
|
203
225
|
debug: debugEnv === void 0 ? config?.debug ?? false : debugEnv === "1" || debugEnv === "true"
|
|
@@ -212,4 +234,4 @@ function getConfigurationErrorMessage() {
|
|
|
212
234
|
return "playwright-opentelemetry reporter requires an OTLP endpoint, trace API endpoint, or storeTraceZip to be configured.\n\nYou can configure it using environment variables:\n\n export OTEL_EXPORTER_OTLP_ENDPOINT=\"https://api.honeycomb.io\"\n export OTEL_EXPORTER_OTLP_HEADERS=\"x-honeycomb-team=YOUR_API_KEY\"\n export OTEL_SERVICE_NAME=\"my-service\"\n\nOr via playwright.config.ts:\n\nimport { defineConfig } from '@playwright/test';\nimport type { PlaywrightOpentelemetryUseOptions } from 'playwright-opentelemetry/fixture';\n\nexport default defineConfig<PlaywrightOpentelemetryUseOptions>({\n use: {\n playwrightOpentelemetry: {\n otlpEndpoint: 'http://localhost:4317/v1/traces',\n otlpHeaders: {\n Authorization: 'Bearer YOUR_TOKEN',\n },\n serviceName: 'my-service',\n },\n },\n reporter: [['playwright-opentelemetry/reporter']],\n});\n\nNote: Environment variables take precedence over use.playwrightOpentelemetry options.\n";
|
|
213
235
|
}
|
|
214
236
|
//#endregion
|
|
215
|
-
export { flushFixtureSpans as a,
|
|
237
|
+
export { flushFixtureSpans as a, generateSpanId as c, createTestTraceContext as i, generateTraceId as l, FIXTURE_SPANS_ATTACHMENT_NAME as n, shouldRetainPlaywrightTrace as o, TRACE_CONTEXT_ATTACHMENT_NAME as r, buildOtlpRequest as s, resolvePlaywrightOpentelemetryConfig as t, sendSpans as u };
|
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
}) : target, mod));
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region package.json
|
|
24
|
-
var version = "0.
|
|
24
|
+
var version = "0.8.0";
|
|
25
25
|
//#endregion
|
|
26
26
|
//#region src/shared/otel.ts
|
|
27
27
|
/** Generate a random 32-character hex trace ID. */
|
|
@@ -141,6 +141,26 @@ async function sendSpans(spans, options) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
//#endregion
|
|
144
|
+
//#region src/shared/playwright-trace.ts
|
|
145
|
+
function shouldRetainPlaywrightTrace(trace, testInfo) {
|
|
146
|
+
const mode = normalizeTraceMode(trace);
|
|
147
|
+
const retry = testInfo?.retry ?? 0;
|
|
148
|
+
const testFailed = (testInfo?.status ?? "passed") !== (testInfo?.expectedStatus ?? "passed");
|
|
149
|
+
switch (mode) {
|
|
150
|
+
case "on": return true;
|
|
151
|
+
case "on-first-retry": return retry === 1;
|
|
152
|
+
case "on-all-retries": return retry > 0;
|
|
153
|
+
case "retain-on-failure": return testFailed;
|
|
154
|
+
case "retain-on-first-failure": return retry === 0 && testFailed;
|
|
155
|
+
case "retain-on-failure-and-retries": return testFailed || retry > 0;
|
|
156
|
+
case "off": return false;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function normalizeTraceMode(trace) {
|
|
160
|
+
const mode = typeof trace === "string" ? trace : trace?.mode ?? "off";
|
|
161
|
+
return mode === "retry-with-trace" ? "on-first-retry" : mode;
|
|
162
|
+
}
|
|
163
|
+
//#endregion
|
|
144
164
|
//#region src/fixture/trace-context.ts
|
|
145
165
|
const TRACE_CONTEXT_ATTACHMENT_NAME = "playwright-opentelemetry-trace-context";
|
|
146
166
|
const FIXTURE_SPANS_ATTACHMENT_NAME = "playwright-opentelemetry-fixture-spans";
|
|
@@ -163,9 +183,10 @@ async function createTestTraceContext(testInfo) {
|
|
|
163
183
|
});
|
|
164
184
|
return traceContext;
|
|
165
185
|
}
|
|
166
|
-
async function flushFixtureSpans(traceContext, config,
|
|
186
|
+
async function flushFixtureSpans(traceContext, config, options) {
|
|
167
187
|
if (traceContext.spans.length === 0) return;
|
|
168
|
-
if (
|
|
188
|
+
if (!shouldRetainPlaywrightTrace(options.trace, options.testInfo)) return;
|
|
189
|
+
if (config.storeTraceZip && options.testInfo) await options.testInfo.attach(FIXTURE_SPANS_ATTACHMENT_NAME, {
|
|
169
190
|
body: JSON.stringify({ spans: traceContext.spans.map(serializeSpanForAttachment) }),
|
|
170
191
|
contentType: "application/json"
|
|
171
192
|
});
|
|
@@ -220,6 +241,7 @@ function resolvePlaywrightOpentelemetryConfig(config, options = {}) {
|
|
|
220
241
|
...envTraceApiHeaders
|
|
221
242
|
},
|
|
222
243
|
storeTraceZip: config?.storeTraceZip === true,
|
|
244
|
+
trace: config?.trace ?? null,
|
|
223
245
|
propagateTraceHeaders: config?.propagateTraceHeaders ?? true,
|
|
224
246
|
serviceName: process.env.OTEL_SERVICE_NAME || config?.serviceName || "playwright-tests",
|
|
225
247
|
debug: debugEnv === void 0 ? config?.debug ?? false : debugEnv === "1" || debugEnv === "true"
|
|
@@ -294,3 +316,9 @@ Object.defineProperty(exports, "sendSpans", {
|
|
|
294
316
|
return sendSpans;
|
|
295
317
|
}
|
|
296
318
|
});
|
|
319
|
+
Object.defineProperty(exports, "shouldRetainPlaywrightTrace", {
|
|
320
|
+
enumerable: true,
|
|
321
|
+
get: function() {
|
|
322
|
+
return shouldRetainPlaywrightTrace;
|
|
323
|
+
}
|
|
324
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/shared/playwright-trace.d.ts
|
|
2
|
+
type PlaywrightTraceMode = "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries";
|
|
3
|
+
type PlaywrightTraceOption = PlaywrightTraceMode | "retry-with-trace" | {
|
|
4
|
+
mode: PlaywrightTraceMode;
|
|
5
|
+
snapshots?: boolean;
|
|
6
|
+
screenshots?: boolean;
|
|
7
|
+
sources?: boolean;
|
|
8
|
+
attachments?: boolean;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/shared/config.d.ts
|
|
12
|
+
interface PlaywrightOpentelemetryConfig {
|
|
13
|
+
otlpEndpoint?: string;
|
|
14
|
+
otlpHeaders?: Record<string, string>;
|
|
15
|
+
playwrightTraceApiEndpoint?: string;
|
|
16
|
+
playwrightTraceApiHeaders?: Record<string, string>;
|
|
17
|
+
storeTraceZip?: boolean;
|
|
18
|
+
trace?: PlaywrightTraceOption;
|
|
19
|
+
propagateTraceHeaders?: boolean;
|
|
20
|
+
serviceName?: string;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface PlaywrightOpentelemetryUseOptions {
|
|
24
|
+
playwrightOpentelemetry?: PlaywrightOpentelemetryConfig;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { PlaywrightOpentelemetryUseOptions as n, PlaywrightTraceOption as r, PlaywrightOpentelemetryConfig as t };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/shared/playwright-trace.d.ts
|
|
2
|
+
type PlaywrightTraceMode = "off" | "on" | "retain-on-failure" | "on-first-retry" | "on-all-retries" | "retain-on-first-failure" | "retain-on-failure-and-retries";
|
|
3
|
+
type PlaywrightTraceOption = PlaywrightTraceMode | "retry-with-trace" | {
|
|
4
|
+
mode: PlaywrightTraceMode;
|
|
5
|
+
snapshots?: boolean;
|
|
6
|
+
screenshots?: boolean;
|
|
7
|
+
sources?: boolean;
|
|
8
|
+
attachments?: boolean;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/shared/config.d.ts
|
|
12
|
+
interface PlaywrightOpentelemetryConfig {
|
|
13
|
+
otlpEndpoint?: string;
|
|
14
|
+
otlpHeaders?: Record<string, string>;
|
|
15
|
+
playwrightTraceApiEndpoint?: string;
|
|
16
|
+
playwrightTraceApiHeaders?: Record<string, string>;
|
|
17
|
+
storeTraceZip?: boolean;
|
|
18
|
+
trace?: PlaywrightTraceOption;
|
|
19
|
+
propagateTraceHeaders?: boolean;
|
|
20
|
+
serviceName?: string;
|
|
21
|
+
debug?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface PlaywrightOpentelemetryUseOptions {
|
|
24
|
+
playwrightOpentelemetry?: PlaywrightOpentelemetryConfig;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { PlaywrightOpentelemetryUseOptions as n, PlaywrightTraceOption as r, PlaywrightOpentelemetryConfig as t };
|
package/dist/fixture/factory.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_playwright_opentelemetry_fixture = require("../playwright-opentelemetry-fixture-
|
|
2
|
+
const require_playwright_opentelemetry_fixture = require("../playwright-opentelemetry-fixture-BBMxdNJV.cjs");
|
|
3
3
|
exports.createPlaywrightOtelTest = require_playwright_opentelemetry_fixture.createPlaywrightOtelTest;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlaywrightOtelTest } from "../playwright-opentelemetry-fixture-
|
|
1
|
+
import { t as createPlaywrightOtelTest } from "../playwright-opentelemetry-fixture-Dx53ybJd.cjs";
|
|
2
2
|
export { createPlaywrightOtelTest };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlaywrightOtelTest } from "../playwright-opentelemetry-fixture-
|
|
1
|
+
import { t as createPlaywrightOtelTest } from "../playwright-opentelemetry-fixture-xHcfAc5d.mjs";
|
|
2
2
|
export { createPlaywrightOtelTest };
|
package/dist/fixture/factory.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createPlaywrightOtelTest } from "../playwright-opentelemetry-fixture-
|
|
1
|
+
import { t as createPlaywrightOtelTest } from "../playwright-opentelemetry-fixture-fBGMe1bl.mjs";
|
|
2
2
|
export { createPlaywrightOtelTest };
|
package/dist/fixture.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_playwright_opentelemetry_fixture = require("./playwright-opentelemetry-fixture-
|
|
2
|
+
const require_playwright_opentelemetry_fixture = require("./playwright-opentelemetry-fixture-BBMxdNJV.cjs");
|
|
3
3
|
let _playwright_test = require("@playwright/test");
|
|
4
4
|
//#region src/fixture/index.ts
|
|
5
5
|
const test = require_playwright_opentelemetry_fixture.createPlaywrightOtelTest(_playwright_test.test);
|
package/dist/fixture.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as PlaywrightOpentelemetryUseOptions, t as PlaywrightOpentelemetryConfig } from "./config-
|
|
2
|
-
import { n as BrowserPageTracker, r as TestTraceContext, t as createPlaywrightOtelTest } from "./playwright-opentelemetry-fixture-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions, r as PlaywrightTraceOption, t as PlaywrightOpentelemetryConfig } from "./config-Db932l_s.cjs";
|
|
2
|
+
import { n as BrowserPageTracker, r as TestTraceContext, t as createPlaywrightOtelTest } from "./playwright-opentelemetry-fixture-Dx53ybJd.cjs";
|
|
3
3
|
export * from "@playwright/test";
|
|
4
4
|
|
|
5
5
|
//#region src/fixture/index.d.ts
|
|
@@ -14,4 +14,4 @@ declare const test: import("@playwright/test").TestType<import("@playwright/test
|
|
|
14
14
|
_playwrightOpentelemetryReporterCheck: void;
|
|
15
15
|
}>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, createPlaywrightOtelTest, test };
|
|
17
|
+
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, type PlaywrightTraceOption, createPlaywrightOtelTest, test };
|
package/dist/fixture.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as PlaywrightOpentelemetryUseOptions, t as PlaywrightOpentelemetryConfig } from "./config-
|
|
2
|
-
import { n as BrowserPageTracker, r as TestTraceContext, t as createPlaywrightOtelTest } from "./playwright-opentelemetry-fixture-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions, r as PlaywrightTraceOption, t as PlaywrightOpentelemetryConfig } from "./config-Db932l_s.mjs";
|
|
2
|
+
import { n as BrowserPageTracker, r as TestTraceContext, t as createPlaywrightOtelTest } from "./playwright-opentelemetry-fixture-xHcfAc5d.mjs";
|
|
3
3
|
export * from "@playwright/test";
|
|
4
4
|
|
|
5
5
|
//#region src/fixture/index.d.ts
|
|
@@ -14,4 +14,4 @@ declare const test: import("@playwright/test").TestType<import("@playwright/test
|
|
|
14
14
|
_playwrightOpentelemetryReporterCheck: void;
|
|
15
15
|
}>;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, createPlaywrightOtelTest, test };
|
|
17
|
+
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, type PlaywrightTraceOption, createPlaywrightOtelTest, test };
|
package/dist/fixture.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createPlaywrightOtelTest } from "./playwright-opentelemetry-fixture-
|
|
1
|
+
import { t as createPlaywrightOtelTest } from "./playwright-opentelemetry-fixture-fBGMe1bl.mjs";
|
|
2
2
|
import { test as test$1 } from "@playwright/test";
|
|
3
3
|
export * from "@playwright/test";
|
|
4
4
|
//#region src/fixture/index.ts
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as PlaywrightOpentelemetryUseOptions, t as PlaywrightOpentelemetryConfig } from "./config-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions, r as PlaywrightTraceOption, t as PlaywrightOpentelemetryConfig } from "./config-Db932l_s.cjs";
|
|
2
2
|
import { t as PlaywrightOpentelemetryReporter } from "./reporter-DaCojFom.cjs";
|
|
3
|
-
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, PlaywrightOpentelemetryReporter as default };
|
|
3
|
+
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, type PlaywrightTraceOption, PlaywrightOpentelemetryReporter as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as PlaywrightOpentelemetryUseOptions, t as PlaywrightOpentelemetryConfig } from "./config-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions, r as PlaywrightTraceOption, t as PlaywrightOpentelemetryConfig } from "./config-Db932l_s.mjs";
|
|
2
2
|
import { t as PlaywrightOpentelemetryReporter } from "./reporter-DaCojFom.mjs";
|
|
3
|
-
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, PlaywrightOpentelemetryReporter as default };
|
|
3
|
+
export { type PlaywrightOpentelemetryConfig, type PlaywrightOpentelemetryUseOptions, type PlaywrightTraceOption, PlaywrightOpentelemetryReporter as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_config = require("./config-
|
|
1
|
+
const require_config = require("./config-Cc1BZNAB.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_config.__toESM(node_path, 1);
|
|
4
4
|
//#region src/fixture/browser-page-tracker.ts
|
|
@@ -412,11 +412,14 @@ function createPlaywrightOtelTest(testBase) {
|
|
|
412
412
|
outputDir
|
|
413
413
|
});
|
|
414
414
|
}, { auto: true }],
|
|
415
|
-
testTraceContext: [async ({ playwrightOpentelemetry }, use, testInfo) => {
|
|
415
|
+
testTraceContext: [async ({ playwrightOpentelemetry, trace }, use, testInfo) => {
|
|
416
416
|
const config = require_config.resolvePlaywrightOpentelemetryConfig(playwrightOpentelemetry);
|
|
417
417
|
const traceContext = await require_config.createTestTraceContext(testInfo);
|
|
418
418
|
await use(traceContext);
|
|
419
|
-
await require_config.flushFixtureSpans(traceContext, config,
|
|
419
|
+
await require_config.flushFixtureSpans(traceContext, config, {
|
|
420
|
+
trace: config.trace ?? trace,
|
|
421
|
+
testInfo
|
|
422
|
+
});
|
|
420
423
|
}, { auto: true }],
|
|
421
424
|
browserPageTracker: [async ({ testTraceContext }, use) => {
|
|
422
425
|
const tracker = new BrowserPageTracker(testTraceContext);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PlaywrightOpentelemetryUseOptions } from "./config-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions } from "./config-Db932l_s.cjs";
|
|
2
2
|
import { n as SpanEvent, t as Span } from "./otel-D0ztpic2.cjs";
|
|
3
3
|
import { ConsoleMessage, Page, Request, test } from "@playwright/test";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as flushFixtureSpans,
|
|
1
|
+
import { a as flushFixtureSpans, c as generateSpanId, i as createTestTraceContext, t as resolvePlaywrightOpentelemetryConfig } from "./config-BltzmZgg.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region src/fixture/browser-page-tracker.ts
|
|
4
4
|
const BROWSER_PAGE_SPAN_NAME = "browser.page";
|
|
@@ -411,11 +411,14 @@ function createPlaywrightOtelTest(testBase) {
|
|
|
411
411
|
outputDir
|
|
412
412
|
});
|
|
413
413
|
}, { auto: true }],
|
|
414
|
-
testTraceContext: [async ({ playwrightOpentelemetry }, use, testInfo) => {
|
|
414
|
+
testTraceContext: [async ({ playwrightOpentelemetry, trace }, use, testInfo) => {
|
|
415
415
|
const config = resolvePlaywrightOpentelemetryConfig(playwrightOpentelemetry);
|
|
416
416
|
const traceContext = await createTestTraceContext(testInfo);
|
|
417
417
|
await use(traceContext);
|
|
418
|
-
await flushFixtureSpans(traceContext, config,
|
|
418
|
+
await flushFixtureSpans(traceContext, config, {
|
|
419
|
+
trace: config.trace ?? trace,
|
|
420
|
+
testInfo
|
|
421
|
+
});
|
|
419
422
|
}, { auto: true }],
|
|
420
423
|
browserPageTracker: [async ({ testTraceContext }, use) => {
|
|
421
424
|
const tracker = new BrowserPageTracker(testTraceContext);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as PlaywrightOpentelemetryUseOptions } from "./config-
|
|
1
|
+
import { n as PlaywrightOpentelemetryUseOptions } from "./config-Db932l_s.mjs";
|
|
2
2
|
import { n as SpanEvent, t as Span } from "./otel-D0ztpic2.mjs";
|
|
3
3
|
import { ConsoleMessage, Page, Request, test } from "@playwright/test";
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as generateSpanId, l as generateTraceId, n as FIXTURE_SPANS_ATTACHMENT_NAME, o as shouldRetainPlaywrightTrace, r as TRACE_CONTEXT_ATTACHMENT_NAME, s as buildOtlpRequest, t as resolvePlaywrightOpentelemetryConfig, u as sendSpans } from "./config-BltzmZgg.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
|
-
import { BlobReader, BlobWriter, ZipReader, ZipWriter } from "@zip.js/zip.js";
|
|
4
|
+
import { BlobReader, BlobWriter, TextWriter, ZipReader, ZipWriter } from "@zip.js/zip.js";
|
|
5
5
|
//#region src/reporter/otel-attributes.ts
|
|
6
6
|
const ATTR_CODE_FILE_PATH = "code.file.path";
|
|
7
7
|
const ATTR_CODE_LINE_NUMBER = "code.line.number";
|
|
@@ -38,7 +38,7 @@ const PLAYWRIGHT_SCREENSHOT_PATTERN = /^.+@[a-f0-9]+-\d+\.jpe?g$/i;
|
|
|
38
38
|
* {pageGuid}-{timestamp}.jpeg (e.g., page@abc123-1766929201038.jpeg)
|
|
39
39
|
*
|
|
40
40
|
* @param traceZipPath - Path to the Playwright trace.zip file
|
|
41
|
-
* @returns Map of filename (without resources/ prefix) to
|
|
41
|
+
* @returns Map of filename (without resources/ prefix) to screenshot resources
|
|
42
42
|
*/
|
|
43
43
|
async function extractScreenshotsFromPlaywrightTrace(traceZipPath) {
|
|
44
44
|
const screenshots = /* @__PURE__ */ new Map();
|
|
@@ -46,6 +46,7 @@ async function extractScreenshotsFromPlaywrightTrace(traceZipPath) {
|
|
|
46
46
|
const zipBuffer = await fs.readFile(traceZipPath);
|
|
47
47
|
const zipReader = new ZipReader(new BlobReader(new Blob([zipBuffer])));
|
|
48
48
|
const entries = await zipReader.getEntries();
|
|
49
|
+
const screenshotMetadata = await extractScreenshotTraceMetadata(entries);
|
|
49
50
|
await Promise.all(entries.filter((entry) => {
|
|
50
51
|
if (!isFileEntry(entry)) return false;
|
|
51
52
|
if (!entry.filename.startsWith(PLAYWRIGHT_TRACE_RESOURCES_DIR)) return false;
|
|
@@ -54,7 +55,15 @@ async function extractScreenshotsFromPlaywrightTrace(traceZipPath) {
|
|
|
54
55
|
}).map(async (entry) => {
|
|
55
56
|
const filename = entry.filename.slice(10);
|
|
56
57
|
const blob = await entry.getData(new BlobWriter("image/jpeg"));
|
|
57
|
-
|
|
58
|
+
const metadata = screenshotMetadata.get(filename);
|
|
59
|
+
screenshots.set(filename, {
|
|
60
|
+
blob,
|
|
61
|
+
file: filename,
|
|
62
|
+
timestamp: extractTimestampFromFilename(filename),
|
|
63
|
+
contentType: getMimeType(filename),
|
|
64
|
+
contextId: metadata?.contextId ?? "unknown-context",
|
|
65
|
+
pageId: metadata?.pageId ?? extractResourceIdFromFilename(filename)
|
|
66
|
+
});
|
|
58
67
|
}));
|
|
59
68
|
await zipReader.close();
|
|
60
69
|
} catch (err) {
|
|
@@ -89,25 +98,65 @@ async function writeTraceZip(outputDir, test, zipBlob) {
|
|
|
89
98
|
async function addScreenshotsToZip(zipWriter, screenshots) {
|
|
90
99
|
const manifest = createScreenshotManifest(screenshots);
|
|
91
100
|
await zipWriter.add("manifest.json", new Blob([JSON.stringify(manifest, null, 2)], { type: "application/json" }).stream());
|
|
92
|
-
for (const [filename,
|
|
101
|
+
for (const [filename, screenshot] of screenshots.entries()) await zipWriter.add(`screenshots/${filename}`, screenshot.blob.stream());
|
|
93
102
|
}
|
|
94
103
|
function createScreenshotManifest(screenshots) {
|
|
95
104
|
return {
|
|
96
|
-
version:
|
|
97
|
-
screenshots: Array.from(screenshots.
|
|
98
|
-
timestamp:
|
|
99
|
-
file:
|
|
100
|
-
path: `screenshots/${
|
|
101
|
-
contentType:
|
|
105
|
+
version: 2,
|
|
106
|
+
screenshots: Array.from(screenshots.values()).map((screenshot) => ({
|
|
107
|
+
timestamp: screenshot.timestamp,
|
|
108
|
+
file: screenshot.file,
|
|
109
|
+
path: `screenshots/${screenshot.file}`,
|
|
110
|
+
contentType: screenshot.contentType,
|
|
111
|
+
contextId: screenshot.contextId,
|
|
112
|
+
pageId: screenshot.pageId
|
|
102
113
|
})).sort((a, b) => a.timestamp - b.timestamp)
|
|
103
114
|
};
|
|
104
115
|
}
|
|
116
|
+
async function extractScreenshotTraceMetadata(entries) {
|
|
117
|
+
const metadata = /* @__PURE__ */ new Map();
|
|
118
|
+
const traceEntries = entries.filter((entry) => isFileEntry(entry) && isPlaywrightTraceEntry(entry.filename));
|
|
119
|
+
await Promise.all(traceEntries.map(async (entry) => {
|
|
120
|
+
const text = await entry.getData(new TextWriter());
|
|
121
|
+
let contextId = "unknown-context";
|
|
122
|
+
for (const line of text.split("\n")) {
|
|
123
|
+
if (!line.trim()) continue;
|
|
124
|
+
const event = parseTraceEvent(line);
|
|
125
|
+
if (!event) continue;
|
|
126
|
+
if (event.type === "context-options" && typeof event.contextId === "string") {
|
|
127
|
+
contextId = event.contextId;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (event.type === "screencast-frame" && typeof event.sha1 === "string" && typeof event.pageId === "string") metadata.set(event.sha1, {
|
|
131
|
+
contextId,
|
|
132
|
+
pageId: event.pageId
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}));
|
|
136
|
+
return metadata;
|
|
137
|
+
}
|
|
138
|
+
function isPlaywrightTraceEntry(filename) {
|
|
139
|
+
return filename === "trace.trace" || filename.endsWith("-trace.trace");
|
|
140
|
+
}
|
|
141
|
+
function parseTraceEvent(line) {
|
|
142
|
+
try {
|
|
143
|
+
const value = JSON.parse(line);
|
|
144
|
+
return typeof value === "object" && value !== null ? value : void 0;
|
|
145
|
+
} catch {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
105
149
|
function extractTimestampFromFilename(filename) {
|
|
106
150
|
const lastDashIndex = filename.lastIndexOf("-");
|
|
107
151
|
if (lastDashIndex === -1) return 0;
|
|
108
152
|
const timestamp = Number.parseInt(filename.slice(lastDashIndex + 1).replace(/\.[^.]+$/, ""), 10);
|
|
109
153
|
return Number.isNaN(timestamp) ? 0 : timestamp;
|
|
110
154
|
}
|
|
155
|
+
function extractResourceIdFromFilename(filename) {
|
|
156
|
+
const lastDashIndex = filename.lastIndexOf("-");
|
|
157
|
+
if (lastDashIndex === -1) return "unknown-page";
|
|
158
|
+
return filename.slice(0, lastDashIndex) || "unknown-page";
|
|
159
|
+
}
|
|
111
160
|
function getMimeType(filename) {
|
|
112
161
|
switch (filename.split(".").pop()?.toLowerCase()) {
|
|
113
162
|
case "png": return "image/png";
|
|
@@ -142,11 +191,16 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
142
191
|
onStepBegin(_test, _result, _step) {}
|
|
143
192
|
onStepEnd(_test, _result, _step) {}
|
|
144
193
|
onTestEnd(test, result) {
|
|
194
|
+
const config = getTestConfig(test);
|
|
195
|
+
const traceAttachment = result.attachments.find((attachment) => attachment.name === "trace" && attachment.contentType === "application/zip" && attachment.path);
|
|
196
|
+
if (!(config.trace === null ? Boolean(traceAttachment) : shouldRetainPlaywrightTrace(config.trace, {
|
|
197
|
+
expectedStatus: test.expectedStatus,
|
|
198
|
+
retry: result.retry,
|
|
199
|
+
status: result.status
|
|
200
|
+
}))) return;
|
|
145
201
|
const testId = test.id;
|
|
146
202
|
const outputDir = getTestOutputDir(test);
|
|
147
|
-
const config = getTestConfig(test);
|
|
148
203
|
const { traceId, rootSpanId: testSpanId } = readTraceContextAttachment(result, testId);
|
|
149
|
-
const traceAttachment = result.attachments.find((attachment) => attachment.name === "trace" && attachment.contentType === "application/zip" && attachment.path);
|
|
150
204
|
const fixtureSpans = config.storeTraceZip ? readFixtureSpansAttachment(result, testId) : [];
|
|
151
205
|
result.attachments.push({
|
|
152
206
|
name: "playwright-opentelemetry-trace-id",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_config = require("./config-
|
|
1
|
+
const require_config = require("./config-Cc1BZNAB.cjs");
|
|
2
2
|
let node_path = require("node:path");
|
|
3
3
|
node_path = require_config.__toESM(node_path, 1);
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -40,7 +40,7 @@ const PLAYWRIGHT_SCREENSHOT_PATTERN = /^.+@[a-f0-9]+-\d+\.jpe?g$/i;
|
|
|
40
40
|
* {pageGuid}-{timestamp}.jpeg (e.g., page@abc123-1766929201038.jpeg)
|
|
41
41
|
*
|
|
42
42
|
* @param traceZipPath - Path to the Playwright trace.zip file
|
|
43
|
-
* @returns Map of filename (without resources/ prefix) to
|
|
43
|
+
* @returns Map of filename (without resources/ prefix) to screenshot resources
|
|
44
44
|
*/
|
|
45
45
|
async function extractScreenshotsFromPlaywrightTrace(traceZipPath) {
|
|
46
46
|
const screenshots = /* @__PURE__ */ new Map();
|
|
@@ -48,6 +48,7 @@ async function extractScreenshotsFromPlaywrightTrace(traceZipPath) {
|
|
|
48
48
|
const zipBuffer = await node_fs_promises.default.readFile(traceZipPath);
|
|
49
49
|
const zipReader = new _zip_js_zip_js.ZipReader(new _zip_js_zip_js.BlobReader(new Blob([zipBuffer])));
|
|
50
50
|
const entries = await zipReader.getEntries();
|
|
51
|
+
const screenshotMetadata = await extractScreenshotTraceMetadata(entries);
|
|
51
52
|
await Promise.all(entries.filter((entry) => {
|
|
52
53
|
if (!isFileEntry(entry)) return false;
|
|
53
54
|
if (!entry.filename.startsWith(PLAYWRIGHT_TRACE_RESOURCES_DIR)) return false;
|
|
@@ -56,7 +57,15 @@ async function extractScreenshotsFromPlaywrightTrace(traceZipPath) {
|
|
|
56
57
|
}).map(async (entry) => {
|
|
57
58
|
const filename = entry.filename.slice(10);
|
|
58
59
|
const blob = await entry.getData(new _zip_js_zip_js.BlobWriter("image/jpeg"));
|
|
59
|
-
|
|
60
|
+
const metadata = screenshotMetadata.get(filename);
|
|
61
|
+
screenshots.set(filename, {
|
|
62
|
+
blob,
|
|
63
|
+
file: filename,
|
|
64
|
+
timestamp: extractTimestampFromFilename(filename),
|
|
65
|
+
contentType: getMimeType(filename),
|
|
66
|
+
contextId: metadata?.contextId ?? "unknown-context",
|
|
67
|
+
pageId: metadata?.pageId ?? extractResourceIdFromFilename(filename)
|
|
68
|
+
});
|
|
60
69
|
}));
|
|
61
70
|
await zipReader.close();
|
|
62
71
|
} catch (err) {
|
|
@@ -91,25 +100,65 @@ async function writeTraceZip(outputDir, test, zipBlob) {
|
|
|
91
100
|
async function addScreenshotsToZip(zipWriter, screenshots) {
|
|
92
101
|
const manifest = createScreenshotManifest(screenshots);
|
|
93
102
|
await zipWriter.add("manifest.json", new Blob([JSON.stringify(manifest, null, 2)], { type: "application/json" }).stream());
|
|
94
|
-
for (const [filename,
|
|
103
|
+
for (const [filename, screenshot] of screenshots.entries()) await zipWriter.add(`screenshots/${filename}`, screenshot.blob.stream());
|
|
95
104
|
}
|
|
96
105
|
function createScreenshotManifest(screenshots) {
|
|
97
106
|
return {
|
|
98
|
-
version:
|
|
99
|
-
screenshots: Array.from(screenshots.
|
|
100
|
-
timestamp:
|
|
101
|
-
file:
|
|
102
|
-
path: `screenshots/${
|
|
103
|
-
contentType:
|
|
107
|
+
version: 2,
|
|
108
|
+
screenshots: Array.from(screenshots.values()).map((screenshot) => ({
|
|
109
|
+
timestamp: screenshot.timestamp,
|
|
110
|
+
file: screenshot.file,
|
|
111
|
+
path: `screenshots/${screenshot.file}`,
|
|
112
|
+
contentType: screenshot.contentType,
|
|
113
|
+
contextId: screenshot.contextId,
|
|
114
|
+
pageId: screenshot.pageId
|
|
104
115
|
})).sort((a, b) => a.timestamp - b.timestamp)
|
|
105
116
|
};
|
|
106
117
|
}
|
|
118
|
+
async function extractScreenshotTraceMetadata(entries) {
|
|
119
|
+
const metadata = /* @__PURE__ */ new Map();
|
|
120
|
+
const traceEntries = entries.filter((entry) => isFileEntry(entry) && isPlaywrightTraceEntry(entry.filename));
|
|
121
|
+
await Promise.all(traceEntries.map(async (entry) => {
|
|
122
|
+
const text = await entry.getData(new _zip_js_zip_js.TextWriter());
|
|
123
|
+
let contextId = "unknown-context";
|
|
124
|
+
for (const line of text.split("\n")) {
|
|
125
|
+
if (!line.trim()) continue;
|
|
126
|
+
const event = parseTraceEvent(line);
|
|
127
|
+
if (!event) continue;
|
|
128
|
+
if (event.type === "context-options" && typeof event.contextId === "string") {
|
|
129
|
+
contextId = event.contextId;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
if (event.type === "screencast-frame" && typeof event.sha1 === "string" && typeof event.pageId === "string") metadata.set(event.sha1, {
|
|
133
|
+
contextId,
|
|
134
|
+
pageId: event.pageId
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}));
|
|
138
|
+
return metadata;
|
|
139
|
+
}
|
|
140
|
+
function isPlaywrightTraceEntry(filename) {
|
|
141
|
+
return filename === "trace.trace" || filename.endsWith("-trace.trace");
|
|
142
|
+
}
|
|
143
|
+
function parseTraceEvent(line) {
|
|
144
|
+
try {
|
|
145
|
+
const value = JSON.parse(line);
|
|
146
|
+
return typeof value === "object" && value !== null ? value : void 0;
|
|
147
|
+
} catch {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
107
151
|
function extractTimestampFromFilename(filename) {
|
|
108
152
|
const lastDashIndex = filename.lastIndexOf("-");
|
|
109
153
|
if (lastDashIndex === -1) return 0;
|
|
110
154
|
const timestamp = Number.parseInt(filename.slice(lastDashIndex + 1).replace(/\.[^.]+$/, ""), 10);
|
|
111
155
|
return Number.isNaN(timestamp) ? 0 : timestamp;
|
|
112
156
|
}
|
|
157
|
+
function extractResourceIdFromFilename(filename) {
|
|
158
|
+
const lastDashIndex = filename.lastIndexOf("-");
|
|
159
|
+
if (lastDashIndex === -1) return "unknown-page";
|
|
160
|
+
return filename.slice(0, lastDashIndex) || "unknown-page";
|
|
161
|
+
}
|
|
113
162
|
function getMimeType(filename) {
|
|
114
163
|
switch (filename.split(".").pop()?.toLowerCase()) {
|
|
115
164
|
case "png": return "image/png";
|
|
@@ -144,11 +193,16 @@ var PlaywrightOpentelemetryReporter = class {
|
|
|
144
193
|
onStepBegin(_test, _result, _step) {}
|
|
145
194
|
onStepEnd(_test, _result, _step) {}
|
|
146
195
|
onTestEnd(test, result) {
|
|
196
|
+
const config = getTestConfig(test);
|
|
197
|
+
const traceAttachment = result.attachments.find((attachment) => attachment.name === "trace" && attachment.contentType === "application/zip" && attachment.path);
|
|
198
|
+
if (!(config.trace === null ? Boolean(traceAttachment) : require_config.shouldRetainPlaywrightTrace(config.trace, {
|
|
199
|
+
expectedStatus: test.expectedStatus,
|
|
200
|
+
retry: result.retry,
|
|
201
|
+
status: result.status
|
|
202
|
+
}))) return;
|
|
147
203
|
const testId = test.id;
|
|
148
204
|
const outputDir = getTestOutputDir(test);
|
|
149
|
-
const config = getTestConfig(test);
|
|
150
205
|
const { traceId, rootSpanId: testSpanId } = readTraceContextAttachment(result, testId);
|
|
151
|
-
const traceAttachment = result.attachments.find((attachment) => attachment.name === "trace" && attachment.contentType === "application/zip" && attachment.path);
|
|
152
206
|
const fixtureSpans = config.storeTraceZip ? readFixtureSpansAttachment(result, testId) : [];
|
|
153
207
|
result.attachments.push({
|
|
154
208
|
name: "playwright-opentelemetry-trace-id",
|
package/dist/reporter.cjs
CHANGED
package/dist/reporter.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "playwright-opentelemetry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "A reporter for Playwright that can export traces and spans in opentelemetry format.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@biomejs/biome": "2.4.16",
|
|
64
|
-
"@playwright/test": "1.
|
|
64
|
+
"@playwright/test": "1.61.0",
|
|
65
65
|
"@types/bun": "^1.3.14",
|
|
66
66
|
"@types/node": "^25.9.1",
|
|
67
67
|
"tsdown": "^0.22.1"
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/shared/config.d.ts
|
|
2
|
-
interface PlaywrightOpentelemetryConfig {
|
|
3
|
-
otlpEndpoint?: string;
|
|
4
|
-
otlpHeaders?: Record<string, string>;
|
|
5
|
-
playwrightTraceApiEndpoint?: string;
|
|
6
|
-
playwrightTraceApiHeaders?: Record<string, string>;
|
|
7
|
-
storeTraceZip?: boolean;
|
|
8
|
-
propagateTraceHeaders?: boolean;
|
|
9
|
-
serviceName?: string;
|
|
10
|
-
debug?: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface PlaywrightOpentelemetryUseOptions {
|
|
13
|
-
playwrightOpentelemetry?: PlaywrightOpentelemetryConfig;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { PlaywrightOpentelemetryUseOptions as n, PlaywrightOpentelemetryConfig as t };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region src/shared/config.d.ts
|
|
2
|
-
interface PlaywrightOpentelemetryConfig {
|
|
3
|
-
otlpEndpoint?: string;
|
|
4
|
-
otlpHeaders?: Record<string, string>;
|
|
5
|
-
playwrightTraceApiEndpoint?: string;
|
|
6
|
-
playwrightTraceApiHeaders?: Record<string, string>;
|
|
7
|
-
storeTraceZip?: boolean;
|
|
8
|
-
propagateTraceHeaders?: boolean;
|
|
9
|
-
serviceName?: string;
|
|
10
|
-
debug?: boolean;
|
|
11
|
-
}
|
|
12
|
-
interface PlaywrightOpentelemetryUseOptions {
|
|
13
|
-
playwrightOpentelemetry?: PlaywrightOpentelemetryConfig;
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
|
-
export { PlaywrightOpentelemetryUseOptions as n, PlaywrightOpentelemetryConfig as t };
|