playwright 1.57.0-alpha-2025-11-19 → 1.57.0-beta-1763649092000

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.
@@ -29,10 +29,16 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var testServerConnection_exports = {};
30
30
  __export(testServerConnection_exports, {
31
31
  TestServerConnection: () => TestServerConnection,
32
+ TestServerConnectionClosedError: () => TestServerConnectionClosedError,
32
33
  WebSocketTestServerTransport: () => WebSocketTestServerTransport
33
34
  });
34
35
  module.exports = __toCommonJS(testServerConnection_exports);
35
36
  var events = __toESM(require("./events"));
37
+ class TestServerConnectionClosedError extends Error {
38
+ constructor() {
39
+ super("Test server connection closed");
40
+ }
41
+ }
36
42
  class WebSocketTestServerTransport {
37
43
  constructor(url) {
38
44
  this._ws = new WebSocket(url);
@@ -100,6 +106,9 @@ class TestServerConnection {
100
106
  this._isClosed = true;
101
107
  this._onCloseEmitter.fire();
102
108
  clearInterval(pingInterval);
109
+ for (const callback of this._callbacks.values())
110
+ callback.reject(new TestServerConnectionClosedError());
111
+ this._callbacks.clear();
103
112
  });
104
113
  }
105
114
  isClosed() {
@@ -211,5 +220,6 @@ class TestServerConnection {
211
220
  // Annotate the CommonJS export names for ESM import in node:
212
221
  0 && (module.exports = {
213
222
  TestServerConnection,
223
+ TestServerConnectionClosedError,
214
224
  WebSocketTestServerTransport
215
225
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright",
3
- "version": "1.57.0-alpha-2025-11-19",
3
+ "version": "1.57.0-beta-1763649092000",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "license": "Apache-2.0",
66
66
  "dependencies": {
67
- "playwright-core": "1.57.0-alpha-2025-11-19"
67
+ "playwright-core": "1.57.0-beta-1763649092000"
68
68
  },
69
69
  "optionalDependencies": {
70
70
  "fsevents": "2.3.2"
package/types/test.d.ts CHANGED
@@ -992,6 +992,31 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
992
992
  * });
993
993
  * ```
994
994
  *
995
+ * If your webserver runs on varying ports, use `wait` to capture the port:
996
+ *
997
+ * ```js
998
+ * import { defineConfig } from '@playwright/test';
999
+ *
1000
+ * export default defineConfig({
1001
+ * webServer: {
1002
+ * command: 'npm run start',
1003
+ * wait: {
1004
+ * stdout: '/Listening on port (?<my_server_port>\\d+)/'
1005
+ * },
1006
+ * },
1007
+ * });
1008
+ * ```
1009
+ *
1010
+ * ```js
1011
+ * import { test, expect } from '@playwright/test';
1012
+ *
1013
+ * test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` });
1014
+ *
1015
+ * test('homepage', async ({ page }) => {
1016
+ * await page.goto('/');
1017
+ * });
1018
+ * ```
1019
+ *
995
1020
  */
996
1021
  webServer?: TestConfigWebServer | TestConfigWebServer[];
997
1022
  /**