com um clique
e2e-test-generation
Create E2E tests for Chrome extension using Playwright
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
Create E2E tests for Chrome extension using Playwright
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
| name | e2e-test-generation |
| description | Create E2E tests for Chrome extension using Playwright |
data-testid and getByTestId() as the primary test selector patterndata-testid attributes to components when needed for robust test selectors@bypass/shared/tests and add local constants only when test-specificimport { test, expect } from '../fixtures/bookmark-fixture'Use this when you need to create new E2E tests or update existing tests for the Chrome extension.
I will ask clarifying questions if:
data-testid with getByTestId() (project standard, including dynamic patterns)
bookmarksPage.getByTestId('folder-item-Main');
bookmarksPage.locator('[data-testid^="bookmark-item-"]');
Accessible Role Selectors (when data-testid not available)
bookmarksPage.getByRole('button', { name: 'Add' });
bookmarksPage.getByRole('dialog', { name: 'Add folder' });
Placeholder/Label Selectors
dialog.getByPlaceholder('Enter folder name');
bookmarksPage.getByLabel('History');
Text Content (transient UI only: toasts, notifications, short labels)
bookmarksPage.getByText('Remove inner folders first');
Title/Alt Selectors (fallback when better selectors are unavailable)
bookmarksPage.getByTitle('Edit Bookmark');
bookmarksPage.getByAltText('User avatar');
[class*="Folder-module__container"], .some-generated-classdata-testid): data-folder-name, data-context-id, etc.{ name: /add/i } when { name: 'Add' } is sufficient.first(), .nth()img, div, span (use data-testid instead).evaluate() for clicks (use direct .click() instead)@bypass/shared/tests constants first; keep local constants scoped to a spec when neededtest.describe for 2+ testsOpening a dialog:
const addButton = bookmarksPage.getByRole('button', { name: 'Add' });
await addButton.click();
const dialog = bookmarksPage.getByRole('dialog', { name: 'Add folder' });
await expect(dialog).toBeVisible();
Filling a form:
await dialog.getByPlaceholder('Enter folder name').fill('Test Folder');
await dialog.getByRole('button', { name: 'Save' }).click();
await expect(dialog).toBeHidden();
Context menu:
await element.click({ button: 'right' });
const editOption = bookmarksPage.getByTestId('context-menu-item-edit');
await expect(editOption).toBeVisible();
await editOption.click();
Multi-select with keyboard:
await firstItem.click();
await secondItem.click({ modifiers: ['Meta'] }); // Cmd/Ctrl+click
Waiting for navigation:
const [newPage] = await Promise.all([
context.waitForEvent('page', { timeout: 15_000 }),
element.dblclick(),
]);
expect(newPage).toBeTruthy();
Run the test file to verify it works:
pnpm e2e apps/extension/tests/specs/<your-test-file>.spec.ts
@bypass/shared/tests where possibletest.describe only for 2+ related tests