mcpbeat

E2e Testing

cosmicstack-labs/e2e-testing

Playwright and Cypress patterns, selectors, assertions, API mocking, visual testing, and CI/CD

467 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
365
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/cosmicstack-labs/mercury-agent-skills --skill e2e-testing

The instruction itself

7 sections, as written by the author

E2E Testing

End-to-end testing with Playwright and Cypress.

Tool Choice

| 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 |

Playwright Patterns

Selector Strategy (Priority Order)

  • getByRole() — best for accessibility
  • getByText() — for text content
  • getByTestId() — for complex components
  • getByLabel() — for form fields
  • locator(CSS) — last resort

Test Structure

test.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();
  });
});

Visual Testing

  • Use await expect(page).toHaveScreenshot()
  • Maintain baseline screenshots in version control
  • Run visual tests on CI with 1% threshold
  • Use percy.io or Chromatic for cloud-based visual review

CI Integration

# GitHub Actions
- name: E2E Tests
  run: npx playwright test
- uses: actions/upload-artifact
  if: failure()
  with:
    name: playwright-report
    path: playwright-report/

How to use it

Copy the folder

Take cosmicstack-labs/e2e-testing from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

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.

Install what it needs

The instructions reference npx. Without those the skill loads but fails at the first command.