playwright 1.56.0-alpha-2025-08-29 → 1.56.0-alpha-1756475278000

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/lib/program.js CHANGED
@@ -172,6 +172,7 @@ async function runTests(args, opts) {
172
172
  config.cliProjectFilter = opts.project || void 0;
173
173
  config.cliPassWithNoTests = !!opts.passWithNoTests;
174
174
  config.cliLastFailed = !!opts.lastFailed;
175
+ config.cliLastRunFile = opts.lastRunFile ? import_path.default.resolve(process.cwd(), opts.lastRunFile) : void 0;
175
176
  (0, import_projectUtils.filterProjects)(config.projects, config.cliProjectFilter);
176
177
  if (opts.ui || opts.uiHost || opts.uiPort) {
177
178
  if (opts.onlyChanged)
@@ -330,6 +331,7 @@ const testOptions = [
330
331
  ["--headed", { description: `Run tests in headed browsers (default: headless)` }],
331
332
  ["--ignore-snapshots", { description: `Ignore screenshot and snapshot expectations` }],
332
333
  ["--last-failed", { description: `Only re-run the failures` }],
334
+ ["--last-run-file <file>", { description: `Path to the last-run file (default: "test-results/.last-run.json")` }],
333
335
  ["--list", { description: `Collect all the tests and report them, but do not run` }],
334
336
  ["--max-failures <N>", { description: `Stop after the first N failures` }],
335
337
  ["--no-deps", { description: `Do not run project dependencies` }],
@@ -37,17 +37,27 @@ var import_projectUtils = require("./projectUtils");
37
37
  class LastRunReporter {
38
38
  constructor(config) {
39
39
  this._config = config;
40
- const [project] = (0, import_projectUtils.filterProjects)(config.projects, config.cliProjectFilter);
41
- if (project)
42
- this._lastRunFile = import_path.default.join(project.project.outputDir, ".last-run.json");
40
+ if (config.cliLastRunFile) {
41
+ this._lastRunFile = config.cliLastRunFile;
42
+ } else {
43
+ const [project] = (0, import_projectUtils.filterProjects)(config.projects, config.cliProjectFilter);
44
+ if (project)
45
+ this._lastRunFile = import_path.default.join(project.project.outputDir, ".last-run.json");
46
+ }
43
47
  }
44
- async filterLastFailed() {
48
+ async applyFilter() {
45
49
  if (!this._lastRunFile)
46
50
  return;
47
51
  try {
48
52
  const lastRunInfo = JSON.parse(await import_fs.default.promises.readFile(this._lastRunFile, "utf8"));
49
- const failedTestIds = new Set(lastRunInfo.failedTests);
50
- this._config.postShardTestFilters.push((test) => failedTestIds.has(test.id));
53
+ if (lastRunInfo.filterTests) {
54
+ const filterTestIds = new Set(lastRunInfo.filterTests);
55
+ this._config.preOnlyTestFilters.push((test) => filterTestIds.has(test.id));
56
+ }
57
+ if (this._config.cliLastFailed) {
58
+ const failedTestIds = new Set(lastRunInfo.failedTests ?? []);
59
+ this._config.postShardTestFilters.push((test) => failedTestIds.has(test.id));
60
+ }
51
61
  } catch {
52
62
  }
53
63
  }
@@ -400,8 +400,7 @@ async function runAllTestsWithConfig(config) {
400
400
  (0, import_webServerPlugin.webServerPluginsForConfig)(config).forEach((p) => config.plugins.push({ factory: p }));
401
401
  const reporters = await (0, import_reporters.createReporters)(config, listOnly ? "list" : "test", false);
402
402
  const lastRun = new import_lastRun.LastRunReporter(config);
403
- if (config.cliLastFailed)
404
- await lastRun.filterLastFailed();
403
+ await lastRun.applyFilter();
405
404
  const reporter = new import_internalReporter.InternalReporter([...reporters, lastRun]);
406
405
  const tasks = listOnly ? [
407
406
  (0, import_tasks.createLoadTask)("in-process", { failOnLoadErrors: true, filterOnly: false }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playwright",
3
- "version": "1.56.0-alpha-2025-08-29",
3
+ "version": "1.56.0-alpha-1756475278000",
4
4
  "description": "A high-level API to automate web browsers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "license": "Apache-2.0",
62
62
  "dependencies": {
63
- "playwright-core": "1.56.0-alpha-2025-08-29"
63
+ "playwright-core": "1.56.0-alpha-1756475278000"
64
64
  },
65
65
  "optionalDependencies": {
66
66
  "fsevents": "2.3.2"