Skip to content

fix(agents): add missing parentheses in test-generator example - #42744

Merged
Devin Rousso (dcrousso) merged 1 commit into
microsoft:mainfrom
avgon:fix/agent-md-syntax
Sep 17, 2026
Merged

Devin Rousso (dcrousso) merged 1 commit into
microsoft:mainfrom
avgon:fix/agent-md-syntax

Conversation

@avgon

Copy link
Copy Markdown
Contributor

Fixes the invalid TypeScript syntax in the agent example that causes AI agents to reproduce the error in generated test output.

Change

async { page } => -> async ({ page }) => in playwright-test-generator.agent.md

The destructured parameter needs parentheses. Without them, this is a syntax error that gets pattern-matched by agents and reproduced in every generated spec.

Fixes #42743

`async { page } =>` is a syntax error; the destructured parameter
needs parentheses: `async ({ page }) =>`.

This is the only concrete example of a generated spec in
playwright-test-generator.agent.md, so agents pattern-match
against it and reproduce the invalid syntax in their output.

Fixes microsoft#42743
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [firefox-library] › library/browsercontext-storage-state.spec.ts:453 › should work when service worker is intefering and the origin is not open @firefox-ubuntu-22.04-node20

7 flaky ⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:213 › should intercept service worker requests (main and within) `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:495 › screencast › should capture static page in persistent context Radoslav Kirilov (@smoke) `@chromium-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-event-request.spec.ts:181 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node20`

51720 passed, 1247 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

3 failed
❌ [firefox] › mcp/cli-core.spec.ts:262 › click button with CSS selector @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-core.spec.ts:276 › click button with role locator @mcp-windows-latest-firefox
❌ [firefox] › mcp/cli-session.spec.ts:54 › idle timeout shuts the session down @mcp-windows-latest-firefox

8561 passed, 1446 skipped


Merge workflow run.

@dcrousso
Devin Rousso (dcrousso) merged commit 24b6932 into microsoft:main Sep 17, 2026
43 of 45 checks passed
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.

[Bug]: playwright-test-generator.agent.md contains invalid TypeScript in its example (sync { page } =>)

2 participants