Skip to content

Improve Playwright browser provisioning guidance - #58791

Merged
pelikhan merged 5 commits into
mainfrom
copilot/improve-playwright-support
Sep 5, 2026
Merged

Improve Playwright browser provisioning guidance#58791
pelikhan merged 5 commits into
mainfrom
copilot/improve-playwright-support

Conversation

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Playwright workflows can redundantly install browser engines instead of using the compiler-managed browsers field. This adds clearer guidance and detects unnecessary installation steps.

  • Guidance

    • Document Chromium as the default engine.
    • Show how to provision additional supported engines.
    tools:
      playwright:
        browsers: [chromium, firefox, webkit]
  • Compiler

    • Warn when custom steps run Playwright browser installation commands.
    • Recognize npm, npx, pnpm, Yarn, Bun, and direct Playwright invocations across all custom step phases.
    • Recommend removing those commands and using tools.playwright.browsers.
  • Coverage

    • Add focused warning and compilation tests.
    • Add a patch changeset.

Copilot AI and others added 4 commits September 5, 2026 10:27
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Comment thread .github/aw/playwright.md Outdated
browsers: [chromium, firefox, webkit]
```

Supported values are `chrome`, `chromium`, `firefox`, and `webkit`. Do not add

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot there is a chrome-for-test distribution, search the full list

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added chrome-for-testing as a supported browsers alias and documented that Playwright's chromium target installs the Chrome for Testing distribution. I also checked the pinned Playwright CLI's full install-target list and kept system channels/platform-specific tools out of this portable engine field. Addressed in fbc34c0.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan September 5, 2026 11:11
@pelikhan
pelikhan marked this pull request as ready for review September 5, 2026 11:11
Copilot AI balanced review requested due to automatic review settings September 5, 2026 11:11
@pelikhan
pelikhan merged commit e573aa6 into main Sep 5, 2026
@pelikhan
pelikhan deleted the copilot/improve-playwright-support branch September 5, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The matcher misses valid npx -y and bun x browser-install commands.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves compiler-managed Playwright browser provisioning guidance and warns about redundant installation steps.

Changes:

  • Adds browser-install command detection across custom step phases.
  • Adds chrome-for-testing as a Chromium alias.
  • Updates tests, documentation, schema, and release notes.
File summaries
File Description
pkg/workflow/playwright_validation.go Adds alias validation and install warnings.
pkg/workflow/playwright_validation_test.go Tests warnings and compilation.
pkg/workflow/playwright_cli_test.go Tests alias normalization.
pkg/workflow/compiler_validators.go Invokes the new warning.
pkg/parser/schemas/main_workflow_schema.json Adds the browser alias.
docs/src/content/docs/reference/playwright.md Documents browser provisioning.
docs/src/content/docs/reference/frontmatter-full.md Updates generated field guidance.
.github/aw/playwright.md Expands authoring guidance.
.changeset/improve-playwright-browser-guidance.md Records the patch change.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

"github.com/goccy/go-yaml"
)

var playwrightBrowserInstallPattern = regexp.MustCompile(`(?im)(?:^|&&|\|\||;)[ \t]*(?:(?:npx|npm[ \t]+(?:exec|x)|pnpm[ \t]+(?:exec|dlx)|yarn(?:[ \t]+(?:exec|dlx))?|bunx)[ \t]+(?:(?:--yes|--no-install|--)[ \t]+)*)?playwright(?:@[^\s;&|]+)?[ \t]+install(?:[ \t]|$)`)
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.88.5

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.

3 participants