From core
Identifies missing selectors needed for test implementation by mapping test steps to UI interactions, checking existing Page Objects, and searching frontend source code.
How this command is triggered — by the user, by Claude, or both
Slash command
/core:aqa-flow-selector-identificationThe summary Claude sees in its command listing — used to decide when to auto-load this command
# Phase 4: Selector Identification ## Objective Identify missing selectors needed for test implementation. First attempt to find selectors from frontend source code. If frontend code is unavailable or selectors cannot be found, request page source from user. ## Prerequisites - Phase 1, 2, and 3 completed - Test plan updated with assertions and code analysis - Understanding of existing Page Objects - Understanding of test requirements - Frontend code analysis completed (if available) ## Phase Tasks ### Task 1: Map Test Steps to Required Interactions **Actions**: 1. Review test plan - ...
Identify missing selectors needed for test implementation. First attempt to find selectors from frontend source code. If frontend code is unavailable or selectors cannot be found, request page source from user.
Actions:
### Test Step 1: Navigate to Login Page
Required Interactions:
- Click: "Login" navigation link
- Verify: Login page heading "Sign In"
### Test Step 2: Enter Credentials
Required Interactions:
- Type: Username field
- Type: Password field
- Click: "Login" button
### Test Step 3: Verify Dashboard
Required Interactions:
- Verify: Welcome message text
- Verify: User profile icon visible
- Verify: Dashboard title "My Dashboard"
Expected Output: Complete list of all required UI interactions.
Actions:
### Selector Availability Check
✅ LoginPage.usernameInput - EXISTS
✅ LoginPage.passwordInput - EXISTS
✅ LoginPage.loginButton - EXISTS
❌ DashboardPage.welcomeMessage - MISSING
❌ DashboardPage.dashboardTitle - MISSING
✅ DashboardPage.userProfileIcon - EXISTS
Expected Output: Clear list of missing selectors with their intended Page Objects.
Actions:
Use: Grep or SemanticSearch
Search for: data-testid, data-test, component names, feature names
data-testid="selector-name" attributesid, className, or ARIA attributes### Selectors Found in Frontend Code
#### DashboardPage
- Welcome Message: `data-testid="welcome-message"` (h2 element, line 45)
- Dashboard Title: `data-testid="dashboard-title"` (h1 element, line 38)
- Notification Bell: `data-testid="notification-bell"` (button element, line 52)
#### SettingsPage
- Email Input: `data-testid="email-input"` (input type="email", line 67)
- Save Button: `data-testid="save-settings-btn"` (button element, line 89)
Expected Output: Selectors found from frontend code OR list of selectors still needing page source.
Actions:
### Missing Selectors by Page
#### Dashboard Page
- Welcome message (text element showing "Welcome, [username]")
- Dashboard title (heading with "My Dashboard")
- Notification bell icon (clickable icon in header)
#### Settings Page
- Email input field (editable field for email)
- Save button (button to save settings)
- Success notification (message shown after save)
I need page source HTML to identify the correct selectors. Please provide:
### Dashboard Page HTML
Please save the HTML for these elements:
- The welcome message element (showing "Welcome, [username]")
- The dashboard title/heading
- The notification bell icon
To capture:
1. Open browser Developer Tools (F12)
2. Right-click the element → Inspect
3. In Elements tab, right-click the element → Copy → Copy outerHTML
4. Include parent containers for context (2-3 levels up)
5. Save HTML in files in `agents/aqa/{TICKET-KEY}/page-sources/` directory
(e.g., dashboard-page.html, settings-page.html)
### Settings Page HTML
[Similar instructions for Settings page elements]
Expected Output: Clear, specific request for user with instructions on how to provide HTML.
Note: If all selectors were found in Task 3 (frontend code), skip this task entirely.
Actions:
mkdir -p agents/aqa/{TICKET-KEY}/page-sources/
User Interaction Format:
To implement the test accurately, I need to identify the correct selectors.
I've created a directory for page sources at: `agents/aqa/{TICKET-KEY}/page-sources/`
## Missing Selectors
I need HTML for the following elements:
### Dashboard Page
- [Element 1 description]
- [Element 2 description]
### Settings Page
- [Element 1 description]
- [Element 2 description]
## How to Provide Page Sources
1. Open the application and navigate to each page
2. For each page, create a separate HTML file in the `page-sources/` directory:
- `dashboard-page.html` for Dashboard Page elements
- `settings-page.html` for Settings Page elements
3. Use this naming convention: `{page-name}.html` in kebab-case
4. In each HTML file, include the HTML for all relevant elements with surrounding context
5. To capture HTML:
- Open Developer Tools (F12 or Right-click → Inspect)
- Right-click the element → Inspect
- In Elements/Inspector tab, find the element
- Right-click the HTML → Copy → Copy outerHTML
- Include 2-3 parent levels for context
- Paste into the appropriate `.html` file
**Please add the page source files to the `agents/aqa/{TICKET-KEY}/page-sources/` directory and let me know when ready.**
Expected Output: User adds HTML files to the page-sources/ directory and confirms.
Note: If all selectors were found in Task 3 (frontend code), skip this task entirely.
Actions:
agents/aqa/{TICKET-KEY}/page-sources/ directory using LS tool, then read each page source file using Read tooldata-testid or data-test attributesid attributesclass names (if stable)### Identified Selectors
#### DashboardPage Selectors
**Welcome Message**
- HTML: `<h2 class="welcome-text" data-testid="welcome-message">`
- Selector: `[data-testid="welcome-message"]`
- Type: CSS
- Usage: Text verification
**Dashboard Title**
- HTML: `<h1 id="dashboard-title">My Dashboard</h1>`
- Selector: `#dashboard-title`
- Type: CSS (ID)
- Usage: Text verification
**Notification Bell**
- HTML: `<button class="notification-icon" aria-label="Notifications">`
- Selector: `[aria-label="Notifications"]`
- Type: CSS (ARIA)
- Usage: Click action
data-testid be added?"Expected Output: Complete list of selectors with selection rationale.
Note: If all selectors were found in Task 3 (frontend code), this task combines results from frontend code analysis.
Actions:
## Phase 4: Selector Identification
### Required Selectors Analysis
[Interaction map from Task 1]
### Existing vs Missing Selectors
[Availability check from Task 2]
### Frontend Code Analysis
- Frontend Source Available: [Yes/No]
- Components Searched: [List]
- Selectors Found in Code: [Count and list]
- Selectors Still Missing: [Count and list]
### Page Source Requested (if applicable)
- Pages: [List]
- Elements: [List]
- Provided: [File path]
- Note: [Only if frontend code unavailable or selectors not found]
### Identified Selectors
[Detailed selector documentation - from frontend code (Task 3) or HTML analysis (Task 6)]
### Selector Strategy
- Preferred method: [e.g., data-testid]
- Fallback method: [e.g., id or aria-label]
### Notes
- [Any concerns about selector stability]
- [Recommendations for improvements]
Expected Output: Test plan updated with all selector information.
page-sources/ directory created (only if page source needed)agents/aqa-state.md updated with Phase 4 completionAfter completing Phase 4, update agents/aqa-state.md:
### Phase 4: Selector Identification
- Completed: [DateTime]
- Total Selectors Needed: [Count]
- Existing Selectors: [Count]
- Missing Selectors: [Count]
- Frontend Code Available: [Yes/No]
- Selectors Found in Frontend: [Count]
- Page Source Required: [Yes/No]
- Page Source Directory: agents/aqa/{TICKET-KEY}/page-sources/ (if applicable)
- Files Provided: [list of filenames] (if applicable)
- Selector Strategy: [Preferred method]
Mark Phase 4 as completed and Phase 5 as current.
After selectors are identified (either from frontend code or page source), proceed to Phase 5: Selector Implementation by executing:
ACQUIRE aqa-flow-selector-implementation.md FROM KB
data-testid attributes firstnpx claudepluginhub p/griddynamics-core-instructions-r2-core/expectAnalyzes git changes, generates targeted test plans, and executes them via AI-driven browser automation. Only tests what changed.
/e2e-scaffoldScaffolds end-to-end test files for a page, route, or user flow, auto-detecting Playwright, Cypress, or Puppeteer and matching existing project conventions.
/recordRecords browser interactions to generate test YAML files; also supports AI-assisted editing of existing tests.
/test-planCreates a structured test plan from feature artifacts — queries test types, environment, and credentials, auto-detects the test framework, generates test cases mapped to user stories, and saves them under features/<name>/testing/.
/qa-sweepRuns a full platform QA sweep: auto-discovers pages, tests UI elements via browser automation, creates GitHub issues for findings. Supports scoped sweeps (dashboard, marketing, page, journey, visual, functional, a11y).
/pagesTests all pages at <base-url> for errors, missing elements, and broken interactions using Playwright. Generates/reads test plan, verifies URL/CSS, supports --pages and --viewport flags.