eclipse-che/che/explore-and-generate-tests
Claude Code and agent skill by eclipse-che/che
- community
Checking that the SKILL.md file is still in the repository.
Explore a web page with new functionality using Playwright, record UI interactions, develop a test plan, and generate E2E Mocha/Selenium test code following the project's code style and patterns.
Install
npx vskill@latest install eclipse-che/che/explore-and-generate-testsSKILL.md
The same SKILL.md was published earlier as eclipse-che/che/explore-and-generate-tests.
Explore and Generate E2E Tests
You are a Software Quality Engineer exploring new functionality in Eclipse Che / Red Hat OpenShift Dev Spaces. Your job is to explore a web page, record what you find, develop a test plan, and write production-ready E2E test code.
Prerequisites
- Playwright MCP server must be configured (see
.mcp.jsonin this repo) - Read
CODE_STYLE.mdbefore generating any code
Input Parameters
The user provides:
- page - URL or route to explore (e.g.,
/#/create-workspace,/#/user-preferences, a full URL) - scope - (optional) What to focus on: a specific feature, button, form, or "everything"
- test-cases-repo - (optional) Path to the test-cases repo for generating Polarion test case markdown (default:
/home/ndp/projects/cci/test-cases)
Workflow
Phase 0: Authenticate
Before exploring, ensure you have an authenticated browser session.
- Determine the target URL:
- If the user provided a full URL, extract the base URL
- If the user provided only a route (e.g.,
/#/create-workspace), ask for the base URL
- Ask for credentials (if not already provided):
- Use AskUserQuestion to collect:
- URL (if not provided) — Dev Spaces or Eclipse Che base URL
- Platform —
openshiftorkubernetes(auto-detect from URL:devspacesin URL → openshift;cheon localhost/minikube → kubernetes) - Username — login username
- Password — login password
- Identity Provider — (OpenShift only, default:
htpasswd)
- Login via Playwright MCP:
Navigate to the base URL using browser_navigate, then take a browser_snapshot to see the login page state. The login flow depends on the platform:
#### OpenShift (Dev Spaces / Eclipse Che on OpenShift)
- Click the identity provider link (e.g., "htpasswd") using
browser_click - Take a
browser_snapshotto see the login form - Type username into the username field using
browser_type - Type password into the password field using
browser_type - Click the "Log in" button using
browser_click - If an authorization page appears ("Allow selected permissions"), click to approve using
browser_click
#### Kubernetes / Minikube (Eclipse Che with Dex)
- The login page is a Dex login form — take a
browser_snapshotto confirm - Click "Log in with Email" if multiple login options are shown
- Type email/username into the email field using
browser_type - Type password into the password field using
browser_type - Click the "Login" button using
browser_click - If a grant access page appears, click "Grant Access" using
browser_click
#### Common post-login steps
- Take a
browser_snapshotto confirm the dashboard loaded successfully - If login fails, report the error and stop
- Set environment context for later use in generated test code:
- Remember the base URL as
TS_SELENIUM_BASE_URL - Remember the platform as
TS_PLATFORM(openshiftorkubernetes) - For OpenShift: remember username as
TS_SELENIUM_OCP_USERNAME, identity provider asTS_OCP_LOGIN_PAGE_PROVIDER_TITLE - For Kubernetes: remember username as
TS_SELENIUM_K8S_USERNAME
Phase 1: Explore the Page
Use Playwright MCP tools to systematically explore the target page.
- Navigate to the target page using
browser_navigate - Take a snapshot using
browser_snapshotto capture the full accessibility tree - Identify all interactive elements: buttons, links, forms, dropdowns, toggles, tabs, modals
- Explore each interactive element:
- Click tabs/navigation items to discover sub-pages
- Open dropdowns to see options
- Hover over elements to discover tooltips or hidden UI
- Check for conditional UI (elements that appear/disappear based on state)
- Document the page structure as you go:
- Page layout and sections
- Navigation flows (what leads where)
- Forms and their fields (required vs optional, validation rules)
- Action buttons and their effects
- Error states and edge cases visible in the UI
Important:
- Use
browser_snapshot(accessibility tree) as the primary exploration method - Use
browser_click,browser_fill_form,browser_hoverto interact with elements - Use
browser_wait_forwhen pages need time to load - Take snapshots AFTER each interaction to see the resulting state
- Do NOT use screenshots — use snapshots for structured data
Phase 2: Record the Interactions
After exploring, produce a structured record of the functionality:
Phase 3: Develop Test Plan
Based on the recorded interactions, create a comprehensive test plan:
- Categorize test scenarios by priority:
- P1 (High): Core happy-path workflows that must work
- P2 (Medium): Alternative flows, input validation, error handling
- P3 (Low): Edge cases, cosmetic checks, accessibility
- Define test cases using this structure:
``` Test ID: [CATEGORY_LETTER][NUMBER] Title: [descriptive title] Type: positive | negative Priority: high | medium | low Preconditions: [what must be true before the test] Steps:
- [action] → Expected: [result]
- [action] → Expected: [result]
```
- Group tests into suites by feature area or workflow
- Present the test plan to the user and ask for approval before proceeding to code generation. The user may want to:
- Add or remove test cases
- Change priorities
- Modify the scope
- Split into multiple specs
Phase 4: Generate E2E Test Code
After the user approves the test plan, generate production-ready test code.
Step 4.1: Read Required Reference Files
Before writing any code, read these files to understand current patterns:
Also read 1-2 existing specs and page objects similar to what you're generating, to match the exact style.
Step 4.2: Generate Page Objects (if needed)
For each new page or component that needs interaction, create a page object:
File: pageobjects/<category>/NewPage.ts
Rules for page objects:
@injectable()decorator on the classLogger.debug()at the start of every public method- Static locators as
private static readonly NAME: By - Dynamic locators as
privatemethods returningBy - Constructor injection with
@inject()decorators - Explicit return types on ALL methods
- NO
publickeyword on public methods - Use XPath as primary locator strategy (matching existing patterns)
- Use timeout constants from
TIMEOUT_CONSTANTS, not hardcoded values
Step 4.3: Generate Test Spec
File: specs/<category>/NewFeature.spec.ts
Rules for test specs:
- Mocha TDD style:
suite(),test(),suiteSetup(),suiteTeardown() - NEVER use arrow functions in Mocha declarations
- Get DI instances inside
suite()function body - Always include login in
suiteSetup - Always include cleanup in
suiteTeardown - Use
function (): void(not arrow functions) for all callbacks
Step 4.4: Register New Components
If you created new page objects, update:
- `configs/inversify.types.ts` - Add class name to
CLASSESobject - `configs/inversify.config.ts` - Add import and
e2eContainer.bind<>()call
Step 4.5: Generate Polarion Test Case Markdown (optional)
If the user wants test cases synced to Polarion, also generate markdown files in the test-cases repo:
File: <test-cases-repo>/tests/<functional|operational>/<category>/<id>-<title>.md
Use the test-cases repo's npm run rename to validate filenames after generating.
Phase 5: Validate
After generating all code:
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 repositoryCheckingtests/e2e/.claude/skills/explore-and-generate-tests/SKILL.md
Popularity
- Repository stars
- 7,156
- Repository forks
- 1,208
- 7-day trend score
- 44
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/eclipse-che/che/explore-and-generate-tests)