@e2e-dev/web 0.15.2 → 0.15.3-nightly-20261017071555
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/.build.json +1 -1
- package/dist/attempt-session.d.ts +5 -1
- package/dist/attempt-session.js +17 -1
- package/dist/browser.js +2 -1
- package/package.json +3 -3
package/dist/.build.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.15.
|
|
1
|
+
{"version":"0.15.3-nightly-20261017071555"}
|
|
@@ -47,6 +47,8 @@ export declare class AttemptSession {
|
|
|
47
47
|
private media;
|
|
48
48
|
/** The emulation each page got as it appeared, so the attempt's own page is ready before it shows. */
|
|
49
49
|
private readonly emulated;
|
|
50
|
+
/** The active page being opened for the current binding, shared by concurrent callers. */
|
|
51
|
+
private pendingPage;
|
|
50
52
|
constructor(options: SessionOptions);
|
|
51
53
|
/** Captures an immutable connection generation for publication after asynchronous reads. */
|
|
52
54
|
token(): object;
|
|
@@ -66,8 +68,10 @@ export declare class AttemptSession {
|
|
|
66
68
|
run<T>(operation: OperationContext, label: string, work: (operation: OperationContext) => Promise<T>, bound?: OperationBound): Promise<T>;
|
|
67
69
|
/** Owns a candidate through configuration and recording setup, then publishes it once. */
|
|
68
70
|
private transition;
|
|
69
|
-
/**
|
|
71
|
+
/** Opens the active page once; concurrent callers share it. */
|
|
70
72
|
ensurePage(): Promise<Page>;
|
|
73
|
+
/** Publishes one active page after configuration, generation checks and recording setup. */
|
|
74
|
+
private openPage;
|
|
71
75
|
/**
|
|
72
76
|
* The page the attempt shows next. A persistent browser is fresh for the
|
|
73
77
|
* attempt, so its own first tab serves as the attempt's first page instead
|
package/dist/attempt-session.js
CHANGED
|
@@ -19,6 +19,8 @@ export class AttemptSession {
|
|
|
19
19
|
media;
|
|
20
20
|
/** The emulation each page got as it appeared, so the attempt's own page is ready before it shows. */
|
|
21
21
|
emulated = new WeakMap();
|
|
22
|
+
/** The active page being opened for the current binding, shared by concurrent callers. */
|
|
23
|
+
pendingPage;
|
|
22
24
|
constructor(options) {
|
|
23
25
|
this.options = options;
|
|
24
26
|
this.media = options.media;
|
|
@@ -159,11 +161,25 @@ export class AttemptSession {
|
|
|
159
161
|
this.state = pending;
|
|
160
162
|
await work;
|
|
161
163
|
}
|
|
162
|
-
/**
|
|
164
|
+
/** Opens the active page once; concurrent callers share it. */
|
|
163
165
|
async ensurePage() {
|
|
164
166
|
const binding = this.current();
|
|
165
167
|
if (binding.page !== null && !binding.page.isClosed())
|
|
166
168
|
return binding.page;
|
|
169
|
+
if (this.pendingPage?.binding === binding)
|
|
170
|
+
return await this.pendingPage.work;
|
|
171
|
+
const pending = { binding, work: this.openPage(binding) };
|
|
172
|
+
this.pendingPage = pending;
|
|
173
|
+
try {
|
|
174
|
+
return await pending.work;
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
if (this.pendingPage === pending)
|
|
178
|
+
this.pendingPage = undefined;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/** Publishes one active page after configuration, generation checks and recording setup. */
|
|
182
|
+
async openPage(binding) {
|
|
167
183
|
this.invalidate();
|
|
168
184
|
const token = this.token();
|
|
169
185
|
const page = await this.nextPage(binding.context);
|
package/dist/browser.js
CHANGED
|
@@ -222,7 +222,8 @@ export function createBrowserFixture(surface, context) {
|
|
|
222
222
|
const wirePattern = toTextPattern(pattern);
|
|
223
223
|
const operation = context.operation(options?.timeout);
|
|
224
224
|
return surface.guard(operation, 'waitForResponse', async (currentOperation) => {
|
|
225
|
-
const
|
|
225
|
+
const page = await surface.ensurePage();
|
|
226
|
+
const response = await page.waitForResponse((candidate) => routePatternMatches(wirePattern, candidate.url()), { timeout: currentOperation.timeoutMs });
|
|
226
227
|
// Started now, while the browser still holds the body, and awaited
|
|
227
228
|
// only by `text` and `json` on a budget of their own: the timeout
|
|
228
229
|
// bounds the match, never a body still streaming in behind headers
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e2e-dev/web",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3-nightly-20261017071555",
|
|
4
4
|
"description": "Web engine for e2e agentic end-to-end testing, built on Playwright",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"e2e",
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
"playwright-core": "1.64.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"e2e": "
|
|
53
|
+
"e2e": "0.21.3-nightly-20261017071555"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "26.6.2",
|
|
57
|
-
"e2e": "0.21.
|
|
57
|
+
"e2e": "0.21.3-nightly-20261017071555",
|
|
58
58
|
"@types/pngjs": "6.0.5",
|
|
59
59
|
"pngjs": "7.0.0",
|
|
60
60
|
"typescript": "7.0.2",
|