# 🎯 COMPLETE DATA-TESTID ATTRIBUTES REQUIREMENT DOCUMENT ## For UI Development Team - Student Profile Editor **Date:** 2025-01-20 **Priority:** 🔴 **CRITICAL - BLOCKING AUTOMATION** **Status:** ❌ **ALL ATTRIBUTES MISSING** **Source:** Analysis of `StudentProfileEditor.jsx` (Lines 1-1822) --- ## 📋 **EXECUTIVE SUMMARY** **ALL form fields, buttons, and interactive elements in `StudentProfileEditor.jsx` are MISSING `data-testid` attributes.** This document provides the **COMPLETE LIST** of all required attributes with exact naming conventions based on **ACTUAL SOURCE CODE ANALYSIS**. **Total Required:** ~200+ attributes --- ## 🔑 **NAMING PATTERN (MANDATORY)** ### **Pattern:** ``` profile_editor__{element_name}_{type} ``` ### **Rules:** 1. **Scope:** Always `profile_editor` 2. **Separator:** Double underscore `__` between scope and element name 3. **Element Name:** Snake_case (lowercase with underscores) 4. **Type Suffix:** - `_input` for text inputs - `_select` for dropdowns - `_textarea` for text areas - `_checkbox` for checkboxes - `_button` for buttons - `_tab` for tab buttons ### **Examples:** - ✅ `profile_editor__first_name_input` - ✅ `profile_editor__gender_select` - ✅ `profile_editor__save_button` - ❌ `profile_editor_first_name` (single underscore) - ❌ `profileEditor__first_name` (camelCase) --- ## 📊 **TAB STRUCTURE (FROM SOURCE CODE)** The profile editor has **9 sections** (tabs) defined in `sections` array (line 758): 1. **Personal Information** (Tab 0) - Includes Contact Information fields 2. **Contact Information** (Tab 1) - Separate tab in code 3. **Parent/Guardian** (Tab 2) 4. **Education Details** (Tab 3) - Displayed as "Institution Details" in UI 5. **Focus Areas** (Tab 4) 6. **Self-Assessment** (Tab 5) 7. **Hobbies & Clubs** (Tab 6) 8. **Achievements** (Tab 7) 9. **Expectations** (Tab 8) **Note:** Based on DOM inspection, Contact Information may be combined with Personal Information in the actual UI. Please verify tab structure. --- ## 🚨 **MISSING ATTRIBUTES BY SECTION** ### **1. PAGE-LEVEL ELEMENTS** | Element | Required Attribute | Line Reference | Current Status | |---------|-------------------|----------------|----------------| | Page container | `profile_editor__page` | Line 1516 | ❌ MISSING | | Progress value display | `profile_editor__progress_value` | Line 1577 | ❌ MISSING | | Missing fields toggle button | `profile_editor__missing_fields_toggle` | Line 1580-1586 | ❌ MISSING | | Back button (header) | `profile_editor__back_button` | Line 1555-1560 | ❌ MISSING | --- ### **2. TAB NAVIGATION** | Element | Required Attribute | Line Reference | Current Status | |---------|-------------------|----------------|----------------| | Tab container | `profile_editor__tabs_container` | Line 1693-1700 | ❌ MISSING | | Tab scroll left button | `profile_editor__tabs_scroll_left_button` | Line 1683-1690 | ❌ MISSING | | Tab scroll right button | `profile_editor__tabs_scroll_right_button` | Line 1729-1736 | ❌ MISSING | | **Tab buttons** (9 tabs) | See below | Line 1702-1724 | ❌ MISSING | #### **Tab Button Attributes (CRITICAL):** The tab buttons are rendered in a loop (line 1702-1724). Each button needs a `data-testid` attribute. **Format:** `profile_editor__tab_{formatTestId(section.title)}` Where `formatTestId` function (if exists) converts: - All non-alphanumeric characters to underscores - Converts to lowercase - Removes leading/trailing underscores **Required Tab Attributes:** | Tab Index | Tab Title | Required Attribute | Line Reference | |-----------|-----------|-------------------|----------------| | 0 | Personal Information | `profile_editor__tab_personal_information` | Line 1702-1724 | | 1 | Contact Information | `profile_editor__tab_contact_information` | Line 1702-1724 | | 2 | Parent/Guardian | `profile_editor__tab_parent_guardian` | Line 1702-1724 | | 3 | Education Details | `profile_editor__tab_education_details` | Line 1702-1724 | | 4 | Focus Areas | `profile_editor__tab_focus_areas` | Line 1702-1724 | | 5 | Self-Assessment | `profile_editor__tab_self_assessment` | Line 1702-1724 | | 6 | Hobbies & Clubs | `profile_editor__tab_hobbies_clubs` | Line 1702-1724 | | 7 | Achievements | `profile_editor__tab_achievements` | Line 1702-1724 | | 8 | Expectations | `profile_editor__tab_expectations` | Line 1702-1724 | **Implementation Note:** Add `data-testid` attribute to the `