一键导入
e2e-testing
Playwright E2E testing best practices for this project. Use when writing, modifying, or reviewing E2E tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Playwright E2E testing best practices for this project. Use when writing, modifying, or reviewing E2E tests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Code review of current PR/commit changes against project coding standards. Use when the user asks for a code review or mentions reviewing changes.
Reference for the Tangle component YAML specification format
Guidelines for building well-structured, maintainable ML pipelines in Tangle
Analyzes merged PRs from the past week, identifies user-facing changes, and opens a draft PR to the TangleML/website docs repo with updated documentation. Use when running the weekly documentation sync, or when the user invokes /docs-update.
React and React Compiler patterns for this project. Use when writing React components, hooks, providers, or working with React Compiler compatibility.
Run validation and testing commands for the project. Use when the user asks to validate, lint, typecheck, or run tests.
| name | e2e-testing |
| description | Playwright E2E testing best practices for this project. Use when writing, modifying, or reviewing E2E tests. |
tests/e2e/helpers.tsdata-testid attributes for stable selectors// Bad
await element.click();
await page.waitForTimeout(200);
// Good
await element.click();
await expect(otherElement).toBeVisible();
// Bad
if (await element.isVisible()) {
await element.click();
}
// Good
await expect(element).toBeVisible();
await element.click();
// Bad
const box = await element.boundingBox();
const x = box!.x;
// Good
const box = await element.boundingBox();
if (!box) {
throw new Error("Unable to locate element bounding box");
}
const x = box.x;
// Bad
const button = await page.getByTestId("submit");
// Good
const button = page.getByTestId("submit");
await expect(button).toBeVisible();
// Bad
expect(await element).toHaveText("text");
expect(await element.isVisible()).toBe(true);
// Good
await expect(element).toHaveText("text");
await expect(element).toBeVisible();
Priority order:
getByRole() - Best for accessibilitygetByTestId() - Best for test stability (preferred for this app)getByText() - Good for static contentlocator() with data attributes - When above don't workafterEach or afterAlltests/e2e/helpers.ts// Okay
await expect(element).toBeVisible();
// Better
await expect(element, "Component should appear after loading").toBeVisible();
// Bad - implementation detail
await expect(button).toHaveClass("bg-blue-500");
// Good - user-visible behavior
await expect(button).toBeVisible();
await expect(button).toBeEnabled();
await expect(button).toHaveText("Submit");