Skip to content
Back to skills

E2e Playwright

ASecurity

Best practices for E2E testing with Playwright, focusing on Angular 20, Firebase Emulators, and Architecture Guards.

  • 225 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 4, 2026
testingtypescriptgoangulartesting

Works with

  • cli

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add NeverSight/skills_feed --skill e2e-playwright --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of E2e Playwright?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for E2e Playwright
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/neversight-e2e-playwright/badge)](https://www.skillsdirectory.com/skills/neversight-e2e-playwright)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: e2e-playwright
description: Best practices for E2E testing with Playwright, focusing on Angular 20, Firebase Emulators, and Architecture Guards.
---

# Playwright E2E Testing Skill

## 🎯 Purpose
Provide patterns for robust end-to-end testing in the Black-Tortoise ecosystem, ensuring that user journeys and architectural boundaries are verified.

## 🛠️ Core Patterns

### 1. Test Organization
- **Base URL:** Defined in `playwright.config.ts`.
- **Naming:** `.spec.ts` files under `e2e/`.
- **Parallelism:** Tests should be independent to allow parallel execution.

### 2. Firebase Emulator Integration
Tests should run against local emulators to ensure speed and isolation.

```typescript
// e2e/auth.spec.ts
import { test, expect } from '@playwright/test';

test.beforeEach(async ({ page }) => {
  // Reset emulator state or seed data via GQL mutations
  await page.goto('/');
});

test('should login successfully', async ({ page }) => {
  await page.getByLabel('Email').fill('test@example.com');
  await page.getByLabel('Password').fill('password123');
  await page.getByRole('button', { name: 'Login' }).click();
  
  await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
});
```

### 3. Architecture Guard Verification
Verification of the `architecture:gate` can be automated as part of the test suite or CI.

```typescript
// Example of checking for console errors or network violations
test('should not have console errors', async ({ page }) => {
  const logs: string[] = [];
  page.on('console', msg => {
    if (msg.type() === 'error') logs.push(msg.text());
  });
  
  await page.goto('/workspace');
  expect(logs.length).toBe(0);
});
```

### 4. Custom Selectors (MANDATORY)
- **REQUIRED:** Use `data-testid` for stable selection of components.
- **REQUIRED:** Prefer ARIA roles (`getByRole`, `getByLabel`) to ensure a11y.
- **FORBIDDEN:** Selecting by brittle CSS classes or deep DOM structures.

## 🚀 Execution Commands

- **Run all:** `pnpm e2e`
- **UI Mode:** `pnpm exec playwright test --ui`
- **Debug:** `pnpm exec playwright test --debug`

## 🔐 Architecture Gate (dependency-cruiser)

Black-Tortoise uses `dependency-cruiser` to enforce DDD boundaries.
- **Rule:** Presentation cannot import Domain directly.
- **Rule:** Application cannot import Infrastructure.
- **Check:** `pnpm run architecture:gate` should be part of the pre-commit hook (Husky).

Files in this skill

  • SKILL.md2.4 KB
  • description_ar.txt151 B
  • description_cn.txt124 B
  • description_de.txt123 B
  • description_en.txt117 B
  • description_es.txt122 B
  • description_fr.txt140 B
  • description_it.txt117 B
  • description_ja.txt182 B
  • description_ko.txt139 B
  • description_ru.txt206 B
  • description_tw.txt124 B
  • stats.json65 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.