From 1092a4a6072b7b2d73caa82def5b242a9b7484ed Mon Sep 17 00:00:00 2001 From: Pavel Feldman Date: Thu, 5 Nov 2026 14:38:31 -0800 Subject: [PATCH] chore: roll Playwright to 1.66.0-alpha-1793916328000 Parse the arguments once with parseArgs() and pass them to program(), as microsoft/playwright#43941 allows. The update check now reads the command from the parsed arguments, so a global option with a value before the command no longer hides it. --- package-lock.json | 28 +++++++++---------- package.json | 6 ++-- playwright-cli.js | 15 ++++++---- .../playwright-cli/references/running-code.md | 2 ++ tests/integration.spec.ts | 3 +- 5 files changed, 31 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 73536b50..0dbe5a99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,14 @@ "version": "0.1.23", "license": "Apache-2.0", "dependencies": { - "playwright": "1.65.0-alpha-2026-10-30", - "playwright-core": "1.65.0-alpha-2026-10-30" + "playwright": "1.66.0-alpha-1793916328000", + "playwright-core": "1.66.0-alpha-1793916328000" }, "bin": { "playwright-cli": "playwright-cli.js" }, "devDependencies": { - "@playwright/test": "1.65.0-alpha-2026-10-30", + "@playwright/test": "1.66.0-alpha-1793916328000", "@types/node": "^25.2.1" }, "engines": { @@ -24,13 +24,13 @@ } }, "node_modules/@playwright/test": { - "version": "1.65.0-alpha-2026-10-30", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.0-alpha-2026-10-30.tgz", - "integrity": "sha512-nLadDXkIY8WTURzLUuKsHG2l+U/ozQzXX65L/yEeVQFcszej0nZaNpm0qmwNHR9lr6s70x9ozv4MG/Jm4rQGvQ==", + "version": "1.66.0-alpha-1793916328000", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.66.0-alpha-1793916328000.tgz", + "integrity": "sha512-QS7ls/u9TLcsXFRVEDsMz8xblt9v++8K6ZNCWqZ44Q29Ou1SJbD+x3w9Y2V4IfXrjiX9gAVJCqxINT5f2q8dtA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.65.0-alpha-2026-10-30" + "playwright": "1.66.0-alpha-1793916328000" }, "bin": { "playwright": "cli.js" @@ -50,12 +50,12 @@ } }, "node_modules/playwright": { - "version": "1.65.0-alpha-2026-10-30", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.0-alpha-2026-10-30.tgz", - "integrity": "sha512-dmAJMVHKzHvMQjn+XDcaq/pxaZ0W6n8i78rwTM+VGRtQ3WBF5ZiSdB1yL/cyoYUGUMwg3jxN65KqC9cERaCbIg==", + "version": "1.66.0-alpha-1793916328000", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.66.0-alpha-1793916328000.tgz", + "integrity": "sha512-u9J3rzCxyauiVQAIbq99RRTLEpkiXp4TcCRJdUD7rW4UYJs+X9r3a1+7ZG60To+KzSsCHhFHUHMYazu/di/tpA==", "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.65.0-alpha-2026-10-30" + "playwright-core": "1.66.0-alpha-1793916328000" }, "bin": { "playwright": "cli.js" @@ -65,9 +65,9 @@ } }, "node_modules/playwright-core": { - "version": "1.65.0-alpha-2026-10-30", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.0-alpha-2026-10-30.tgz", - "integrity": "sha512-LPMw8B/HRQKMcJeXTqWSrkB/AfCKKmbDQMbu0p7zg8MgibOWaKMjZWR/StAtrQkOxvOmZEju1o1TnPgdoOCwrg==", + "version": "1.66.0-alpha-1793916328000", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.66.0-alpha-1793916328000.tgz", + "integrity": "sha512-XmuuhERYz849dehuX7rDZmOwOLmNiC3thuGXzf9SqTg3hHBPA993uTu7y1aOj83l6rHq3g3/thp5XaNrEik/VQ==", "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 14869711..78f10d5b 100644 --- a/package.json +++ b/package.json @@ -18,12 +18,12 @@ "test": "playwright test" }, "devDependencies": { - "@playwright/test": "1.65.0-alpha-2026-10-30", + "@playwright/test": "1.66.0-alpha-1793916328000", "@types/node": "^25.2.1" }, "dependencies": { - "playwright": "1.65.0-alpha-2026-10-30", - "playwright-core": "1.65.0-alpha-2026-10-30" + "playwright": "1.66.0-alpha-1793916328000", + "playwright-core": "1.66.0-alpha-1793916328000" }, "bin": { "playwright-cli": "playwright-cli.js" diff --git a/playwright-cli.js b/playwright-cli.js index b3bdb4ea..8e9d23fb 100755 --- a/playwright-cli.js +++ b/playwright-cli.js @@ -21,7 +21,7 @@ const fs = require('fs'); const path = require('path'); const { spawn } = require('child_process'); -const { program } = require('playwright-core/lib/tools/cli-client/program'); +const { parseArgs, program } = require('playwright-core/lib/tools/cli-client/program'); const coreBundle = require('playwright-core/lib/coreBundle'); const { tools, registry } = coreBundle; const { checkInstalledSkills, frame } = require('./skillCheck'); @@ -34,16 +34,21 @@ const UPDATE_CHECK_COMMANDS = new Set(['open', 'attach', 'list', 'install', 'ins main(); async function main() { - await checkForUpdates().catch(() => {}); - program({ embedderVersion: packageJson.version }); + // Parse once and inspect the arguments before program() runs, as it may mutate them. + const args = parseArgs(process.argv.slice(2)); + await checkForUpdates(args).catch(() => {}); + await program({ args, embedderVersion: packageJson.version }); } -async function checkForUpdates() { +/** + * @param {ReturnType} args + */ +async function checkForUpdates(args) { if (process.env.NO_UPDATE_NOTIFIER || process.env.CI) return; // The check spawns npm, so keep its cost to the commands that start a workflow. - const command = process.argv.slice(2).find(arg => !arg.startsWith('-')); + const command = args._[0]; if (!command || !UPDATE_CHECK_COMMANDS.has(command)) return; diff --git a/skills/playwright-cli/references/running-code.md b/skills/playwright-cli/references/running-code.md index 5bf7e8cf..565eefdb 100644 --- a/skills/playwright-cli/references/running-code.md +++ b/skills/playwright-cli/references/running-code.md @@ -218,6 +218,8 @@ playwright-cli run-code "async page => { }" ``` +Event listener errors are reported as console errors. + ## Complex Workflows ```bash diff --git a/tests/integration.spec.ts b/tests/integration.spec.ts index db73783a..72e58313 100644 --- a/tests/integration.spec.ts +++ b/tests/integration.spec.ts @@ -190,7 +190,8 @@ test('update check asks npm for the latest version on setup commands only', asyn })); expect(npmRegistry.requests).toEqual([]); - expect(await runCli(['list'], env)).toEqual(expect.objectContaining({ + // The command is recognized behind the global options. + expect(await runCli(['--session', 'foo', 'list'], env)).toEqual(expect.objectContaining({ error: expect.stringContaining('Update available for @playwright/cli'), exitCode: 0, }));