# Complete Missing Locators List - For UI Dev Team

## 📋 Overview

This document lists **ALL** missing `data-testid` attributes and temporary locators that need to be replaced with proper `data-testid` attributes.

**Purpose**: Once UI Dev Team adds all these attributes, the automation will be 100% aligned and ready for testing.

**Last Updated**: Based on DOM validation and code analysis

---

## 🔴 CRITICAL: Current Status

**DOM Validation Result**: Found **0 elements** with `data-testid` attributes in the live DOM.

This means **ALL** `data-testid` attributes are currently missing from the rendered DOM, even though they may be in the source code.

---

## 📄 PAGE-BY-PAGE BREAKDOWN

### 1. LOGIN PAGE (`pages/login_page.py`)

#### ✅ Currently Using data-testid (Expected):

- `student_login__form`
- `student_login__identifier_input`
- `student_login__password_input`
- `student_login__remember_checkbox`
- `student_login__error_banner`
- `student_login__submit_button`

#### ❌ TEMPORARY LOCATORS (Need data-testid):

| Current Locator                                                                        | Type  | Location             | Required data-testid           | Notes                    |
| -------------------------------------------------------------------------------------- | ----- | -------------------- | ------------------------------ | ------------------------ |
| `//div[@role='status' and @aria-live='polite' and (contains(text(), 'Invalid')...)]` | XPath | `login_page.py:26` | `student_login__error_toast` | Error toast notification |

---

### 2. DASHBOARD PAGE (`pages/dashboard_page.py`)

#### ✅ Currently Using data-testid (Expected):

- `student_nav__assessments_link`
- `profile_incomplete__modal`
- `profile_incomplete__complete_button`
- `profile_incomplete__progress_value`

#### ❌ TEMPORARY LOCATORS (Need data-testid):

| Current Locator                         | Type  | Location                 | Required data-testid           | Notes                   |
| --------------------------------------- | ----- | ------------------------ | ------------------------------ | ----------------------- |
| `//h1[contains(text(), 'Hi There!')]` | XPath | `dashboard_page.py:19` | `dashboard__welcome_message` | Welcome message heading |

---

### 3. STUDENT NAVIGATION (`pages/student_nav_page.py`)

#### ✅ Currently Using data-testid (Expected):

- `student_nav__dashboard_link`
- `student_nav__assessments_link`
- `student_nav__profile_button`
- `student_nav__profile_dropdown`
- `student_nav__edit_profile_button`
- `student_nav__reset_password_button`
- `student_nav__sign_out_button`

**Status**: ✅ All locators use data-testid - No temporary locators

---

### 4. MANDATORY PASSWORD RESET (`pages/mandatory_reset_page.py`)

#### ✅ Currently Using data-testid (Expected):

- `mandatory_reset__modal`
- `mandatory_reset__continue_button`
- `mandatory_reset__form`
- `mandatory_reset__current_password_input`
- `mandatory_reset__new_password_input`
- `mandatory_reset__confirm_password_input`
- `mandatory_reset__current_password_error`
- `mandatory_reset__new_password_error`
- `mandatory_reset__confirm_password_error`
- `mandatory_reset__back_button`
- `mandatory_reset__submit_button`

**Status**: ✅ All locators use data-testid - No temporary locators

---

### 5. PROFILE INCOMPLETE MODAL (`pages/profile_incomplete_page.py`)

#### ✅ Currently Using data-testid (Expected):

- `profile_incomplete__modal`
- `profile_incomplete__progress_value`
- `profile_incomplete__complete_button`

**Status**: ✅ All locators use data-testid - No temporary locators

---

### 6. PROFILE EDITOR PAGE (`pages/profile_editor_page.py`)

#### ❌ MISSING data-testid ATTRIBUTES (ALL 50+ base attributes):

**Page-Level Elements:**

