@gate-forge/pack-playwright 0.14.0 → 0.15.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/discovery/config-locations.d.ts +4 -0
- package/dist/discovery/config-locations.d.ts.map +1 -1
- package/dist/discovery/config-locations.js +9 -0
- package/dist/discovery/config-locations.js.map +1 -1
- package/dist/discovery/cypress-runner-adapter.d.ts +1 -1
- package/dist/discovery/cypress-runner-adapter.d.ts.map +1 -1
- package/dist/discovery/cypress-runner-adapter.js +9 -7
- package/dist/discovery/cypress-runner-adapter.js.map +1 -1
- package/dist/discovery/discover.d.ts +10 -0
- package/dist/discovery/discover.d.ts.map +1 -1
- package/dist/discovery/discover.js +123 -6
- package/dist/discovery/discover.js.map +1 -1
- package/dist/discovery/index.d.ts +1 -1
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +1 -1
- package/dist/discovery/index.js.map +1 -1
- package/dist/discovery/playwright-runner-adapter.d.ts.map +1 -1
- package/dist/discovery/playwright-runner-adapter.js +4 -1
- package/dist/discovery/playwright-runner-adapter.js.map +1 -1
- package/dist/discovery/prepare-barrier.d.ts +2 -1
- package/dist/discovery/prepare-barrier.d.ts.map +1 -1
- package/dist/discovery/prepare-barrier.js +2 -1
- package/dist/discovery/prepare-barrier.js.map +1 -1
- package/dist/discovery/pytest-runner-adapter.d.ts.map +1 -1
- package/dist/discovery/pytest-runner-adapter.js +11 -14
- package/dist/discovery/pytest-runner-adapter.js.map +1 -1
- package/dist/discovery/reconcile.d.ts +7 -7
- package/dist/discovery/reconcile.d.ts.map +1 -1
- package/dist/discovery/reconcile.js +36 -29
- package/dist/discovery/reconcile.js.map +1 -1
- package/dist/discovery/runner-config-paths.d.ts.map +1 -1
- package/dist/discovery/runner-config-paths.js +3 -4
- package/dist/discovery/runner-config-paths.js.map +1 -1
- package/dist/discovery/runner-env.d.ts +12 -0
- package/dist/discovery/runner-env.d.ts.map +1 -1
- package/dist/discovery/runner-env.js +36 -2
- package/dist/discovery/runner-env.js.map +1 -1
- package/dist/discovery/runner-file-scope.d.ts.map +1 -1
- package/dist/discovery/runner-file-scope.js +8 -0
- package/dist/discovery/runner-file-scope.js.map +1 -1
- package/dist/discovery/supervised-run.d.ts +11 -1
- package/dist/discovery/supervised-run.d.ts.map +1 -1
- package/dist/discovery/supervised-run.js +32 -12
- package/dist/discovery/supervised-run.js.map +1 -1
- package/dist/discovery/vitest-runner-adapter.d.ts +8 -1
- package/dist/discovery/vitest-runner-adapter.d.ts.map +1 -1
- package/dist/discovery/vitest-runner-adapter.js +28 -21
- package/dist/discovery/vitest-runner-adapter.js.map +1 -1
- package/dist/fixture/api-request.d.ts +11 -18
- package/dist/fixture/api-request.d.ts.map +1 -1
- package/dist/fixture/api-request.js +91 -32
- package/dist/fixture/api-request.js.map +1 -1
- package/dist/fixture/auto-session-env.d.ts +3 -0
- package/dist/fixture/auto-session-env.d.ts.map +1 -0
- package/dist/fixture/auto-session-env.js +7 -0
- package/dist/fixture/auto-session-env.js.map +1 -0
- package/dist/fixture/auto-session-loader.mjs +20 -0
- package/dist/fixture/auto-session-playwright-wrapper.mjs +6 -0
- package/dist/fixture/auto-session-root.cjs +14 -0
- package/dist/fixture/auto-session-wrapper.cjs +8 -0
- package/dist/fixture/auto-session-wrapper.mjs +6 -0
- package/dist/fixture/auto-session.cjs +36 -0
- package/dist/fixture/fixture.d.ts +45 -34
- package/dist/fixture/fixture.d.ts.map +1 -1
- package/dist/fixture/fixture.js +356 -242
- package/dist/fixture/fixture.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/reporter/reporter.cjs +4 -0
- package/dist/reporter/reporter.cjs.map +1 -1
- package/dist/reporter/reporter.d.ts +8 -0
- package/dist/reporter/reporter.d.ts.map +1 -1
- package/dist/reporter/reporter.js +40 -0
- package/dist/reporter/reporter.js.map +1 -1
- package/dist/supervisor/drain.d.ts.map +1 -1
- package/dist/supervisor/drain.js +27 -0
- package/dist/supervisor/drain.js.map +1 -1
- package/dist/supervisor/spool.d.ts +5 -0
- package/dist/supervisor/spool.d.ts.map +1 -1
- package/dist/supervisor/spool.js +20 -1
- package/dist/supervisor/spool.js.map +1 -1
- package/dist/vitest/index.d.ts.map +1 -1
- package/dist/vitest/index.js +2 -1
- package/dist/vitest/index.js.map +1 -1
- package/dist/vitest/reporter.d.ts.map +1 -1
- package/dist/vitest/reporter.js +2 -1
- package/dist/vitest/reporter.js.map +1 -1
- package/package.json +4 -4
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
* API. Tests that use engine-driven UI must extend this runner with a
|
|
11
11
|
* declarative `surface` descriptor (`test.extend({ surface })`) — the
|
|
12
12
|
* pack carries no application-specific selectors. Tests must
|
|
13
|
-
* import `{ test, expect }` FROM A RUNNER EXTENDED LIKE THIS
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* import `{ test, expect }` FROM A RUNNER EXTENDED LIKE THIS. Witnessed
|
|
14
|
+
* runs automatically redirect consumer `@playwright/test` and `playwright/test`
|
|
15
|
+
* imports here too; an uninstrumented test produces no browser records.
|
|
16
16
|
*
|
|
17
|
-
* API requests made
|
|
18
|
-
* `request`
|
|
19
|
-
*
|
|
20
|
-
* rides the session proxy.
|
|
17
|
+
* API requests made from test code are never E2E evidence. Test-owned
|
|
18
|
+
* `request` contexts ride the session proxy with a test-code marker for
|
|
19
|
+
* the HTTP ledger; owned `page.request`/`context.request` stay direct.
|
|
21
20
|
*/
|
|
22
21
|
import { request as playwrightRequest } from 'playwright';
|
|
23
22
|
import type { Page } from 'playwright/test';
|
|
@@ -33,26 +32,41 @@ import { WitnessClient, type SessionPageObserverFlushRequest } from './witness-c
|
|
|
33
32
|
*/
|
|
34
33
|
export declare function flushPageObserverEvidence(witness: Pick<WitnessClient, 'flushPageObserver'>, request: SessionPageObserverFlushRequest): Promise<void>;
|
|
35
34
|
/**
|
|
36
|
-
* Routes browser requests for
|
|
37
|
-
* supervisor-issued session proxy, preserving the app URL
|
|
35
|
+
* Routes browser requests for every CONFIGURED app origin through the
|
|
36
|
+
* supervisor-issued session proxy of that origin, preserving the app URL
|
|
37
|
+
* and path.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
39
|
+
* A run may declare more than one app origin (`.gateforge.yml`
|
|
40
|
+
* `additionalAppOrigins`): a consumer whose tests drive a platform admin
|
|
41
|
+
* console beside the tenant app loads both, and traffic on the second one
|
|
42
|
+
* used to pass unwitnessed — the test passed and earned nothing. Each
|
|
43
|
+
* origin rewrites onto ITS OWN session proxy, and both land on the same
|
|
44
|
+
* session, so attribution and claims are unchanged.
|
|
45
|
+
*
|
|
46
|
+
* Every OTHER origin the page requests is passed to remaining routes
|
|
47
|
+
* untouched, preserving the consumer's handlers for third-party assets.
|
|
48
|
+
* When an origin is on a routed app's own host (or loopback) it is also a
|
|
49
|
+
* silent ORIGIN MISMATCH: the page is talking to an app origin Gateforge
|
|
50
|
+
* never configured, so nothing it fetches can reach the session proxy.
|
|
51
|
+
* `onUnroutedOrigin` reports those origins so the witness's zero-traffic
|
|
52
|
+
* note can name the real cause (plan 0.9.2 item F). It is diagnostic text:
|
|
53
|
+
* no record, no verdict.
|
|
46
54
|
*
|
|
47
55
|
* Args:
|
|
48
56
|
* page: Playwright page used by the current test.
|
|
49
|
-
* appBaseURL:
|
|
50
|
-
* sessionProxyURL: dedicated
|
|
57
|
+
* appBaseURL: the primary app origin from the operator.
|
|
58
|
+
* sessionProxyURL: that origin's dedicated session-proxy origin.
|
|
51
59
|
* onUnroutedOrigin: optional sink for unrouted same-host origins.
|
|
60
|
+
* initiatorForRequest: optional UI-vs-test-code classifier.
|
|
61
|
+
* additionalProxies: the DECLARED further origins and their proxies
|
|
62
|
+
* (from the session credential), when the run declares any.
|
|
52
63
|
*/
|
|
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'
|
|
64
|
+
export declare function routePageThroughSessionProxy(page: Page, appBaseURL: string, sessionProxyURL: string, onUnroutedOrigin?: (origin: string) => void, initiatorForRequest?: (method: string, url: string) => Promise<'page' | 'test-code' | 'unknown'>, additionalProxies?: readonly {
|
|
65
|
+
appOrigin: string;
|
|
66
|
+
proxyUrl: string;
|
|
67
|
+
}[]): Promise<void>;
|
|
54
68
|
/**
|
|
55
|
-
* The diagnostic sink the
|
|
69
|
+
* The diagnostic sink the browser routing fixture hands to
|
|
56
70
|
* {@link routePageThroughSessionProxy}: it hands each distinct unrouted
|
|
57
71
|
* origin to the witness for THIS session, which quotes it in the
|
|
58
72
|
* zero-traffic note.
|
|
@@ -75,8 +89,10 @@ export interface UnroutedOriginReporter {
|
|
|
75
89
|
* Args:
|
|
76
90
|
* witness: the session's witness client.
|
|
77
91
|
* session: the session the report belongs to (its own, never another's).
|
|
78
|
-
* appBaseURL: the base URL the fixture routes
|
|
79
|
-
*
|
|
92
|
+
* appBaseURL: the primary base URL the fixture routes.
|
|
93
|
+
* additionalAppOrigins: the run's DECLARED further app origins. They are
|
|
94
|
+
* routed too, so a report naming one would be the fixture accusing
|
|
95
|
+
* itself of a mismatch it does not have.
|
|
80
96
|
*
|
|
81
97
|
* Returns:
|
|
82
98
|
* UnroutedOriginReporter: the bounded, non-blocking reporter.
|
|
@@ -88,11 +104,12 @@ export declare function createUnroutedOriginReporter(options: {
|
|
|
88
104
|
sessionToken: string;
|
|
89
105
|
};
|
|
90
106
|
appBaseURL: string;
|
|
107
|
+
additionalAppOrigins?: readonly string[];
|
|
91
108
|
}): UnroutedOriginReporter;
|
|
92
109
|
/** Fixture map this pack adds to every test. */
|
|
93
110
|
export type EvidenceFixtures = {
|
|
94
|
-
/**
|
|
95
|
-
|
|
111
|
+
/** Test-scoped routing for every page, including consumer-owned contexts. */
|
|
112
|
+
browserPages: void;
|
|
96
113
|
surface: SurfaceDescriptor | undefined;
|
|
97
114
|
/** The trusted evidence primitive surface for the running test. */
|
|
98
115
|
evidence: EvidenceApi;
|
|
@@ -106,16 +123,10 @@ declare const extended: import("playwright/test").TestType<import("playwright/te
|
|
|
106
123
|
export declare const test: typeof extended;
|
|
107
124
|
export { expect };
|
|
108
125
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* diagnostics only; they can never satisfy an E2E claim. Calls made at
|
|
114
|
-
* module scope have no owning test and are not reported.
|
|
115
|
-
*
|
|
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.
|
|
126
|
+
* Test-created standalone API contexts use the CURRENT test's session.
|
|
127
|
+
* base.info() throwing detects module/global scope; workerHookDepth detects
|
|
128
|
+
* beforeAll/afterAll even when Playwright already exposes the first test.
|
|
129
|
+
* Contexts created there remain native/direct and never acquire attribution.
|
|
119
130
|
*/
|
|
120
131
|
export declare const request: {
|
|
121
132
|
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
|
|
1
|
+
{"version":3,"file":"fixture.d.ts","sourceRoot":"","sources":["../../src/fixture/fixture.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAA6B,OAAO,IAAI,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACrF,OAAO,KAAK,EAAE,IAAI,EAAY,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAA8C,MAAM,iBAAiB,CAAC;AAErG,OAA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