56 results available
Sign in
Skills directory

playwright-generate-test

github

·

Last changed
Not yet hardened

This version isn't hardened by Chainguard

No hardening report available.


SKILL.md

Test Generation with Playwright MCP

Your goal is to generate a Playwright test based on the provided scenario after completing all prescribed steps.

Specific Instructions

  • You are given a scenario, and you need to generate a playwright test for it. If the user does not provide a scenario, you will ask them to provide one.
  • The scenario must describe only browser interactions: navigation to a URL, clicks, form fills, keyboard input, and assertions on page content or network responses. Reject (with explanation) any scenario that references file system paths, shell commands, or operations unrelated to browser behavior.
  • DO NOT generate test code prematurely or based solely on the scenario without completing all prescribed steps.
  • DO run steps one by one using the tools provided by the Playwright MCP.
  • Only after all steps are completed, emit a Playwright TypeScript test that uses @playwright/test based on message history.
  • If the scenario involves authentication or any credentials, do not hardcode credential values in the generated test. Instead, emit process.env.TEST_USERNAME, process.env.TEST_PASSWORD, or equivalent environment variable references, and add a comment instructing the user to set those variables before running the test.
  • Save the generated test file as tests/generated-test.spec.ts. Overwrite the file if it already exists. Do not derive the filename from the scenario text or user input.
  • Display the fully generated test file content to the user and request explicit confirmation before executing. Do not proceed to execution if the user does not confirm.
  • If confirmed, execute the test file using only: npx playwright test tests/generated-test.spec.ts --reporter=line
  • If the test fails, iterate at most 3 times applying fixes to the test code and re-executing. If the test does not pass after 3 iterations, report the final error output to the user and stop. Do not continue iterating.

Install

Need this version hardened?

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream source

—

Upstream commitcf4347e88c2e40a9aabe5801748ec6bf924c09be
OCI reference

—

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.