| Required data-testid                      | Element             | Current Status | File Location                     |
| ----------------------------------------- | ------------------- | -------------- | --------------------------------- |
| `profile_editor__page`                  | Main container div  | ❌ Missing     | `StudentProfileEditor.jsx:1629` |
| `profile_editor__progress_value`        | Progress percentage | ❌ Missing     | `StudentProfileEditor.jsx:1692` |
| `profile_editor__missing_fields_toggle` | Toggle button       | ❌ Missing     | `StudentProfileEditor.jsx:1701` |

**Navigation Buttons:**

| Required data-testid              | Element         | Current Status | File Location                     |
| --------------------------------- | --------------- | -------------- | --------------------------------- |
| `profile_editor__prev_button`   | Previous button | ❌ Missing     | `StudentProfileEditor.jsx:1897` |
| `profile_editor__next_button`   | Next button     | ❌ Missing     | `StudentProfileEditor.jsx:1907` |
| `profile_editor__cancel_button` | Cancel button   | ❌ Missing     | `StudentProfileEditor.jsx:1919` |
| `profile_editor__save_button`   | Save button     | ❌ Missing     | `StudentProfileEditor.jsx:1927` |

**Tab Navigation:**

| Required data-testid                         | Element    | Current Status | File Location                               |
| -------------------------------------------- | ---------- | -------------- | ------------------------------------------- |
| `profile_editor__tab_personal_information` | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_contact_information`  | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_parent_guardian`      | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_education_details`    | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_focus_areas`          | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_self_assessment`      | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_hobbies_clubs`        | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_achievements`         | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |
| `profile_editor__tab_expectations`         | Tab button | ❌ Missing     | `StudentProfileEditor.jsx:1831` (dynamic) |

**Step 1: Personal Information:**

| Required data-testid                                 | Element    | Current Status | File Location                    |
| ---------------------------------------------------- | ---------- | -------------- | -------------------------------- |
| `profile_editor__first_name_input`                 | Input      | ❌ Missing     | `StudentProfileEditor.jsx:777` |
| `profile_editor__last_name_input`                  | Input      | ❌ Missing     | `StudentProfileEditor.jsx:795` |
| `profile_editor__gender_select`                    | Select     | ❌ Missing     | `StudentProfileEditor.jsx:810` |
| `profile_editor__dob_input`                        | Date input | ❌ Missing     | `StudentProfileEditor.jsx:830` |
| `profile_editor__roll_number_input`                | Input      | ❌ Missing     | `StudentProfileEditor.jsx:847` |
| `profile_editor__nationality_input`                | Input      | ❌ Missing     | `StudentProfileEditor.jsx:863` |
| `profile_editor__language_input`                   | Input      | ❌ Missing     | `StudentProfileEditor.jsx:873` |
| `profile_editor__student_id_input`                 | Input      | ❌ Missing     | `StudentProfileEditor.jsx:883` |
| `profile_editor__student_cpid_input`               | Input      | ❌ Missing     | `StudentProfileEditor.jsx:893` |
| `profile_editor__specially_abled_checkbox`         | Checkbox   | ❌ Missing     | `StudentProfileEditor.jsx:904` |
| `profile_editor__specially_abled_details_textarea` | Textarea   | ❌ Missing     | `StudentProfileEditor.jsx:917` |

**Step 2: Contact Information:**

| Required data-testid                   | Element | Current Status | File Location                     |
| -------------------------------------- | ------- | -------------- | --------------------------------- |
| `profile_editor__email_input`        | Input   | ❌ Missing     | `StudentProfileEditor.jsx:937`  |
| `profile_editor__phone_input`        | Input   | ❌ Missing     | `StudentProfileEditor.jsx:955`  |
| `profile_editor__address_input`      | Input   | ❌ Missing     | `StudentProfileEditor.jsx:973`  |
| `profile_editor__city_input`         | Input   | ❌ Missing     | `StudentProfileEditor.jsx:984`  |
| `profile_editor__state_input`        | Input   | ❌ Missing     | `StudentProfileEditor.jsx:994`  |
| `profile_editor__zip_code_input`     | Input   | ❌ Missing     | `StudentProfileEditor.jsx:1004` |
| `profile_editor__native_state_input` | Input   | ❌ Missing     | `StudentProfileEditor.jsx:1014` |

**Step 3: Parent/Guardian:**

| Required data-testid                            | Element  | Current Status | File Location                     |
| ----------------------------------------------- | -------- | -------------- | --------------------------------- |
| `profile_editor__father_full_name_input`      | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1040` |
| `profile_editor__father_age_range_select`     | Select   | ❌ Missing     | `StudentProfileEditor.jsx:1048` |
| `profile_editor__father_occupation_input`     | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1064` |
| `profile_editor__father_email_input`          | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1074` |
| `profile_editor__mother_full_name_input`      | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1093` |
| `profile_editor__mother_age_range_select`     | Select   | ❌ Missing     | `StudentProfileEditor.jsx:1101` |
| `profile_editor__mother_occupation_input`     | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1117` |
| `profile_editor__mother_email_input`          | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1127` |
| `profile_editor__guardian_different_checkbox` | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1142` |
| `profile_editor__guardian_full_name_input`    | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1157` |
| `profile_editor__guardian_relationship_input` | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1167` |
| `profile_editor__guardian_phone_input`        | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1178` |
| `profile_editor__guardian_email_input`        | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1188` |
| `profile_editor__guardian_address_input`      | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1199` |

**Step 4: Education Details:**

| Required data-testid                    | Element | Current Status | File Location                     |
| --------------------------------------- | ------- | -------------- | --------------------------------- |
| `profile_editor__full_name_input`     | Input   | ❌ Missing     | `StudentProfileEditor.jsx:1236` |
| `profile_editor__current_grade_input` | Input   | ❌ Missing     | `StudentProfileEditor.jsx:1247` |
| `profile_editor__section_input`       | Input   | ❌ Missing     | `StudentProfileEditor.jsx:1257` |
| `profile_editor__board_stream_select` | Select  | ❌ Missing     | `StudentProfileEditor.jsx:1265` |

**Step 5: Focus Areas (Multi-Select Checkboxes):**

| Required data-testid Pattern                                 | Element  | Current Status | File Location                                         |
| ------------------------------------------------------------ | -------- | -------------- | ----------------------------------------------------- |
| `profile_editor__short_term_focus__{formatTestId(option)}` | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1301` (MultiSelectPicker) |
| `profile_editor__long_term_focus__{formatTestId(option)}`  | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1333` (MultiSelectPicker) |
| `profile_editor__short_term_focus_others_text`             | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1312`                     |
| `profile_editor__long_term_focus_others_text`              | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1344`                     |

**Step 6: Self-Assessment (Multi-Select Checkboxes):**

| Required data-testid Pattern                            | Element  | Current Status | File Location                                         |
| ------------------------------------------------------- | -------- | -------------- | ----------------------------------------------------- |
| `profile_editor__strength__{formatTestId(option)}`    | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1375` (MultiSelectPicker) |
| `profile_editor__improvement__{formatTestId(option)}` | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1407` (MultiSelectPicker) |
| `profile_editor__strength_others_text`                | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1386`                     |
| `profile_editor__improvement_others_text`             | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1418`                     |

**Step 7: Hobbies & Clubs:**

| Required data-testid Pattern                      | Element  | Current Status | File Location                                         |
| ------------------------------------------------- | -------- | -------------- | ----------------------------------------------------- |
| `profile_editor__hobby__{formatTestId(option)}` | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1449` (MultiSelectPicker) |
| `profile_editor__club_{formatTestId(option)}`   | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1495` (Direct mapping)    |
| `profile_editor__hobby_other_text`              | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1460`                     |
| `profile_editor__club_other_text`               | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1518`                     |

**Step 8: Achievements:**

| Required data-testid                               | Element  | Current Status | File Location                                                 |
| -------------------------------------------------- | -------- | -------------- | ------------------------------------------------------------- |
| `profile_editor__achievement_academics_textarea` | Textarea | ❌ Missing     | `StudentProfileEditor.jsx:1541`                             |
| `profile_editor__achievement_sports_textarea`    | Textarea | ❌ Missing     | `StudentProfileEditor.jsx:1551`                             |
| `profile_editor__achievement_cultural_textarea`  | Textarea | ❌ Missing     | `StudentProfileEditor.jsx:1561`                             |
| `profile_editor__achievement_trained_textarea`   | Textarea | ❌ Missing     | `StudentProfileEditor.jsx:1572` (conditional - adults only) |
| `profile_editor__achievement_others_textarea`    | Textarea | ❌ Missing     | `StudentProfileEditor.jsx:1583`                             |

**Step 9: Expectations:**

| Required data-testid Pattern                            | Element  | Current Status | File Location                                         |
| ------------------------------------------------------- | -------- | -------------- | ----------------------------------------------------- |
| `profile_editor__expectation__{formatTestId(option)}` | Checkbox | ❌ Missing     | `StudentProfileEditor.jsx:1605` (MultiSelectPicker) |
| `profile_editor__expectation_others_text`             | Input    | ❌ Missing     | `StudentProfileEditor.jsx:1616`                     |

#### ❌ TEMPORARY LOCATORS (Need data-testid):

| Current Locator                                                                 | Type  | Location                       | Required data-testid                         | Notes                           |
| ------------------------------------------------------------------------------- | ----- | ------------------------------ | -------------------------------------------- | ------------------------------- |
| `//button[contains(@class, 'absolute right-0') and contains(@class, 'z-20')]` | XPath | `profile_editor_page.py:328` | `profile_editor__tabs_scroll_right_button` | Right scroll button for tabs    |
| `//button[.//*[contains(@class, 'lucide-chevron-right')...]]`                 | XPath | `profile_editor_page.py:342` | `profile_editor__tabs_scroll_right_button` | Alternative right scroll button |
| `//button[contains(@class, 'absolute left-0') and contains(@class, 'z-20')]`  | XPath | `profile_editor_page.py:360` | `profile_editor__tabs_scroll_left_button`  | Left scroll button for tabs     |
| `//div[@role='status']`                                                       | XPath | `profile_editor_page.py:520` | `profile_editor__toast_message`            | Toast notification container    |

