playwright 1.54.0-alpha-2025-07-04 → 1.54.0-alpha-2025-07-05

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.

Potentially problematic release.


This version of playwright might be problematic. Click here for more details.

Files changed (2) hide show
  1. package/lib/index.js +5 -18
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -382,10 +382,9 @@ const playwrightFixtures = {
382
382
  }
383
383
  const defaultContextOptions = playwright.chromium._defaultContextOptions;
384
384
  const context = await browser._newContextForReuse(defaultContextOptions);
385
- context[kIsReusedContext] = true;
386
385
  await use(context);
387
386
  const closeReason = testInfo.status === "timedOut" ? "Test timeout of " + testInfo.timeout + "ms exceeded." : "Test ended.";
388
- await browser._stopPendingOperations(closeReason);
387
+ await browser._disconnectFromReusedContext(closeReason);
389
388
  },
390
389
  page: async ({ context, _reuseContext }, use) => {
391
390
  if (!_reuseContext) {
@@ -461,7 +460,6 @@ function resolveClientCerticates(clientCertificates) {
461
460
  return clientCertificates;
462
461
  }
463
462
  const kTracingStarted = Symbol("kTracingStarted");
464
- const kIsReusedContext = Symbol("kReusedContext");
465
463
  function connectOptionsFromEnv() {
466
464
  const wsEndpoint = process.env.PW_TEST_CONNECT_WS_ENDPOINT;
467
465
  if (!wsEndpoint)
@@ -545,8 +543,6 @@ class SnapshotRecorder {
545
543
  }
546
544
  class ArtifactsRecorder {
547
545
  constructor(playwright, artifactsDir, screenshot) {
548
- this._reusedContexts = /* @__PURE__ */ new Set();
549
- this._sourceCache = /* @__PURE__ */ new Map();
550
546
  this._playwright = playwright;
551
547
  this._artifactsDir = artifactsDir;
552
548
  const screenshotOptions = typeof screenshot === "string" ? void 0 : screenshot;
@@ -559,23 +555,14 @@ class ArtifactsRecorder {
559
555
  this._testInfo = testInfo;
560
556
  testInfo._onDidFinishTestFunction = () => this.didFinishTestFunction();
561
557
  this._screenshotRecorder.fixOrdinal();
562
- await Promise.all(this._playwright._allContexts().map(async (context) => {
563
- if (context[kIsReusedContext])
564
- this._reusedContexts.add(context);
565
- else
566
- await this.didCreateBrowserContext(context);
567
- }));
568
- {
569
- const existingApiRequests = Array.from(this._playwright.request._contexts);
570
- await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
571
- }
558
+ await Promise.all(this._playwright._allContexts().map((context) => this.didCreateBrowserContext(context)));
559
+ const existingApiRequests = Array.from(this._playwright.request._contexts);
560
+ await Promise.all(existingApiRequests.map((c) => this.didCreateRequestContext(c)));
572
561
  }
573
562
  async didCreateBrowserContext(context) {
574
563
  await this._startTraceChunkOnContextCreation(context.tracing);
575
564
  }
576
565
  async willCloseBrowserContext(context) {
577
- if (this._reusedContexts.has(context))
578
- return;
579
566
  await this._stopTracing(context.tracing);
580
567
  await this._screenshotRecorder.captureTemporary(context);
581
568
  await this._takePageSnapshot(context);
@@ -606,7 +593,7 @@ class ArtifactsRecorder {
606
593
  }
607
594
  async didFinishTest() {
608
595
  await this.didFinishTestFunction();
609
- const leftoverContexts = this._playwright._allContexts().filter((context2) => !this._reusedContexts.has(context2));
596
+ const leftoverContexts = this._playwright._allContexts();
610
597
  const leftoverApiRequests = Array.from(this._playwright.request._contexts);
611
598
  await Promise.all(leftoverContexts.map(async (context2) => {
612
599
  await this._stopTracing(context2.tracing);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright",
3
- "version": "1.54.0-alpha-2025-07-04",
3
+ "version": "1.54.0-alpha-2025-07-05",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  "license": "Apache-2.0",
58
58
  "dependencies": {
59
- "playwright-core": "1.54.0-alpha-2025-07-04"
59
+ "playwright-core": "1.54.0-alpha-2025-07-05"
60
60
  },
61
61
  "optionalDependencies": {
62
62
  "fsevents": "2.3.2"