Skip to content

chore(deps): bump Playwright to 1.61 and vendor recorder codegen#1151

Open
shahzad31 wants to merge 1 commit into
mainfrom
chore/bump-playwright-1.61
Open

chore(deps): bump Playwright to 1.61 and vendor recorder codegen#1151
shahzad31 wants to merge 1 commit into
mainfrom
chore/bump-playwright-1.61

Conversation

@shahzad31

Copy link
Copy Markdown
Contributor

Summary

Bumps playwright / playwright-chromium / playwright-core from 1.58.2 to 1.61.0.

Playwright 1.61 bundles its server code into coreBundle.js and no longer exports the recorder's codegen classes, so the existing playwright-core/lib/server/codegen/javascript deep import in src/formatter/javascript.ts stops resolving (TS2307). This vendors the minimal slice SyntheticsGenerator extends — JavaScriptLanguageGenerator._asLocator / ._generateActionCall and JavaScriptFormatter — into src/formatter/codegen.ts, reusing Playwright's still-exported iso helpers (asLocator / formatObject / escapeWithQuotes) instead of vendoring the heavy locator logic.

Why

Prerequisite for #997 (multi-step API journeys), which uses the native APIResponse.securityDetails() / APIResponse.serverAddr() APIs added in Playwright 1.61 (microsoft/playwright#40932). Splitting the bump + codegen fix out keeps that PR focused on the feature.

Changes

  • package.json / package-lock.json: Playwright 1.58.21.61.0.
  • src/formatter/codegen.ts (new): vendored JavaScriptLanguageGenerator (minimal) + JavaScriptFormatter, adapted from playwright-core (Apache-2.0, © Microsoft Corporation).
  • src/formatter/javascript.ts: import the codegen classes from the vendored module instead of the removed deep path.
  • __tests__/options.test.ts: refresh the device-descriptor Chrome UA string that 1.61's bundled descriptors updated (145.0.7632.6149.0.7827.55).

Test plan

  • tsc clean
  • __tests__/formatter/javascript.test.ts — recorder codegen snapshots unchanged (7/7)
  • full unit suite + lint + prettier green

…ting it

Playwright 1.61 bundles its server code into coreBundle.js and no longer
ships the codegen classes as importable modules, so the recorder's
`playwright-core/lib/server/codegen/javascript` deep import no longer
resolves. Vendor the minimal slice SyntheticsGenerator extends
(_asLocator + _generateActionCall + JavaScriptFormatter) into
src/formatter/codegen.ts, reusing the still-exported `iso` helpers
(asLocator / formatObject / escapeWithQuotes) rather than vendoring the
heavy locator logic. Formatter snapshots are unchanged.

Also bump playwright/-chromium/-core to 1.61.0 (required for the native
APIResponse TLS APIs) and refresh the device-descriptor Chrome UA in the
options test that 1.61's bundled descriptors updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants