一键导入
playwright-e2e
escrever ou atualizar testes end-to-end com Playwright neste projeto, garantindo trace, screenshot, vídeo e asserções consistentes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
escrever ou atualizar testes end-to-end com Playwright neste projeto, garantindo trace, screenshot, vídeo e asserções consistentes
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when the user asks for image, video, music, 3D, audio, or LLM generation backed by the PiAPI inference platform (https://piapi.ai). Covers Midjourney, Suno, Kling, Luma, Hailuo, Flux, Hunyuan, Faceswap, Trellis, MMAudio, F5-TTS, Veo 3, Gemini 2.5 Flash Image, and Seedance via a single unified `POST /api/v1/task` envelope. The CLI also wraps the OpenAI- compatible `POST /v1/chat/completions` LLM surface.
Image, video, music, 3D, audio, and LLM generation via PiAPI. Wraps the unified `POST /api/v1/task` envelope plus the OpenAI-compatible `POST /v1/chat/completions` LLM proxy.
PiAPI inference gateway — image, video, music, 3D, audio, and LLM generation through one async-task envelope and an OpenAI-compatible LLM proxy.
Portable, agent-agnostic spec for the PiAPI inference gateway. Single async-task envelope at `POST /api/v1/task` aggregates Midjourney, Flux, Kling, Luma, Hailuo, Veo 3, Suno, Hunyuan, MMAudio, F5-TTS, Trellis, Gemini Nano Banana, Seedance, and Faceswap. `POST /v1/chat/completions` is an OpenAI-compatible LLM proxy. Auth header is `x-api-key`.
Generate images, video, music, 3D, audio, and chat completions through PiAPI's unified async-task gateway. Aggregates Midjourney, Flux, Kling, Luma, Hailuo, Veo 3, Suno, Hunyuan, MMAudio, F5-TTS, Trellis, Gemini Nano Banana, Seedance, and Faceswap behind a single `POST /api/v1/task` envelope, plus an OpenAI-compatible `POST /v1/chat/completions` LLM proxy.
PiAPI inference gateway. One unified `POST /api/v1/task` envelope for Midjourney, Flux, Kling, Luma, Hailuo, Veo 3, Suno, Hunyuan, MMAudio, F5-TTS, Trellis, Gemini Nano Banana, Seedance, and Faceswap. Plus an OpenAI-compatible `POST /v1/chat/completions` LLM proxy.
| name | playwright-e2e |
| description | escrever ou atualizar testes end-to-end com Playwright neste projeto, garantindo trace, screenshot, vídeo e asserções consistentes |
playwright-e2ePadrão para criar e atualizar testes E2E com Playwright. Garante que toda mudança que afeta UI ou fluxo crítico tenha cobertura, evidência salva e asserções determinísticas — sem sleep arbitrário, sem mock pra fazer passar.
test(...).tests/e2e/<feature>.spec.ts. Nome em kebab-case casando com a feature (ex.: tests/e2e/login.spec.ts).test, expect) e qualquer fixture customizada do projeto (tests/e2e/fixtures/).test.describe com nome legível (ex.: Login flow). Agrupe cenários relacionados.await expect(...). Asserte URL, DOM visível e textos esperados — não asserte só ausência de erro.playwright.config.ts já liga trace: 'on', screenshot: 'only-on-failure' e video: 'on-first-retry'. Não desligue isso por teste.npx playwright test tests/e2e/<feature>.spec.ts --reporter=list. Verifique HTML report em playwright-report/..spec.ts. Não commite test-results/ nem playwright-report/ (estão no .gitignore).<feature>.spec.ts, <feature>.<sub>.spec.ts para sub-fluxos longos.tests/e2e/. Page Objects em tests/e2e/pages/<Page>.ts.getByRole, getByLabel, getByTestId. Evite locator('div.classe123') — frágil.await page.waitForTimeout(ms). Use await expect(locator).toBeVisible(), toHaveURL, toHaveText.await expect(...).toBeVisible() em vez de if (locator.isVisible()). Auto-retry built-in.test.beforeEach para login/seed; test.afterEach só se realmente precisar limpar.crypto.randomUUID()) para evitar colisão entre runs paralelos.375x667), tablet (768x1024) e desktop (1280x800) quando o layout muda.locale no test.use({ locale: 'pt-BR' }) ou rode como projeto.console.log deixado nos specs. Use test.info().annotations se precisar anotar.npx playwright test tests/e2e/<feature>.spec.ts.test-results/ (trace, screenshot, vídeo conforme config).playwright-report/ e validado visualmente.waitForTimeout ou sleep arbitrário no código..github/workflows/ci.yml) verde para o job playwright.import { test, expect } from '@playwright/test';
test.describe('Login flow', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/login');
});
test('user logs in with valid credentials', async ({ page }) => {
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('correct-horse-battery');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page).toHaveURL(/\/dashboard$/);
await expect(page.getByRole('heading', { name: /welcome/i })).toBeVisible();
});
test('shows error on invalid password', async ({ page }) => {
await page.getByLabel('Email').fill('user@example.com');
await page.getByLabel('Password').fill('wrong');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByRole('alert')).toContainText(/invalid credentials/i);
await expect(page).toHaveURL(/\/login$/);
});
});
playwright.config.ts (raiz do projeto). Não duplique opções no spec.test.fixme(...) até resolver — não use test.skip silenciosamente.npx playwright test --ui abre o time-travel debugger.npx playwright show-trace test-results/<trace>.zip.