---

### 7. ASSESSMENTS PAGE (`pages/assessments_page.py`)

#### ✅ Currently Using data-testid (Expected):

- Dynamic pattern: `assessment_card__{assignmentId}`
- Dynamic pattern: `assessment_card__{assignmentId}_action`

**Status**: ✅ All locators use data-testid - No temporary locators

---

## 📊 SUMMARY STATISTICS

### Total Missing data-testid Attributes: **~60+ base attributes + dynamic checkboxes**

**Breakdown:**

- **Login Page**: 1 temporary locator
- **Dashboard Page**: 1 temporary locator
- **Profile Editor Page**:
  - **50+ base attributes** (all inputs, selects, textareas, buttons, tabs)
  - **100+ dynamic checkboxes** (Focus Areas, Strengths, Improvements, Hobbies, Clubs, Expectations)
  - **4 temporary XPath locators** (scroll buttons, toast messages)

### Total Temporary Locators: **6 XPath locators**

---

## 🎯 PRIORITY ORDER FOR UI DEV TEAM

### Priority 1: CRITICAL (Required for Basic Automation)

1. **Profile Editor - Navigation Buttons** (4 attributes)

   - `profile_editor__prev_button`
   - `profile_editor__next_button`
   - `profile_editor__cancel_button`
   - `profile_editor__save_button`
