automattic/wp-calypso/ui-testing
Claude Code and agent skill by automattic/wp-calypso
- community
Checking that the SKILL.md file is still in the repository.
Run comprehensive UI tests for the Image Studio feature. Covers Media Library entry points, Edit Mode, Generate Mode, Block Editor integration, navigation, and delete. Use when running the full UI smoke test or testing any Image Studio surface.
Install
npx vskill@latest install automattic/wp-calypso/ui-testingSKILL.md
The same SKILL.md was published earlier as automattic/wp-calypso/ui-testing.
Image Studio UI Tests
Run comprehensive UI tests for the Image Studio feature. All tests are required to pass.
Testing Strategy
Only generate one image per test run (Section 6). All other sections verify DOM state without triggering AI generation. This keeps the test run under 5 minutes instead of 20+.
- Smoke test (Section 6): One real generation to verify the end-to-end AI pipeline works
- All other sections: Verify UI elements, controls, navigation, dialogs, and entry points via DOM assertions only — no generation needed
Prerequisites
- Important: If test site is not provided, ask the user for test site URL (e.g.,
https://yoursite.wordpress.com) - If not logged in, stop and ask user to log in before proceeding
- At least 1 image uploaded to Media Library
- (Optional) A draft post with an Image block for Sections 9-10
Section Dependencies
Sections are designed to run sequentially, but some depend on others:
Setup
- Navigate to test site and log in if needed
- Go to
wp-admin/upload.php(Media Library) - Note the ID of an existing image (hover over "Edit" and check URL for
post=123)
CSS Selectors & Aria Labels Reference
Full selector tables for all elements (Modal, Sidebar, Generate Mode, Canvas, Block Editor): see references/selectors.md.
Key selectors used across most sections:
- Modal overlay:
.components-modal__screen-overlay.image-studio-overlay - Modal content:
.image-studio-modal__content - Close button:
aria-label="Close image editor" - Save button:
.image-studio-header button.is-primary - Image display:
.image-studio-image - Generate Image button:
.big-sky-image-studio-link
Automation Notes (Playwright)
When running these tests with Playwright MCP (not playwright-test):
- Verification via DOM, not screenshots: Do NOT take screenshots to verify results. Instead, use
playwright_evaluateto query the DOM for expected elements (e.g., check that.image-studio-overlayexists and hasoffsetHeight > 0). This is faster and more reliable. Useplaywright_get_visible_textorplaywright_get_visible_htmlfor content checks. - Block editor iframe: The editor content area is inside
iframe[name="editor-canvas"]. Useplaywright_iframe_click/playwright_iframe_fillfor interactions inside the editor canvas. - Image Studio modal: The modal uses
.image-studio-overlay/.image-studio-modal__contentand intercepts pointer events on background elements. Target elements inside the modal specifically. - Suggestion chips: Clicking a suggestion chip populates the textarea with an expanded prompt but does not auto-send. You must press Enter or click the send button after.
- Generation timing: Instead of fixed
sleepcalls, poll for.image-studio-imageto appear or for the loading indicator to disappear. Max wait: 50 seconds. - Generation retry rule: If no image appears by timeout (even without an explicit error), retry once with the same prompt. If retry also fails, mark as backend issue and continue.
- Style/Aspect Ratio buttons: These use dynamic module class names (
AgentUIInputToolbar-module_button). Prefer matching by text content or aria-label. - Block Editor setup order (important):
- Click Add block inside
iframe[name="editor-canvas"](inline inserter), choose Image. - Verify the Image placeholder appears in the iframe.
- For Section 9, assert/click Generate Image from that placeholder.
- For Section 10, click Select Image in that same placeholder, then choose an item in media modal and click Select before checking toolbar.
- Only assert Edit with AI after the image is actually inserted and the block is selected.
- Toolbar visibility in block editor: After inserting/selecting an image, click the image once and wait for block toolbar to render before asserting
Edit with AI. - Asserting element state: Use
playwright_evaluateto check: - Visibility:
element.offsetHeight > 0 - Disabled:
element.disabled === trueorelement.getAttribute('aria-disabled') === 'true' - Text content:
element.textContent.includes('expected text') - Existence:
document.querySelector('.selector') !== null
Section 1: Media Library Entry Points
Setup: Must be on Media Library page (wp-admin/upload.php)
| Step | Action | Expected Result | |
|---|---|---|---|
| 1.1 | Look at toolbar above media grid | "Generate Image" button visible (.big-sky-image-studio-link) | |
| 1.2 | Click "List view" toggle (icon with horizontal lines) | View switches to list/table format | |
| 1.3 | Hover mouse over any image row | Row actions appear: "Edit", "Delete Permanently", "View", "Copy URL", "Download file" AND "Edit with AI" | |
| 1.4 | Look at left sidebar navigation | "AI Editor" menu item exists below "Media" (note: this links to the site editor, not Image Studio edit mode) |
FAIL if: Any expected element is missing
Note: If 1.3 fails, use Section 8 (hash deep-link) as fallback to reach Edit Mode.
Section 2: Edit Mode
Setup: Must have image ID from Media Library. Enter via "Edit with AI" row action (Section 1.3) or hash deep-link (Section 8).
| Step | Action | Expected Result | |
|---|---|---|---|
| 2.1 | Click "Edit with AI" on any image row | Modal opens (.image-studio-overlay), header shows "Image Editor" (.image-studio-header__title) with "Beta" badge (.image-studio-badge) | |
| 2.2 | Examine modal header (.image-studio-header) | Left: nav arrows, "Media Library" button; Center: "Select" tool; Right: "Image Info" toggle, "Save" button, Close (X) (aria-label="Close image editor") | |
| 2.3 | Look at main canvas area | Selected image displayed (.image-studio-image) full-size with no crop/highlight overlays | |
| 2.4 | Click "Image Info" toggle in header | Sidebar (.image-studio-sidebar) slides in from right showing metadata fields |
FAIL if: Modal doesn't open, header elements missing, or canvas blank
Section 3: Sidebar & Metadata
Setup: Must have Edit Mode open with Image Info sidebar (.image-studio-sidebar) visible
| Step | Action | Expected Result | |
|---|---|---|---|
| 3.1 | Examine sidebar content (.image-studio-sidebar__content) | Fields: Title, Caption, Description, Alt Text, File Details section | |
| 3.2 | Look for Regenerate buttons | Each field has a sparkles/refresh icon button to its right | |
| 3.3 | Click Regenerate next to Alt Text field | Field shows loading state, then new AI-generated text appears | |
| 3.4 | Click Image Info toggle to close sidebar | Sidebar slides out, canvas expands | |
| 3.5 | Click Image Info toggle again | Sidebar reopens, edited Alt Text still shows new value |
FAIL if: Regenerate buttons missing, AI fails to generate, or edits don't persist
Section 4: Unsaved Changes Dialog
Setup: Must have Edit Mode open
| Step | Action | Expected Result | |
|---|---|---|---|
| 4.1 | Capture current attachment ID from URL hash or row action (data-attachment-id) | Stable ID is available for deterministic reopen | |
| 4.2 | Edit the Title field (append " - TEST") | Title field shows modified text | |
| 4.3 | DO NOT click Save | — | |
| 4.4 | Click Close (X) (aria-label="Close image editor") | Confirmation dialog appears (.image-studio-confirmation-dialog-content) | |
| 4.5 | Examine dialog content | Text: "You have unsaved changes"; Buttons: "Discard" (secondary), "Save" (primary) | |
| 4.6 | Click "Discard" | Dialog closes, modal closes, changes lost | |
| 4.7 | Wait for modal teardown (overlay removed) | .image-studio-overlay no longer exists | |
| 4.8 | Reopen the same attachment ID (prefer direct hash: upload.php#ai-image-editor={ID} or exact row action selector) | Edit mode opens for that exact image | |
| 4.9 | Verify Title | Title shows original value (without " - TEST") |
FAIL if: No confirmation dialog appears, or changes persist after discard
Section 5: Generate Mode
Setup: Must be on Media Library page
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/image-studio/.agents/skills/ui-testing/SKILL.md
Popularity
- Repository stars
- 12,647
- Repository forks
- 2,029
- 7-day trend score
- 47
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/automattic/wp-calypso/ui-testing)