@gate-forge/pack-playwright 0.13.7 → 0.13.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/discovery/discover.d.ts.map +1 -1
- package/dist/discovery/discover.js +141 -39
- package/dist/discovery/discover.js.map +1 -1
- package/dist/discovery/index.d.ts +1 -0
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +1 -0
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/inference.d.ts.map +1 -1
- package/dist/discovery/inference.js +2 -9
- package/dist/discovery/inference.js.map +1 -1
- package/dist/discovery/reconcile.d.ts +8 -0
- package/dist/discovery/reconcile.d.ts.map +1 -1
- package/dist/discovery/reconcile.js +11 -0
- package/dist/discovery/reconcile.js.map +1 -1
- package/dist/discovery/serial-scopes.d.ts +76 -0
- package/dist/discovery/serial-scopes.d.ts.map +1 -0
- package/dist/discovery/serial-scopes.js +244 -0
- package/dist/discovery/serial-scopes.js.map +1 -0
- package/dist/discovery/static-discovery.d.ts +34 -16
- package/dist/discovery/static-discovery.d.ts.map +1 -1
- package/dist/discovery/static-discovery.js +1025 -78
- package/dist/discovery/static-discovery.js.map +1 -1
- package/dist/discovery/supervised-run.d.ts +6 -0
- package/dist/discovery/supervised-run.d.ts.map +1 -1
- package/dist/discovery/supervised-run.js +1 -0
- package/dist/discovery/supervised-run.js.map +1 -1
- package/dist/discovery/trusted-config.d.ts +6 -0
- package/dist/discovery/trusted-config.d.ts.map +1 -1
- package/dist/discovery/trusted-config.js +5 -1
- package/dist/discovery/trusted-config.js.map +1 -1
- package/dist/fixture/api-request.d.ts +15 -102
- package/dist/fixture/api-request.d.ts.map +1 -1
- package/dist/fixture/api-request.js +27 -101
- package/dist/fixture/api-request.js.map +1 -1
- package/dist/fixture/fixture.d.ts +16 -25
- package/dist/fixture/fixture.d.ts.map +1 -1
- package/dist/fixture/fixture.js +184 -66
- package/dist/fixture/fixture.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/reporter/project-graph-reporter.d.ts +11 -1
- package/dist/reporter/project-graph-reporter.d.ts.map +1 -1
- package/dist/reporter/project-graph-reporter.js +16 -0
- package/dist/reporter/project-graph-reporter.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,111 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* proxy never sees their exchanges and their endpoint traffic could
|
|
8
|
-
* never be witnessed. This module wraps an APIRequestContext so every
|
|
9
|
-
* call whose resolved URL carries the app origin is rehosted onto the
|
|
10
|
-
* test's session proxy: the SAME host swap `routePageThroughSessionProxy`
|
|
11
|
-
* performs (path, query, headers and body untouched). Every other origin
|
|
12
|
-
* passes through raw; a non-app origin that is still plausibly the app
|
|
13
|
-
* (the app base's own host, or loopback) is reported through the same
|
|
14
|
-
* unrouted-origin reporter the page channel uses.
|
|
15
|
-
*
|
|
16
|
-
* The wrapper is an explicit object implementing APIRequestContext's
|
|
17
|
-
* request methods with `dispose`/`storageState` passthrough — no Proxy,
|
|
18
|
-
* so types stay honest. One honest limitation: a `Request` OBJECT target
|
|
19
|
-
* (`context.fetch(request)`) cannot be rehosted (no public constructor);
|
|
20
|
-
* it passes through untouched, exactly like a foreign origin.
|
|
2
|
+
* Request-fixture and `request.newContext()` calls go directly to the app
|
|
3
|
+
* and are reported only as run-scoped diagnostics; they never pass through
|
|
4
|
+
* the session proxy or satisfy E2E claims. `page.request` and
|
|
5
|
+
* `context.request` stay untouched because Playwright's `Route.fetch` uses
|
|
6
|
+
* the context request internally to forward browser traffic.
|
|
21
7
|
*/
|
|
22
|
-
import type {
|
|
23
|
-
/**
|
|
24
|
-
export interface
|
|
25
|
-
|
|
26
|
-
sessionOrigin: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Validates the origin pair exactly like the page channel's own rule:
|
|
30
|
-
* both must be plain http and share the same (loopback) host — the swap
|
|
31
|
-
* is a port swap, never a host change.
|
|
32
|
-
*
|
|
33
|
-
* Args:
|
|
34
|
-
* appBaseURL: the configured app origin (GATEFORGE_APP_BASE_URL).
|
|
35
|
-
* sessionProxyURL: the supervisor-issued session proxy origin.
|
|
36
|
-
*
|
|
37
|
-
* Returns:
|
|
38
|
-
* SessionApiRouting: the parsed, validated pair.
|
|
39
|
-
*/
|
|
40
|
-
export declare function sessionApiRouting(appBaseURL: string, sessionProxyURL: string): SessionApiRouting;
|
|
41
|
-
/** Loopback in the three forms a browser URL can carry it. */
|
|
42
|
-
export declare function isLoopbackHostname(hostname: string): boolean;
|
|
43
|
-
/** What the wrapper decided about one call URL. */
|
|
44
|
-
export interface ApiRewrite {
|
|
45
|
-
/** The URL to hand the underlying context (raw for non-app origins). */
|
|
8
|
+
import type { APIRequestContext } from 'playwright';
|
|
9
|
+
/** An app-origin API call made directly from a test-code request context. */
|
|
10
|
+
export interface DirectExchange {
|
|
11
|
+
method: string;
|
|
46
12
|
url: string;
|
|
47
|
-
|
|
48
|
-
routed: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* For a non-app origin that is still plausibly the app (the app base's
|
|
51
|
-
* own host or loopback): the origin, for the unrouted-origin report.
|
|
52
|
-
* Null for the app origin itself and for foreign origins.
|
|
53
|
-
*/
|
|
54
|
-
mismatchedOrigin: string | null;
|
|
13
|
+
status: number;
|
|
55
14
|
}
|
|
56
|
-
|
|
57
|
-
* Resolves one call URL against the context base URL (or the app origin
|
|
58
|
-
* when none is known) and rehosts it when it carries the app origin.
|
|
59
|
-
* Non-app URLs come back RAW so the underlying context's own base URL
|
|
60
|
-
* semantics keep applying to relative foreign paths.
|
|
61
|
-
*
|
|
62
|
-
* Args:
|
|
63
|
-
* rawUrl: the URL exactly as the test passed it.
|
|
64
|
-
* baseURL: the context's base URL (project `use.baseURL`), if known.
|
|
65
|
-
* routing: the validated session routing.
|
|
66
|
-
*
|
|
67
|
-
* Returns:
|
|
68
|
-
* ApiRewrite: the URL to send, the routing verdict, and any mismatch.
|
|
69
|
-
*/
|
|
70
|
-
export declare function rewriteApiUrl(rawUrl: string, baseURL: string | undefined, routing: SessionApiRouting): ApiRewrite;
|
|
71
|
-
/**
|
|
72
|
-
* A lazily-resolved routing source. Null sends every call straight to
|
|
73
|
-
* the app — that is setup traffic (module scope, worker hooks) or a
|
|
74
|
-
* session-less test, which the witness never credits.
|
|
75
|
-
*/
|
|
76
|
-
export type ApiRoutingSource = () => Promise<SessionApiRouting | null>;
|
|
77
|
-
export interface WrapApiRequestContextOptions {
|
|
78
|
-
/** Resolves relative call URLs when no better base URL is known. */
|
|
15
|
+
export interface WrapDirectRequestContextOptions {
|
|
79
16
|
baseURL?: string;
|
|
80
|
-
|
|
81
|
-
onUnroutedOrigin?: (origin: string) => void;
|
|
17
|
+
onExchange: (exchange: DirectExchange) => void;
|
|
82
18
|
}
|
|
83
19
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
* Args:
|
|
88
|
-
* underlying: the real context (the built-in `request` fixture, the
|
|
89
|
-
* page context's request, or a fresh `request.newContext()`).
|
|
90
|
-
* options: base URL for relative resolution, the routing source, and
|
|
91
|
-
* the optional unrouted-origin reporter.
|
|
92
|
-
*
|
|
93
|
-
* Returns:
|
|
94
|
-
* APIRequestContext: the explicitly wrapped context.
|
|
95
|
-
*/
|
|
96
|
-
export declare function wrapApiRequestContext(underlying: APIRequestContext, options: WrapApiRequestContextOptions): APIRequestContext;
|
|
97
|
-
/**
|
|
98
|
-
* Rehosts the owned APIRequestContext of a witnessed page's context
|
|
99
|
-
* (`page.request` and `context.request` are the SAME lazily-created
|
|
100
|
-
* object; shadowing it on the context instance covers both access
|
|
101
|
-
* paths). The underlying context is materialized first and delegated to.
|
|
102
|
-
*
|
|
103
|
-
* Args:
|
|
104
|
-
* context: the browser context of the witnessed page.
|
|
105
|
-
* options: the same arguments {@link wrapApiRequestContext} takes.
|
|
106
|
-
*
|
|
107
|
-
* Returns:
|
|
108
|
-
* void.
|
|
20
|
+
* Reports direct app-origin API calls made by test contexts. Reporting is
|
|
21
|
+
* best-effort and cannot change the underlying response.
|
|
109
22
|
*/
|
|
110
|
-
export declare function
|
|
23
|
+
export declare function wrapDirectRequestContext(underlying: APIRequestContext, options: WrapDirectRequestContextOptions): APIRequestContext;
|
|
111
24
|
//# sourceMappingURL=api-request.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-request.d.ts","sourceRoot":"","sources":["../../src/fixture/api-request.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"api-request.d.ts","sourceRoot":"","sources":["../../src/fixture/api-request.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,YAAY,CAAC;AAQjE,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,+BAA+B;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;CAChD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,+BAA+B,GACvC,iBAAiB,CAqCnB"}
|
|
@@ -1,114 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
* Validates the origin pair exactly like the page channel's own rule:
|
|
3
|
-
* both must be plain http and share the same (loopback) host — the swap
|
|
4
|
-
* is a port swap, never a host change.
|
|
5
|
-
*
|
|
6
|
-
* Args:
|
|
7
|
-
* appBaseURL: the configured app origin (GATEFORGE_APP_BASE_URL).
|
|
8
|
-
* sessionProxyURL: the supervisor-issued session proxy origin.
|
|
9
|
-
*
|
|
10
|
-
* Returns:
|
|
11
|
-
* SessionApiRouting: the parsed, validated pair.
|
|
12
|
-
*/
|
|
13
|
-
export function sessionApiRouting(appBaseURL, sessionProxyURL) {
|
|
14
|
-
const appOrigin = new URL(appBaseURL);
|
|
15
|
-
const sessionOrigin = new URL(sessionProxyURL);
|
|
16
|
-
if (appOrigin.protocol !== 'http:' ||
|
|
17
|
-
sessionOrigin.protocol !== appOrigin.protocol ||
|
|
18
|
-
sessionOrigin.hostname !== appOrigin.hostname) {
|
|
19
|
-
throw new Error('Gateforge session proxy and app base must share the same loopback HTTP host');
|
|
20
|
-
}
|
|
21
|
-
return { appOrigin: appOrigin.origin, sessionOrigin: sessionOrigin.origin };
|
|
22
|
-
}
|
|
23
|
-
/** Loopback in the three forms a browser URL can carry it. */
|
|
24
|
-
export function isLoopbackHostname(hostname) {
|
|
1
|
+
function isLoopbackHostname(hostname) {
|
|
25
2
|
return hostname === 'localhost' || hostname === '::1' || hostname === '[::1]' || /^127\./.test(hostname);
|
|
26
3
|
}
|
|
27
4
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* Non-app URLs come back RAW so the underlying context's own base URL
|
|
31
|
-
* semantics keep applying to relative foreign paths.
|
|
32
|
-
*
|
|
33
|
-
* Args:
|
|
34
|
-
* rawUrl: the URL exactly as the test passed it.
|
|
35
|
-
* baseURL: the context's base URL (project `use.baseURL`), if known.
|
|
36
|
-
* routing: the validated session routing.
|
|
37
|
-
*
|
|
38
|
-
* Returns:
|
|
39
|
-
* ApiRewrite: the URL to send, the routing verdict, and any mismatch.
|
|
40
|
-
*/
|
|
41
|
-
export function rewriteApiUrl(rawUrl, baseURL, routing) {
|
|
42
|
-
if (routing.appOrigin === routing.sessionOrigin) {
|
|
43
|
-
return { url: rawUrl, routed: false, mismatchedOrigin: null };
|
|
44
|
-
}
|
|
45
|
-
const resolved = new URL(rawUrl, baseURL ?? routing.appOrigin);
|
|
46
|
-
if (resolved.origin === routing.appOrigin) {
|
|
47
|
-
const rehosted = new URL(resolved.href);
|
|
48
|
-
rehosted.host = new URL(routing.sessionOrigin).host;
|
|
49
|
-
return { url: rehosted.href, routed: true, mismatchedOrigin: null };
|
|
50
|
-
}
|
|
51
|
-
const mismatched = resolved.hostname === new URL(routing.appOrigin).hostname || isLoopbackHostname(resolved.hostname)
|
|
52
|
-
? resolved.origin
|
|
53
|
-
: null;
|
|
54
|
-
return { url: rawUrl, routed: false, mismatchedOrigin: mismatched };
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Wraps an APIRequestContext so app-origin calls ride the session proxy.
|
|
58
|
-
* All arguments are passed through untouched; only the URL can change.
|
|
59
|
-
*
|
|
60
|
-
* Args:
|
|
61
|
-
* underlying: the real context (the built-in `request` fixture, the
|
|
62
|
-
* page context's request, or a fresh `request.newContext()`).
|
|
63
|
-
* options: base URL for relative resolution, the routing source, and
|
|
64
|
-
* the optional unrouted-origin reporter.
|
|
65
|
-
*
|
|
66
|
-
* Returns:
|
|
67
|
-
* APIRequestContext: the explicitly wrapped context.
|
|
5
|
+
* Reports direct app-origin API calls made by test contexts. Reporting is
|
|
6
|
+
* best-effort and cannot change the underlying response.
|
|
68
7
|
*/
|
|
69
|
-
export function
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
options.
|
|
8
|
+
export function wrapDirectRequestContext(underlying, options) {
|
|
9
|
+
const invoke = async (method, target, call) => {
|
|
10
|
+
const response = await call();
|
|
11
|
+
try {
|
|
12
|
+
const resolved = options.baseURL === undefined ? new URL(target) : new URL(target, options.baseURL);
|
|
13
|
+
const appOrigin = options.baseURL === undefined ? null : new URL(options.baseURL).origin;
|
|
14
|
+
if ((resolved.protocol === 'http:' || resolved.protocol === 'https:') &&
|
|
15
|
+
(appOrigin === null ? isLoopbackHostname(resolved.hostname) : resolved.origin === appOrigin)) {
|
|
16
|
+
options.onExchange({ method, url: resolved.href, status: response.status() });
|
|
78
17
|
}
|
|
79
|
-
return call(target, verbOptions);
|
|
80
18
|
}
|
|
81
|
-
|
|
19
|
+
catch {
|
|
20
|
+
// A URL that cannot be resolved is not useful for diagnosis.
|
|
21
|
+
}
|
|
22
|
+
return response;
|
|
82
23
|
};
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
24
|
+
const wrapped = {
|
|
25
|
+
fetch: (url, verbOptions) => typeof url === 'string'
|
|
26
|
+
? invoke('GET', url, () => underlying.fetch(url, verbOptions))
|
|
27
|
+
: underlying.fetch(url, verbOptions),
|
|
28
|
+
get: (url, verbOptions) => invoke('GET', url, () => underlying.get(url, verbOptions)),
|
|
29
|
+
post: (url, verbOptions) => invoke('POST', url, () => underlying.post(url, verbOptions)),
|
|
30
|
+
put: (url, verbOptions) => invoke('PUT', url, () => underlying.put(url, verbOptions)),
|
|
31
|
+
patch: (url, verbOptions) => invoke('PATCH', url, () => underlying.patch(url, verbOptions)),
|
|
32
|
+
delete: (url, verbOptions) => invoke('DELETE', url, () => underlying.delete(url, verbOptions)),
|
|
33
|
+
head: (url, verbOptions) => invoke('HEAD', url, () => underlying.head(url, verbOptions)),
|
|
92
34
|
dispose: (verbOptions) => underlying.dispose(verbOptions),
|
|
93
35
|
storageState: (verbOptions) => underlying.storageState(verbOptions),
|
|
94
36
|
[Symbol.asyncDispose]: () => underlying.dispose(),
|
|
95
37
|
};
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Rehosts the owned APIRequestContext of a witnessed page's context
|
|
99
|
-
* (`page.request` and `context.request` are the SAME lazily-created
|
|
100
|
-
* object; shadowing it on the context instance covers both access
|
|
101
|
-
* paths). The underlying context is materialized first and delegated to.
|
|
102
|
-
*
|
|
103
|
-
* Args:
|
|
104
|
-
* context: the browser context of the witnessed page.
|
|
105
|
-
* options: the same arguments {@link wrapApiRequestContext} takes.
|
|
106
|
-
*
|
|
107
|
-
* Returns:
|
|
108
|
-
* void.
|
|
109
|
-
*/
|
|
110
|
-
export function rehostContextRequest(context, options) {
|
|
111
|
-
const wrapped = wrapApiRequestContext(context.request, options);
|
|
112
|
-
Object.defineProperty(context, 'request', { value: wrapped, configurable: true });
|
|
38
|
+
return wrapped;
|
|
113
39
|
}
|
|
114
40
|
//# sourceMappingURL=api-request.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-request.js","sourceRoot":"","sources":["../../src/fixture/api-request.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api-request.js","sourceRoot":"","sources":["../../src/fixture/api-request.ts"],"names":[],"mappings":"AAWA,SAAS,kBAAkB,CAAC,QAAgB;IAC1C,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,KAAK,IAAI,QAAQ,KAAK,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC3G,CAAC;AAcD;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACtC,UAA6B,EAC7B,OAAwC;IAExC,MAAM,MAAM,GAAG,KAAK,EAClB,MAAc,EACd,MAAc,EACd,IAAgC,EACV,EAAE;QACxB,MAAM,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACpG,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;YACzF,IACE,CAAC,QAAQ,CAAC,QAAQ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,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAC7G,KAAK,EAAE,CAAC,GAAW,EAAE,WAA2B,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACnH,MAAM,EAAE,CAAC,GAAW,EAAE,WAA2B,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACtH,IAAI,EAAE,CAAC,GAAW,EAAE,WAA2B,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAChH,OAAO,EAAE,CAAC,WAAwD,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC;QACtG,YAAY,EAAE,CAAC,WAA6D,EAAE,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,WAAW,CAAC;QACrH,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE;KAClD,CAAC;IACF,OAAO,OAA4B,CAAC;AACtC,CAAC"}
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
* raw `playwright/test` bypasses the fixture and produces claims with no
|
|
15
15
|
* records (the engine grades the obligation `missing`; GF-24).
|
|
16
16
|
*
|
|
17
|
-
* API
|
|
18
|
-
* `page.request`/`context.request`, and
|
|
19
|
-
*
|
|
20
|
-
*
|
|
17
|
+
* API requests made directly from test code are never E2E evidence. The
|
|
18
|
+
* `request` fixture, owned `page.request`/`context.request`, and exported
|
|
19
|
+
* `request` factory all go directly to the app; only browser page traffic
|
|
20
|
+
* rides the session proxy.
|
|
21
21
|
*/
|
|
22
22
|
import { request as playwrightRequest } from 'playwright';
|
|
23
23
|
import type { Page } from 'playwright/test';
|
|
@@ -50,7 +50,7 @@ export declare function flushPageObserverEvidence(witness: Pick<WitnessClient, '
|
|
|
50
50
|
* sessionProxyURL: dedicated observation-proxy origin for this test.
|
|
51
51
|
* onUnroutedOrigin: optional sink for unrouted same-host origins.
|
|
52
52
|
*/
|
|
53
|
-
export declare function routePageThroughSessionProxy(page: Page, appBaseURL: string, sessionProxyURL: string, onUnroutedOrigin?: (origin: string) => void): Promise<void>;
|
|
53
|
+
export declare function routePageThroughSessionProxy(page: Page, appBaseURL: string, sessionProxyURL: string, onUnroutedOrigin?: (origin: string) => void, initiatorForRequest?: (method: string, url: string) => Promise<'page' | 'test-code' | 'unknown'>): Promise<void>;
|
|
54
54
|
/**
|
|
55
55
|
* The diagnostic sink the page fixture hands to
|
|
56
56
|
* {@link routePageThroughSessionProxy}: it hands each distinct unrouted
|
|
@@ -91,10 +91,8 @@ export declare function createUnroutedOriginReporter(options: {
|
|
|
91
91
|
}): UnroutedOriginReporter;
|
|
92
92
|
/** Fixture map this pack adds to every test. */
|
|
93
93
|
export type EvidenceFixtures = {
|
|
94
|
-
/**
|
|
95
|
-
|
|
96
|
-
* `evidence.ui.*` need to declare it.
|
|
97
|
-
*/
|
|
94
|
+
/** Pending diagnostic-only direct API reports, settled before test teardown. */
|
|
95
|
+
directApiReports: void;
|
|
98
96
|
surface: SurfaceDescriptor | undefined;
|
|
99
97
|
/** The trusted evidence primitive surface for the running test. */
|
|
100
98
|
evidence: EvidenceApi;
|
|
@@ -108,23 +106,16 @@ declare const extended: import("playwright/test").TestType<import("playwright/te
|
|
|
108
106
|
export declare const test: typeof extended;
|
|
109
107
|
export { expect };
|
|
110
108
|
/**
|
|
111
|
-
* The module-scope `request` of `@gate-forge/pack-playwright/fixture
|
|
112
|
-
* `newContext(options)`
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* the first test's session window, so the session being open proves
|
|
118
|
-
* nothing), the returned context talks to the app DIRECTLY — setup
|
|
119
|
-
* traffic stays uncredited: it never reaches any session proxy, and
|
|
120
|
-
* the witness refuses session-attributed evidence outside a bound
|
|
121
|
-
* session. INSIDE a test body a session that never answers is a
|
|
122
|
-
* failure, not a fallback: the context waits the fixtures' own
|
|
123
|
-
* bound and then throws, so in-test traffic can never silently
|
|
124
|
-
* bypass the witness.
|
|
109
|
+
* The module-scope `request` of `@gate-forge/pack-playwright/fixture`.
|
|
110
|
+
* `newContext(options)` creates a normal Playwright API context with the
|
|
111
|
+
* supplied options and never rehosts its calls onto the session proxy.
|
|
112
|
+
* App-origin calls made in a test body are reported as direct-API
|
|
113
|
+
* diagnostics only; they can never satisfy an E2E claim. Calls made at
|
|
114
|
+
* module scope have no owning test and are not reported.
|
|
125
115
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
116
|
+
* In worker hooks, calls go straight to the app and remain uncredited;
|
|
117
|
+
* the first test's session may already be open, but that does not make
|
|
118
|
+
* hook traffic test-body evidence.
|
|
128
119
|
*/
|
|
129
120
|
export declare const request: {
|
|
130
121
|
newContext(options?: Parameters<typeof playwrightRequest.newContext>[0]): Promise<APIRequestContext>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../src/fixture/fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAA6B,OAAO,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../src/fixture/fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAA6B,OAAO,IAAI,iBAAiB,EAAE,MAAM,YAAY,CA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