2. **Profile Editor - Tab Navigation** (9 attributes)

   - All 9 tab buttons with pattern: `profile_editor__tab_{formatTestId(section.title)}`
3. **Profile Editor - Step 1-4 Basic Fields** (30+ attributes)

   - All input fields, selects, checkboxes in Steps 1-4

### Priority 2: IMPORTANT (Required for Complete Automation)

1. **Profile Editor - Multi-Select Checkboxes** (100+ dynamic attributes)

   - Update `MultiSelectPicker` component to generate `data-testid` using `testIdPrefix` and `formatTestId`
   - This will automatically fix Focus Areas, Strengths, Improvements, Hobbies, Expectations
2. **Profile Editor - Clubs Checkboxes** (12+ attributes)

   - Add `data-testid` to each club checkbox in the mapping
3. **Profile Editor - Textareas** (5 attributes)

   - All achievement textareas

### Priority 3: NICE TO HAVE (Optional)

1. **Temporary Locators Replacement**
   - Tab scroll buttons
   - Toast message containers
   - Welcome message

---

## 📝 IMPLEMENTATION NOTES FOR UI DEV TEAM

### 1. MultiSelectPicker Component Update

**File**: `src/pages/StudentProfileEditor.jsx` (Line 147)

**Current Code**:

```jsx
<input
  type="checkbox"
  data-testid={testIdPrefix ? `${testIdPrefix}__${formatTestId(option)}` : undefined}
  ...
/>
```

