cosmicstack-labs/e2e-testing
Playwright and Cypress patterns, selectors, assertions, API mocking, visual testing, and CI/CD
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill e2e-testing
End-to-end testing with Playwright and Cypress.
| Factor | Playwright | Cypress |
|--------|-----------|---------|
| Language | JS/TS, Python, C#, Java | JS/TS only |
| Browser support | Chromium, Firefox, WebKit | Chromium, Firefox, WebKit |
| Iframe support | Native | Limited |
| Network mocking | Route API | intercept() |
| Parallel execution | Built-in | Dashboard required |
getByRole() — best for accessibilitygetByText() — for text contentgetByTestId() — for complex componentsgetByLabel() — for form fieldslocator(CSS) — last resorttest.describe('Checkout Flow', () => {
test('completes purchase with valid card', async ({ page }) => {
await page.goto('/products');
await page.getByText('Add to Cart').first().click();
await page.getByRole('button', { name: 'Checkout' }).click();
await page.getByLabel('Card Number').fill('4242424242424242');
await page.getByRole('button', { name: 'Pay' }).click();
await expect(page.getByText('Thank you')).toBeVisible();
});
});
await expect(page).toHaveScreenshot()# GitHub Actions
- name: E2E Tests
run: npx playwright test
- uses: actions/upload-artifact
if: failure()
with:
name: playwright-report
path: playwright-report/
Take cosmicstack-labs/e2e-testing from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference npx.
Without those the skill loads but fails at the first command.