askill
playwright-testing

playwright-testingSafety --Repository

Playwright E2E testing for Oh My Brand! theme. Browser automation, accessibility testing, visual regression, and block editor workflows. Use when writing end-to-end tests.

0 stars
1.2k downloads
Updated 1/10/2026

Package Files

Loading files...
SKILL.md

Playwright Testing

End-to-end testing with Playwright for the Oh My Brand! WordPress FSE theme.


When to Use

  • Testing block frontend behavior in real browsers
  • Accessibility compliance testing
  • Visual regression testing
  • Block editor insertion and configuration workflows

Configuration

See playwright.config.ts for the full configuration template.

PropertyValueDescription
testDir./tests/e2eTest files location
baseURLhttp://localhost:8888wp-env URL
traceon-first-retryDebug failed tests
screenshotonly-on-failureCapture failures

Browser Projects

ProjectDevicePurpose
chromiumDesktop ChromePrimary testing
webkitDesktop SafarimacOS/iOS
mobile-chromePixel 5Android mobile
mobile-safariiPhone 12iOS mobile

Test Templates

Frontend Block Tests

TemplatePurpose
gallery-block.spec.tsGallery carousel tests (visibility, navigation, button states)
keyboard-navigation.spec.tsArrow keys, Escape, focus handling
faq-block.spec.tsAccordion expand/collapse, exclusive behavior

Accessibility Tests

TemplatePurpose
accessibility.spec.tsAxe-core WCAG compliance (wcag2a, wcag2aa, wcag21aa)
focus-management.spec.tsARIA labels, live regions, focus trapping

Visual Testing

TemplatePurpose
visual-regression.spec.tsScreenshot snapshots, responsive layouts

Block Editor Tests

TemplatePurpose
block-editor.spec.tsInsert block, configure settings, media upload, preview

Common Patterns

Page Navigation

test.beforeEach(async ({ page }) => {
    await page.goto('/gallery-page/');
});

Element Selection

// By class
const gallery = page.locator('.wp-block-theme-oh-my-brand-gallery');

// By data attribute
const button = page.locator('[data-gallery-next]');

// By role
const dialog = page.locator('dialog');

Assertions

await expect(element).toBeVisible();
await expect(element).toBeDisabled();
await expect(element).toHaveAttribute('aria-label');
await expect(element).toHaveScreenshot('name.png');

Wait Patterns

// Animation completion
await page.waitForTimeout(350);

// Element state
await page.waitForSelector('.editor-styles-wrapper');

Accessibility with Axe

import AxeBuilder from '@axe-core/playwright';

const results = await new AxeBuilder({ page })
    .include('.wp-block-theme-oh-my-brand-gallery')
    .withTags(['wcag2a', 'wcag2aa'])
    .analyze();

expect(results.violations).toEqual([]);

Running Tests

CommandPurpose
pnpm run test:e2eRun all E2E tests
pnpm run test:e2e:uiInteractive UI mode
pnpm run test:e2e -- --project=chromiumSpecific browser
pnpm run test:e2e -- --headedVisible browser
pnpm run test:e2e -- --debugDebug mode
pnpm run test:e2e -- --update-snapshotsUpdate visual snapshots

Related Skills


References

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

AI review pending.

Metadata

Licenseunknown
Version-
Updated1/10/2026
PublisherWesleySmits

Tags

apigithubtesting