**Status**: ✅ Already implemented in code, but not rendering in DOM

**Action**: Verify `testIdPrefix` prop is being passed correctly to all `MultiSelectPicker` instances

### 2. Tab Navigation

**File**: `src/pages/StudentProfileEditor.jsx` (Line 1821)

**Current Code**:

```jsx
const tabTestId = `profile_editor__tab_${formatTestId(section.title)}`
<button data-testid={tabTestId} ...>
```

**Status**: ✅ Already implemented in code, but not rendering in DOM

**Action**: Verify `formatTestId` function is working correctly

### 3. All Input Fields

**Pattern to Follow**:

```jsx
<input
  data-testid="profile_editor__{field_name}_input"
  ...
/>
```

### 4. All Select Dropdowns

**Pattern to Follow**:

```jsx
<select
  data-testid="profile_editor__{field_name}_select"
  ...
>
```

### 5. All Textareas

**Pattern to Follow**:

```jsx
<textarea
  data-testid="profile_editor__{field_name}_textarea"
  ...
/>
```

### 6. Tab Scroll Buttons

**Required data-testid**:

- `profile_editor__tabs_scroll_right_button`
- `profile_editor__tabs_scroll_left_button`

**Location**: Tab scroll container buttons (around line 1850-1860)

### 7. Toast Messages

**Required data-testid**:

- `profile_editor__toast_message` (or `profile_editor__success_toast` / `profile_editor__error_toast`)

---

## ✅ VERIFICATION CHECKLIST

After UI Dev Team adds all attributes, verify:

- [ ] All 50+ base attributes are present in DOM
- [ ] All 9 tab buttons have correct `data-testid`
- [ ] All navigation buttons (Prev, Next, Cancel, Save) have `data-testid`
- [ ] All input fields have `data-testid`
- [ ] All select dropdowns have `data-testid`
- [ ] All textareas have `data-testid`
- [ ] All checkboxes (multi-select) have `data-testid` with correct pattern
- [ ] Tab scroll buttons have `data-testid`
- [ ] Toast messages have `data-testid`
- [ ] Run `scripts/validate_dom_locators.py` - should find 100% of expected attributes

---

## 🔄 NEXT STEPS

1. **UI Dev Team**: Add all missing `data-testid` attributes as per this list
2. **Automation Team**: Run DOM validation script to verify
3. **Both Teams**: Verify 100% alignment
4. **Testing**: Run complete automation flow

---

**Document Version**: 1.0
**Last Updated**: Based on DOM validation (0 attributes found)
**Status**: Ready for UI Dev Team Implementation
