Test ui

From InugamiDev/ultrathink-oss · View interactive version

Test ui is an AI agent skill from the GitHub repository InugamiDev/ultrathink-oss. Multi-viewport UI testing with screenshots, visual regression detection, and accessibility audits

How to use this skill

Skill file

Test-UI Skill

Purpose

Systematically test user interfaces across viewports, accessibility standards, and interaction patterns. This skill uses visual testing (screenshots), automated accessibility auditing, and interaction verification to catch UI problems that unit tests miss.

UI bugs are user-facing bugs. They are the first thing users see and the last thing developers test. This skill closes that gap.

Workflow

Phase 1: Test Setup

  1. Identify the test target:
  1. Define viewport matrix (default set):

| Name | Width | Height | Device Class |

|------|-------|--------|-------------|

| Mobile S | 320 | 568 | iPhone SE |

| Mobile M | 375 | 667 | iPhone 8 |

| Mobile L | 414 | 896 | iPhone 11 |

| Tablet | 768 | 1024 | iPad |

| Desktop | 1280 | 800 | Laptop |

| Desktop L | 1920 | 1080 | Full HD |

  1. Set up the browser using Playwright MCP:

Phase 2: Visual Testing

  1. For each viewport in the matrix:

a. Resize the browser to the viewport dimensions

b. Wait for layout to settle (resize can trigger animations)

c. Take a full-page screenshot

d. Take a viewport-only screenshot (above the fold)

e. Record any visual anomalies observed:

  1. Capture key states (if interactive elements exist):

Phase 3: Accessibility Audit

  1. Evaluate against WCAG 2.1 AA criteria:

Perceivable:

Operable:

Understandable:

Robust:

  1. Run automated accessibility check using browser evaluation:

```javascript

// Check for missing alt text

document.querySelectorAll('img:not([alt])');

// Check for empty buttons/links

document.querySelectorAll('a:empty, button:empty');

// Check heading hierarchy

document.querySelectorAll('h1, h2, h3, h4, h5, h6');

```

Phase 4: Responsive Testing

  1. Check layout integrity across viewports:
  1. Check breakpoint transitions:

Phase 5: Interaction Testing

  1. Test interactive elements (using Playwright):
  1. Test keyboard navigation:

Phase 6: Report

  1. Produce the UI test report using the template below.
  2. Prioritize findings by user impact.

UI Test Report Template

# UI Test Report

## Target
**URL**: [url]
**Date**: [date]
**Viewports tested**: [list]

---

## Visual Summary
| Viewport | Screenshot | Issues |
|----------|-----------|--------|
| Mobile (375px) | [screenshot ref] | [count] issues |
| Tablet (768px) | [screenshot ref] | [count] issues |
| Desktop (1280px) | [screenshot ref] | [count] issues |

## Issues Found

### Critical (Blocks Usage)
#### [V1] [Title]
- **Viewport**: [affected viewports]
- **Description**: [what is wrong]
- **Expected**: [correct behavior]
- **Screenshot**: [reference]

### Major (Degrades Experience)
#### [V2] [Title]
...

### Minor (Polish)
#### [V3] [Title]
...

---

## Accessibility Audit
### Violations
| Rule | Impact | Elements | Fix |
|------|--------|----------|-----|
| [rule] | [critical/serious/moderate] | [count] | [recommendation] |

### Passes
- [count] rules passing

---

## Responsive Behavior
| Breakpoint | Layout | Navigation | Typography | Media |
|-----------|--------|------------|------------|-------|
| 320px | OK/Issue | OK/Issue | OK/Issue | OK/Issue |
| 768px | OK/Issue | OK/Issue | OK/Issue | OK/Issue |
| 1280px | OK/Issue | OK/Issue | OK/Issue | OK/Issue |

## Interaction Results
| Element | Click | Keyboard | Focus | Hover |
|---------|-------|----------|-------|-------|
| [button/link] | Pass/Fail | Pass/Fail | Pass/Fail | Pass/Fail |

---

## Recommendations
1. **[Highest priority]**: [action]
2. **[Second priority]**: [action]
3. ...

Usage

Full UI test

/test-ui http://localhost:3000

Specific page

/test-ui http://localhost:3000/checkout

Accessibility only

/test-ui accessibility http://localhost:3000

Responsive only

/test-ui responsive http://localhost:3000/dashboard

Specific viewports

/test-ui http://localhost:3000 --viewports mobile,desktop

Examples

Example: Finding a responsive issue

Test: Homepage at 375px width

Finding: Hero section text overflows container, creating horizontal scrollbar

Root cause: Fixed width of 500px on hero text container instead of max-width

Fix recommendation: Change width: 500px to max-width: 100%

Example: Accessibility finding

Test: Login form

Finding: Password field has no visible label (only placeholder text)

Impact: Screen reader users cannot identify the field; placeholder disappears on focus

Fix recommendation: Add a visible <label> element associated with the input via htmlFor

Example: Interaction issue

Test: Mobile navigation menu

Finding: Hamburger menu opens on click but cannot be closed with keyboard (Escape key does not work)

Impact: Keyboard users are trapped in the menu

Fix recommendation: Add Escape key handler to close the menu and return focus to the trigger button

Guidelines

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.