playwright 1.54.0-alpha-2025-06-24 → 1.54.0-alpha-2025-06-25

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/program.js +44 -43
  2. package/package.json +2 -2
package/lib/program.js CHANGED
@@ -51,7 +51,15 @@ function addTestCommand(program3) {
51
51
  const command = program3.command("test [test-filter...]");
52
52
  command.description("run tests with Playwright Test");
53
53
  const options = testOptions.sort((a, b) => a[0].replace(/-/g, "").localeCompare(b[0].replace(/-/g, "")));
54
- options.forEach(([name, description]) => command.option(name, description));
54
+ options.forEach(([name, { description, choices, preset }]) => {
55
+ const option = command.createOption(name, description);
56
+ if (choices)
57
+ option.choices(choices);
58
+ if (preset)
59
+ option.preset(preset);
60
+ command.addOption(option);
61
+ return command;
62
+ });
55
63
  command.action(async (args, opts) => {
56
64
  try {
57
65
  await runTests(args, opts);
@@ -253,11 +261,6 @@ async function mergeReports(reportDir, opts) {
253
261
  (0, import_utils.gracefullyProcessExitDoNotHang)(0);
254
262
  }
255
263
  function overridesFromOptions(options) {
256
- let updateSnapshots;
257
- if (["all", "changed", "missing", "none"].includes(options.updateSnapshots))
258
- updateSnapshots = options.updateSnapshots;
259
- else
260
- updateSnapshots = "updateSnapshots" in options ? "changed" : void 0;
261
264
  const overrides = {
262
265
  failOnFlakyTests: options.failOnFlakyTests ? true : void 0,
263
266
  forbidOnly: options.forbidOnly ? true : void 0,
@@ -273,7 +276,7 @@ function overridesFromOptions(options) {
273
276
  timeout: options.timeout ? parseInt(options.timeout, 10) : void 0,
274
277
  tsconfig: options.tsconfig ? import_path.default.resolve(process.cwd(), options.tsconfig) : void 0,
275
278
  ignoreSnapshots: options.ignoreSnapshots ? !!options.ignoreSnapshots : void 0,
276
- updateSnapshots,
279
+ updateSnapshots: options.updateSnapshots,
277
280
  updateSourceMethod: options.updateSourceMethod,
278
281
  workers: options.workers
279
282
  };
@@ -296,8 +299,6 @@ function overridesFromOptions(options) {
296
299
  process.env.PWDEBUG = "1";
297
300
  }
298
301
  if (!options.ui && options.trace) {
299
- if (!kTraceModes.includes(options.trace))
300
- throw new Error(`Unsupported trace mode "${options.trace}", must be one of ${kTraceModes.map((mode) => `"${mode}"`).join(", ")}`);
301
302
  overrides.use = overrides.use || {};
302
303
  overrides.use.trace = options.trace;
303
304
  }
@@ -341,40 +342,40 @@ function resolveReporter(id) {
341
342
  const kTraceModes = ["on", "off", "on-first-retry", "on-all-retries", "retain-on-failure", "retain-on-first-failure"];
342
343
  const testOptions = [
343
344
  /* deprecated */
344
- ["--browser <browser>", `Browser to use for tests, one of "all", "chromium", "firefox" or "webkit" (default: "chromium")`],
345
- ["-c, --config <file>", `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"`],
346
- ["--debug", `Run tests with Playwright Inspector. Shortcut for "PWDEBUG=1" environment variable and "--timeout=0 --max-failures=1 --headed --workers=1" options`],
347
- ["--fail-on-flaky-tests", `Fail if any test is flagged as flaky (default: false)`],
348
- ["--forbid-only", `Fail if test.only is called (default: false)`],
349
- ["--fully-parallel", `Run all tests in parallel (default: false)`],
350
- ["--global-timeout <timeout>", `Maximum time this test suite can run in milliseconds (default: unlimited)`],
351
- ["-g, --grep <grep>", `Only run tests matching this regular expression (default: ".*")`],
352
- ["-gv, --grep-invert <grep>", `Only run tests that do not match this regular expression`],
353
- ["--headed", `Run tests in headed browsers (default: headless)`],
354
- ["--ignore-snapshots", `Ignore screenshot and snapshot expectations`],
355
- ["--last-failed", `Only re-run the failures`],
356
- ["--list", `Collect all the tests and report them, but do not run`],
357
- ["--max-failures <N>", `Stop after the first N failures`],
358
- ["--no-deps", "Do not run project dependencies"],
359
- ["--output <dir>", `Folder for output artifacts (default: "test-results")`],
360
- ["--only-changed [ref]", `Only run test files that have been changed between 'HEAD' and 'ref'. Defaults to running all uncommitted changes. Only supports Git.`],
361
- ["--pass-with-no-tests", `Makes test run succeed even if no tests were found`],
362
- ["--project <project-name...>", `Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects)`],
363
- ["--quiet", `Suppress stdio`],
364
- ["--repeat-each <N>", `Run each test N times (default: 1)`],
365
- ["--reporter <reporter>", `Reporter to use, comma-separated, can be ${import_config.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_config.defaultReporter}")`],
366
- ["--retries <retries>", `Maximum retry count for flaky tests, zero for no retries (default: no retries)`],
367
- ["--shard <shard>", `Shard tests and execute only the selected shard, specify in the form "current/all", 1-based, for example "3/5"`],
368
- ["--timeout <timeout>", `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${import_config.defaultTimeout})`],
369
- ["--trace <mode>", `Force tracing mode, can be ${kTraceModes.map((mode) => `"${mode}"`).join(", ")}`],
370
- ["--tsconfig <path>", `Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately)`],
371
- ["--ui", `Run tests in interactive UI mode`],
372
- ["--ui-host <host>", "Host to serve UI on; specifying this option opens UI in a browser tab"],
373
- ["--ui-port <port>", "Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab"],
374
- ["-u, --update-snapshots [mode]", `Update snapshots with actual results. Possible values are "all", "changed", "missing", and "none". Running tests without the flag defaults to "missing"; running tests with the flag but without a value defaults to "changed".`],
375
- ["--update-source-method <method>", `Chooses the way source is updated. Possible values are 'overwrite', '3way' and 'patch'. Defaults to 'patch'`],
376
- ["-j, --workers <workers>", `Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%)`],
377
- ["-x", `Stop after the first failure`]
345
+ ["--browser <browser>", { description: `Browser to use for tests, one of "all", "chromium", "firefox" or "webkit" (default: "chromium")` }],
346
+ ["-c, --config <file>", { description: `Configuration file, or a test directory with optional "playwright.config.{m,c}?{js,ts}"` }],
347
+ ["--debug", { description: `Run tests with Playwright Inspector. Shortcut for "PWDEBUG=1" environment variable and "--timeout=0 --max-failures=1 --headed --workers=1" options` }],
348
+ ["--fail-on-flaky-tests", { description: `Fail if any test is flagged as flaky (default: false)` }],
349
+ ["--forbid-only", { description: `Fail if test.only is called (default: false)` }],
350
+ ["--fully-parallel", { description: `Run all tests in parallel (default: false)` }],
351
+ ["--global-timeout <timeout>", { description: `Maximum time this test suite can run in milliseconds (default: unlimited)` }],
352
+ ["-g, --grep <grep>", { description: `Only run tests matching this regular expression (default: ".*")` }],
353
+ ["--grep-invert <grep>", { description: `Only run tests that do not match this regular expression` }],
354
+ ["--headed", { description: `Run tests in headed browsers (default: headless)` }],
355
+ ["--ignore-snapshots", { description: `Ignore screenshot and snapshot expectations` }],
356
+ ["--last-failed", { description: `Only re-run the failures` }],
357
+ ["--list", { description: `Collect all the tests and report them, but do not run` }],
358
+ ["--max-failures <N>", { description: `Stop after the first N failures` }],
359
+ ["--no-deps", { description: `Do not run project dependencies` }],
360
+ ["--output <dir>", { description: `Folder for output artifacts (default: "test-results")` }],
361
+ ["--only-changed [ref]", { description: `Only run test files that have been changed between 'HEAD' and 'ref'. Defaults to running all uncommitted changes. Only supports Git.` }],
362
+ ["--pass-with-no-tests", { description: `Makes test run succeed even if no tests were found` }],
363
+ ["--project <project-name...>", { description: `Only run tests from the specified list of projects, supports '*' wildcard (default: run all projects)` }],
364
+ ["--quiet", { description: `Suppress stdio` }],
365
+ ["--repeat-each <N>", { description: `Run each test N times (default: 1)` }],
366
+ ["--reporter <reporter>", { description: `Reporter to use, comma-separated, can be ${import_config.builtInReporters.map((name) => `"${name}"`).join(", ")} (default: "${import_config.defaultReporter}")` }],
367
+ ["--retries <retries>", { description: `Maximum retry count for flaky tests, zero for no retries (default: no retries)` }],
368
+ ["--shard <shard>", { description: `Shard tests and execute only the selected shard, specify in the form "current/all", 1-based, for example "3/5"` }],
369
+ ["--timeout <timeout>", { description: `Specify test timeout threshold in milliseconds, zero for unlimited (default: ${import_config.defaultTimeout})` }],
370
+ ["--trace <mode>", { description: `Force tracing mode`, choices: kTraceModes }],
371
+ ["--tsconfig <path>", { description: `Path to a single tsconfig applicable to all imported files (default: look up tsconfig for each imported file separately)` }],
372
+ ["--ui", { description: `Run tests in interactive UI mode` }],
373
+ ["--ui-host <host>", { description: `Host to serve UI on; specifying this option opens UI in a browser tab` }],
374
+ ["--ui-port <port>", { description: `Port to serve UI on, 0 for any free port; specifying this option opens UI in a browser tab` }],
375
+ ["-u, --update-snapshots [mode]", { description: `Update snapshots with actual results. Running tests without the flag defaults to "missing"`, choices: ["all", "changed", "missing", "none"], preset: "changed" }],
376
+ ["--update-source-method <method>", { description: `Chooses the way source is updated (default: "patch")`, choices: ["overwrite", "3way", "patch"] }],
377
+ ["-j, --workers <workers>", { description: `Number of concurrent workers or percentage of logical CPU cores, use 1 to run in a single worker (default: 50%)` }],
378
+ ["-x", { description: `Stop after the first failure` }]
378
379
  ];
379
380
  addTestCommand(import_program.program);
380
381
  addShowReportCommand(import_program.program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright",
3
- "version": "1.54.0-alpha-2025-06-24",
3
+ "version": "1.54.0-alpha-2025-06-25",
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-06-24"
59
+ "playwright-core": "1.54.0-alpha-2025-06-25"
60
60
  },
61
61
  "optionalDependencies": {
62
62
  "fsevents": "2.3.2"