generate
यह क्या करती है
यह स्किल एजेंट से आपके ऐप के लिए एंड-टू-एंड ब्राउज़र टेस्ट लिखवाती है। यह उन डेवलपर्स के लिए है जिन्हें लॉगिन, चेकआउट, फ़ॉर्म या दूसरे फ़ीचर के टेस्ट खाली फ़ाइल से शुरू किए बिना चाहिए।
कब इस्तेमाल करें
- ✓जब आप लॉगिन या साइनअप फ़्लो के लिए टेस्ट लिखवाना चाहते हों।
- ✓जब आपने अभी बनाए पेज, कंपोनेंट या फ़ीचर के लिए टेस्ट चाहिए।
- ✓जब आप यूज़र स्टोरी को ब्राउज़र टेस्ट में बदलना चाहते हों।
Skill का लिंक
https://github.com/alirezarezvani/claude-skills/blob/main/engineering-team/playwright-pro/skills/generate/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“Playwright टेस्ट लिखिए उस यूज़र के लिए जो ईमेल पते और पासवर्ड से लॉगिन करता है।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट आपकी टेस्ट सेटिंग्स और मौजूदा टेस्ट पढ़ता है ताकि आपकी शैली से मेल खा सके, फिर लक्ष्य पेज या कंपोनेंट पढ़ता है। वह एक मिलता-जुलता टेम्पलेट चुनता है और आपके बताए व्यवहार के लिए टेस्ट लिखता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Generate Playwright Tests
Generate production-ready Playwright tests from a user story, URL, component name, or feature description.
Input
$ARGUMENTS contains what to test. Examples:
"user can log in with email and password""the checkout flow""src/components/UserProfile.tsx""the search page with filters"
Steps
1. Understand the Target
Parse $ARGUMENTS to determine:
- User story: Extract the behavior to verify
- Component path: Read the component source code
- Page/URL: Identify the route and its elements
- Feature name: Map to relevant app areas
2. Explore the Codebase
Use the Explore subagent to gather context:
- Read
playwright.config.tsfortestDir,baseURL,projects - Check existing tests in
testDirfor patterns, fixtures, and conventions - If a component path is given, read the component to understand its props, states, and interactions
- Check for existing page objects in
pages/ - Check for existing fixtures in
fixtures/ - Check for auth setup (
auth.setup.tsorstorageStateconfig)
3. Select Templates
Check templates/ in this plugin for matching patterns:
| If testing... | Load template from |
|---|---|
| Login/auth flow | ../pw/templates/auth/login.md |
| CRUD operations | templates/crud/ |
| Checkout/payment | templates/checkout/ |
| Search/filter UI | templates/search/ |
| Form submission | templates/forms/ |
| Dashboard/data | templates/dashboard/ |
| Settings page | templates/settings/ |
| Onboarding flow | templates/onboarding/ |
| API endpoints | templates/api/ |
| Accessibility | templates/accessibility/ |
Adapt the template to the specific app — replace {{placeholders}} with actual selectors, URLs, and data.
4. Generate the Test
Follow these rules:
Structure:
import { test, expect } from '@playwright/test';
// Import custom fixtures if the project uses them
test.describe('Feature Name', () => {
// Group related behaviors
test('should <expected behavior>', async ({ page }) => {
// Arrange: navigate, set up state
// Act: perform user action
// Assert: verify outcome
});
});
Locator priority (use the first that works):
getByRole()— buttons, links, headings, form elementsgetByLabel()— form fields with labelsgetByText()— non-interactive text contentgetByPlaceholder()— inputs with placeholder textgetByTestId()— when semantic options aren't available
Assertions — always web-first:
// GOOD — auto-retries
await expect(page.getByRole('heading')).toBeVisible();
await expect(page.getByRole('alert')).toHaveText('Success');
// BAD — no retry
const text = await page.textContent('.msg');
expect(text).toBe('Success');
Never use:
page.waitForTimeout()page.$(selector)orpage.$$(selector)- Bare CSS selectors unless absolutely necessary
page.evaluate()for things locators can do
Always include:
- Descriptive test names that explain the behavior
- Error/edge case tests alongside happy path
- Proper
awaiton every Playwright call baseURL-relative navigation (page.goto('/')notpage.goto('http://...'))
5. Match Project Conventions
- If project uses TypeScript → generate
.spec.ts - If project uses JavaScript → generate
.spec.jswithrequire()imports - If project has page objects → use them instead of inline locators
- If project has custom fixtures → import and use them
- If project has a test data directory → create test data files there
6. Generate Supporting Files (If Needed)
- Page object: If the test touches 5+ unique locators on one page, create a page object
- Fixture: If the test needs shared setup (auth, data), create or extend a fixture
- Test data: If the test uses structured data, create a JSON file in
test-data/
7. Verify
Run the generated test:
npx playwright test <generated-file> --reporter=list
If it fails:
- Read the error
- Fix the test (not the app)
- Run again
- If it's an app issue, report it to the user
Output
- Generated test file(s) with path
- Any supporting files created (page objects, fixtures, data)
- Test run result
- Coverage note: what behaviors are now tested
अक्सर पूछे जाने वाले सवाल
क्या यह मेरे प्रोजेक्ट की मौजूदा टेस्ट शैली का पालन करती है?
हाँ। कुछ भी लिखने से पहले यह आपकी कॉन्फ़िग, मौजूदा टेस्ट, पेज ऑब्जेक्ट और फ़िक्स्चर जाँचती है।
शुरू करने के लिए मुझे क्या देना चाहिए?
एक यूज़र स्टोरी, पेज का पता, कंपोनेंट फ़ाइल का पथ या फ़ीचर का छोटा विवरण।
क्या मुझे लिखे गए टेस्ट की समीक्षा करनी चाहिए?
हाँ। स्किल सलाह देती है कि कमिट से पहले pw-review जाँच चलाएँ, क्योंकि यह आम लोकेटर और गुणवत्ता की समस्याएँ पकड़ती है।
जानकारी
लेखक का मूल विवरण
Use when asked to write Playwright or e2e tests for a page, component or feature ('write tests', 'add tests for', 'e2e test').
लोकप्रियता
- GitHub स्टार
- 29k
- रैंकिंग में स्थान
- #9475
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-launcher-orchestrator
29kआपके एजेंट को एक साफ़ लक्ष्य से शुरू करके, अपने खाते में Claude मैनेज्ड एजेंट की योजना बनाने, बनाने, जांचने और शेड्यूल करने में चरण-दर-चरण मदद करती है।
grade-iterate
29kआपके एजेंट को किसी मैनेज्ड AI एजेंट के काम को रूब्रिक से आंकने और तय संख्या के दौरों में सुधारने देती है, ताकि वह कभी अनंत चक्र में न फंसे।
interview
29kआपके एजेंट को AI एजेंट के विचार पर आपसे इंटरव्यू लेने और कुछ भी लॉन्च होने से पहले आपके जवाबों को सरल निर्माण योजना में बदलने देती है।
run-without-you
29kआपके एजेंट को मैनेज्ड AI एजेंट शेड्यूल पर या किसी घटना पर चलाने में मदद करती है, लॉन्च से पहले cron समय की जांच के साथ।
मिलती-जुलती skills
test-driven-development
311kयह आपके एजेंट को किसी भी फ़ीचर या सुधार से पहले पहले असफल होने वाला टेस्ट लिखना, उसे असफल होते देखना, फिर पास करने वाला सबसे छोटा कोड लिखना सिखाती है।
verification-before-completion
311kयह आपके एजेंट को किसी काम, सुधार या build के पूरा या पास होने का दावा करने से पहले असली जांच चलाकर उसका आउटपुट पढ़ना सिखाती है।
migrate-to-shoehorn
310kआपकी टेस्ट फ़ाइलों में जोखिम भरे type casts की जगह shoehorn लाइब्रेरी लगाती है, ताकि टेस्ट अधूरे डेटा से भी type checks पास कर सकें।