Qa playwright
Skill FairMind-Gen-AI-Studio/fairmind-integration/skills/qa-playwright
Use when implementing automated testing with Playwright, including E2E tests, visual testing, or using the Playwright MCP tools for browser automation. This skill covers test patterns, selector strategies, and CI integration.From its SKILL.md
npx -y skills add FairMind-Gen-AI-Studio/fairmind-integration --skill qa-playwrightAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.3 KB, as published. Nobody here has run it
QA Testing with Playwright
Overview
This skill provides guidance for automated testing using Playwright, including E2E testing, visual regression, and browser automation via MCP tools.
Announce at start: "I'm using the qa-playwright skill for this testing implementation."
When to Use
Use this skill when:
- Writing E2E tests with Playwright
- Implementing visual regression tests
- Using Playwright MCP tools for browser automation
- Setting up test infrastructure
- Debugging flaky tests
- Integrating tests with CI/CD
Core Workflow
Step 1: Understand Test Requirements
Before writing tests:
- Review acceptance criteria from user story
- Identify critical user flows to test
- Plan test data and fixtures
- Determine visual testing needs
Step 2: Design Test Structure
- Organize tests by feature/page
- Create reusable page objects
- Plan fixture hierarchy
- Define test data strategy
Step 3: Implement Tests
Follow this order:
- Page objects - Create abstraction layer
- Fixtures - Set up reusable test data
- Tests - Write test cases
- Assertions - Verify expected behavior
- Visual tests - Add screenshot comparisons
Step 4: Integrate and Maintain
- Configure CI pipeline
- Handle test failures
- Maintain baseline screenshots
- Review and update tests
Reference Files
| File | Content | When to Use |
|---|---|---|
references/test-patterns.md | Test organization, fixtures | Test structure |
references/selectors.md | Locator strategies | Element selection |
references/visual-testing.md | Screenshot comparison | Visual regression |
references/mcp-tools.md | Playwright MCP tools | Browser automation |
references/ci-integration.md | CI/CD patterns | Pipeline setup |
Key Principles
Test Design
- Test user behavior, not implementation
- Keep tests independent and isolated
- Use meaningful test names
- Handle async operations properly
Selectors
- Prefer user-facing attributes (role, text, label)
- Avoid brittle selectors (CSS classes, XPath)
- Use data-testid for complex cases
- Keep selectors maintainable
Reliability
- Wait for conditions, not time
- Handle network requests properly
- Isolate test data
- Clean up after tests
Integration with Fairmind
When working on Fairmind tasks:
- Use
fairmind-contextskill for requirements - Check test expectations from user story
- Map acceptance criteria to test cases
- Update journal with test coverage
MCP Tools Usage
The Playwright MCP server provides browser automation:
// Navigate
mcp__playwright__browser_navigate({ url: "http://localhost:3000" })
// Take snapshot (accessibility tree)
mcp__playwright__browser_snapshot()
// Click element
mcp__playwright__browser_click({ element: "Login button", ref: "button[name='login']" })
// Fill form
mcp__playwright__browser_type({ element: "Email input", ref: "input[name='email']", text: "[email protected]" })
// Screenshot
mcp__playwright__browser_take_screenshot({ filename: "login-page.png" })
Example Usage
// Example: Login flow test
import { test, expect } from '@playwright/test';
import { LoginPage } from './pages/login.page';
test.describe('Authentication', () => {
let loginPage: LoginPage;
test.beforeEach(async ({ page }) => {
loginPage = new LoginPage(page);
await loginPage.goto();
});
test('successful login redirects to dashboard', async ({ page }) => {
await loginPage.login('[email protected]', 'password123');
await expect(page).toHaveURL('/dashboard');
await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
});
test('invalid credentials shows error', async () => {
await loginPage.login('[email protected]', 'wrongpass');
await expect(loginPage.errorMessage).toBeVisible();
await expect(loginPage.errorMessage).toHaveText('Invalid credentials');
});
});
Next Steps
After completing tests:
- Run tests in CI pipeline
- Review coverage reports
- Update test documentation
- Report results to tech lead