Skip to content

Commit 6a07622

Browse files
feat: add rhdh-playwright skill for RHDH UI testing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
1 parent 6d64df1 commit 6a07622

6 files changed

Lines changed: 245 additions & 4 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
},
66
"metadata": {
77
"description": "Orchestrator skill for RHDH plugin development - onboard, update, and maintain plugins in the Extensions Catalog",
8-
"version": "0.5.0"
8+
"version": "0.6.0"
99
},
1010
"plugins": [
1111
{
1212
"name": "rhdh",
1313
"source": "./",
1414
"description": "Skills for RHDH plugin lifecycle management",
15-
"version": "0.5.0",
15+
"version": "0.6.0",
1616
"strict": true
1717
}
1818
]

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "rhdh",
33
"description": "All-in-one toolkit for Red Hat Developer Hub (RHDH). Covers plugin development, overlay management, environment setup, version compatibility, CI/CD, and RHDH ecosystem navigation.",
4-
"version": "0.5.0",
4+
"version": "0.6.0",
55
"author": {
66
"name": "RHDH Store Manager"
77
},

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ rhdh-local-setup/
4242

4343
# Temporary testing checkouts
4444
tmp/
45+
.playwright-cli
46+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Track work across the four RHDH Jira projects.
8282
- **[to-issue](./skills/rhdh-jira/references/to-issue.md)** — Create a Story, Task, Bug, or Spike with automatic type inference. Grills on implementation details and story points.
8383
- **[update-jira-status](./skills/rhdh-jira/references/update-jira-status.md)** — Update an issue with session progress. Detects the related issue, adds a status comment, proposes transitions, and checks upward cascade to parent Epic/Feature.
8484

85+
### UI Testing
86+
87+
- **[rhdh-playwright](./skills/rhdh-playwright/SKILL.md)** — Automate RHDH UI navigation and verification using `playwright-cli`. Covers guest login, sidebar navigation, catalog browsing, entity page inspection, tab verification, and plugin exploration. Use for "check RHDH", "verify catalog entity", "entity should have tab", or any RHDH UI testing task.
88+
8589
### PR Review
8690

8791
- **[rhdh-pr-review](./skills/rhdh-pr-review/SKILL.md)** — PR code review with inline comments (GitHub, GitLab planned) and live cluster testing for rhdh-operator PRs. Layered architecture: fetch → analyze → post.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "rhdh-skill"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
description = "Claude Code skill for RHDH plugin development"
55
readme = "README.md"
66
license = "Apache-2.0"

skills/rhdh-playwright/SKILL.md

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
---
2+
name: rhdh-playwright
3+
description: >-
4+
Use when navigating, testing, or verifying a RHDH instance via
5+
playwright-cli. Covers guest login, sidebar navigation, catalog browsing,
6+
entity page inspection, tab verification, and plugin exploration. Trigger on
7+
"check RHDH", "verify catalog entity", "entity should have tab",
8+
"navigate RHDH", or any RHDH UI testing task.
9+
allowed-tools: Bash(playwright-cli:*)
10+
---
11+
12+
# Play RHDH
13+
14+
Automate RHDH UI navigation and verification using `playwright-cli` (NOT the Playwright MCP).
15+
16+
## Quick Start
17+
18+
```bash
19+
# Always use --browser chromium
20+
playwright-cli open <RHDH_URL> --browser chromium
21+
```
22+
23+
The URL is never hardcoded — the user provides it (or it comes from context like CLAUDE.md).
24+
25+
## Authentication — Guest Login
26+
27+
After opening a RHDH instance, check whether a login page appeared. If the page title contains "Sign In" or "Log in", or the snapshot shows sign-in buttons, log in as guest:
28+
29+
```bash
30+
# Take a snapshot to check for login
31+
playwright-cli snapshot
32+
33+
# If a login page is detected, look for a guest sign-in option:
34+
# - Button or link matching: "Enter" (on guest sign-in provider card)
35+
# - Or a "Guest" / "Sign in as Guest" button
36+
# Click it:
37+
playwright-cli click "<ref>" # ref of the guest sign-in button
38+
```
39+
40+
RHDH login pages typically show provider cards. The guest provider shows a title like "Guest" with an "Enter" button. Click the "Enter" button on the guest card.
41+
42+
After login, verify navigation succeeded by checking that the sidebar appeared:
43+
44+
```bash
45+
playwright-cli snapshot --depth 3
46+
# Confirm: navigation "sidebar nav" is present
47+
```
48+
49+
## Sidebar Navigation
50+
51+
The sidebar uses `navigation "sidebar nav"` containing links. Navigate by clicking the link with the target label.
52+
53+
| Destination | Selector pattern |
54+
|---|---|
55+
| Home | `link "Home"` |
56+
| Catalog | `link "Catalog"` |
57+
| APIs | `link "APIs"` |
58+
| Docs | `link "Docs"` |
59+
| Create | `link "Create"` |
60+
| Explore | `link "Explore"` |
61+
| Settings | `link "Settings"` |
62+
| Notifications | `link "Notifications"` |
63+
| Search | `button "Search"` |
64+
65+
Additional sidebar items (plugins) appear below a separator. Their labels match their menu name (e.g., `link "Tech Radar"`).
66+
67+
```bash
68+
# Navigate to a sidebar item
69+
playwright-cli click "getByRole('navigation', { name: 'sidebar nav' }).getByRole('link', { name: 'Catalog' })"
70+
```
71+
72+
## Catalog Page
73+
74+
After navigating to the catalog, the page shows filters and a table of entities.
75+
76+
### Filters
77+
78+
| Filter | Element type | Locator |
79+
|---|---|---|
80+
| Kind | button (shows current value) | `button "Component"` (or current kind) |
81+
| Type | button | `button "all"` (or current type) |
82+
| Owner | combobox + textbox | `textbox "Owner"` |
83+
| Lifecycle | combobox + textbox | `textbox "Lifecycle"` |
84+
| Tags | combobox + textbox | `textbox "Tags"` |
85+
86+
To filter by Kind, click the Kind button and select from the dropdown:
87+
88+
```bash
89+
playwright-cli click "getByRole('button', { name: 'Component' })"
90+
playwright-cli snapshot # find the desired kind option
91+
playwright-cli click "<ref>" # click the desired kind
92+
```
93+
94+
### Search the Catalog
95+
96+
```bash
97+
playwright-cli fill "getByRole('textbox', { name: 'Search' })" "my-entity"
98+
```
99+
100+
### Catalog Table
101+
102+
The entity table has columns: Name, System, Owner, Type, Lifecycle, Description, Tags, Actions.
103+
104+
Entity names in the table are links. Their URL pattern is: `/catalog/{namespace}/{kind}/{name}`
105+
106+
```bash
107+
# Click an entity by name
108+
playwright-cli click "getByRole('link', { name: 'artist-lookup' })"
109+
```
110+
111+
### Personal vs All
112+
113+
The catalog has a menu toggle between "Personal" (Owned / Starred) and "RHDH" (All):
114+
115+
```bash
116+
# Switch to "All" entities
117+
playwright-cli click "getByRole('menuitem', { name: /All/ })"
118+
```
119+
120+
## Entity Page
121+
122+
An entity page has:
123+
1. **Header** — shows kind, type, entity name, and metadata (Owner, Lifecycle)
124+
2. **Tabs**`tablist "Tabs"` containing `tab` elements
125+
3. **Content area**`article` below the tabs
126+
127+
### Verify an Entity Exists
128+
129+
```bash
130+
playwright-cli open "<RHDH_URL>/catalog/default/component/<entity-name>" --browser chromium
131+
playwright-cli snapshot --depth 3
132+
# Confirm: heading with entity name is present
133+
# The page title format: "<entity-name> | <tab> | <site-title>"
134+
```
135+
136+
Or search through the catalog:
137+
138+
```bash
139+
playwright-cli open "<RHDH_URL>/catalog" --browser chromium
140+
playwright-cli fill "getByRole('textbox', { name: 'Search' })" "<entity-name>"
141+
# Check the table for a matching row
142+
playwright-cli snapshot
143+
```
144+
145+
### Read Entity Metadata
146+
147+
From the entity page snapshot, find:
148+
- **Kind + Type**: `paragraph` above the heading (e.g., "component — service")
149+
- **Owner**: under a "Owner" label, a link to the owning group
150+
- **Lifecycle**: under a "Lifecycle" label (e.g., "experimental", "production")
151+
- **System**: in the About card under "System" heading
152+
153+
### Verify a Tab Exists
154+
155+
```bash
156+
playwright-cli snapshot
157+
# Look for: tablist "Tabs" containing tab elements
158+
# Example output:
159+
# tablist "Tabs":
160+
# tab "Overview" [selected]
161+
# tab "Docs"
162+
# tab "APIs"
163+
# tab "Todo"
164+
```
165+
166+
Check that the expected tab name appears in the tablist. Tabs are `tab` role elements inside `tablist "Tabs"`.
167+
168+
```bash
169+
# Click a specific tab
170+
playwright-cli click "getByRole('tab', { name: 'Docs' })"
171+
```
172+
173+
### About Card
174+
175+
The entity Overview tab contains an "About" card (`heading "About"`) with:
176+
- Description, Owner, System, Tags, Kind, Type, Lifecycle
177+
- Links: "View Source", "View TechDocs"
178+
179+
## Common Verification Patterns
180+
181+
### Check that a catalog entity exists
182+
183+
```bash
184+
playwright-cli open "<URL>" --browser chromium
185+
# Handle login if needed (see Authentication section)
186+
playwright-cli goto "<URL>/catalog/default/component/<name>"
187+
playwright-cli snapshot --depth 4
188+
# SUCCESS: heading with entity name is visible
189+
# FAILURE: page shows "Entity not found" or similar error
190+
```
191+
192+
### Entity should have a specific tab
193+
194+
```bash
195+
playwright-cli goto "<URL>/catalog/default/component/<name>"
196+
playwright-cli snapshot --depth 4
197+
# Find: tablist "Tabs" → check for tab "<expected-tab>"
198+
```
199+
200+
### Navigate sidebar and verify page loaded
201+
202+
```bash
203+
playwright-cli click "getByRole('navigation', { name: 'sidebar nav' }).getByRole('link', { name: '<Page>' })"
204+
playwright-cli snapshot --depth 3
205+
# Confirm heading or page content matches expected page
206+
```
207+
208+
### Screenshot for evidence
209+
210+
```bash
211+
playwright-cli screenshot --filename rhdh-evidence.png
212+
# Saved to .playwright-cli/rhdh-evidence.png
213+
```
214+
215+
## URL Patterns
216+
217+
| Resource | URL pattern |
218+
|---|---|
219+
| Catalog list | `/catalog` |
220+
| Entity by kind | `/catalog/{namespace}/{kind}/{name}` |
221+
| API docs | `/api-docs` |
222+
| TechDocs | `/docs` |
223+
| Create (templates) | `/create` |
224+
| Settings | `/settings` |
225+
226+
Default namespace is `default`. Common kinds: `component`, `system`, `group`, `user`, `api`, `resource`, `template`, `domain`, `location`.
227+
228+
## Important
229+
230+
- **Always** use `playwright-cli`, never the Playwright MCP tools.
231+
- **Always** pass `--browser chromium` to `playwright-cli open`.
232+
- The URL is provided by the user or derived from context — never hardcode it.
233+
- Logs and screenshots are automatically saved in `.playwright-cli/`.
234+
- After each `playwright-cli` command, a snapshot is returned — use the ref IDs from it for subsequent interactions.
235+
- Use `playwright-cli snapshot` to refresh the current page state at any time.

0 commit comments

Comments
 (0)