Skip to content

Commit 7b9b1ee

Browse files
docs: add QA UI testing guide for spp_cel_registry_search
1 parent 0d9468b commit 7b9b1ee

1 file changed

Lines changed: 365 additions & 0 deletions

File tree

Lines changed: 365 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,365 @@
1+
# QA UI Testing Guide — CEL Registry Search
2+
3+
## Prerequisites
4+
5+
- OpenSPP instance with `spp_cel_registry_search` module installed
6+
- Demo data loaded (registrants with various attributes: birthdate, gender, registration date, phone,
7+
email, disabled status)
8+
- At least one user with **Registry Officer** role (has CEL Search access automatically)
9+
- At least one base user **without** Registry Officer or CEL Search User group
10+
11+
## Module Overview
12+
13+
The CEL Registry Search module adds an **Advanced Search** portal under the Registry menu. It allows
14+
users to write CEL (Common Expression Language) expressions to query registrants. The module has no
15+
Python models — it is a frontend-only OWL component that calls `spp.cel.service` on the backend.
16+
17+
**URL:** `/odoo/registry-cel`
18+
**Menu:** Registry > Advanced Search
19+
20+
---
21+
22+
## Test 1: Installation and Menu Visibility
23+
24+
### 1.1 Module installs without errors
25+
26+
1. Go to **Apps**
27+
2. Search for "CEL Registry Search"
28+
3. Verify the module is listed with status "Installed"
29+
4. Verify no errors in the server log related to this module
30+
31+
**Expected:** Module is installed and functional.
32+
33+
### 1.2 Menu visible to Registry Officer
34+
35+
1. Log in as a user with the **Registry Officer** role
36+
2. Click the **Registry** top menu
37+
38+
**Expected:** "Advanced Search" menu item appears under Registry (sequence 85, typically near the
39+
bottom of the menu).
40+
41+
### 1.3 Menu not visible to base user
42+
43+
1. Log in as a base user who does NOT have the Registry Officer, Registry Manager, or CEL Search
44+
User group
45+
2. Click the **Registry** top menu (if visible)
46+
47+
**Expected:** "Advanced Search" menu item does NOT appear. The user should not have access to the
48+
CEL search portal.
49+
50+
### 1.4 Menu visible to CEL Search User
51+
52+
1. Assign a user the **CEL Search User** group (without Registry Officer)
53+
2. Log in as that user
54+
3. Navigate to Registry
55+
56+
**Expected:** "Advanced Search" menu item appears. This user should also have Registry Viewer
57+
permissions (implied by the CEL Search User group).
58+
59+
---
60+
61+
## Test 2: Initial Page Load (Empty State)
62+
63+
### 2.1 Page loads correctly
64+
65+
1. Navigate to **Registry > Advanced Search** (or go to `/odoo/registry-cel`)
66+
67+
**Expected:**
68+
- Page title: "Advanced Search" with a code icon
69+
- A card containing:
70+
- **Profile** dropdown defaulting to "Individuals"
71+
- **CEL Expression** label with an empty code editor
72+
- **Search** button (disabled)
73+
- **Clear** button (disabled)
74+
- Below the card: an empty state with:
75+
- A large code icon (faded)
76+
- Text: "Search with CEL Expressions"
77+
- Text: "Write a CEL expression to filter registrants, then click Search."
78+
- Three example expressions:
79+
- `age_years(r.birthdate) >= 18` - Adults 18+
80+
- `is_female(r.gender_id)` - Females
81+
- `r.registration_date > "2024-01-01"` - Recent registrations
82+
83+
### 2.2 Profile dropdown options
84+
85+
1. Click the **Profile** dropdown
86+
87+
**Expected:** Two options: "Individuals" and "Groups". "Individuals" is selected by default.
88+
89+
---
90+
91+
## Test 3: CEL Expression Editor
92+
93+
### 3.1 Editor accepts input
94+
95+
1. Click inside the CEL expression editor
96+
2. Type: `r.name != ""`
97+
98+
**Expected:**
99+
- Text appears in the editor with syntax highlighting
100+
- The **Search** button becomes enabled
101+
- The **Clear** button becomes enabled
102+
- A validation indicator appears (green checkmark with match count if valid)
103+
104+
### 3.2 Autocomplete and symbol browser
105+
106+
1. Clear the editor
107+
2. Type: `r.` (with the dot)
108+
109+
**Expected:** An autocomplete dropdown appears showing available fields (e.g., `name`, `birthdate`,
110+
`gender_id`, `phone`, `email`, `registration_date`, `disabled`, etc.).
111+
112+
### 3.3 Toolbar and symbol browser visibility
113+
114+
1. Look at the editor area
115+
116+
**Expected:** A toolbar is visible above the editor. A symbol browser panel is available for
117+
browsing available fields and functions.
118+
119+
### 3.4 Invalid expression feedback
120+
121+
1. Type an invalid expression: `r.name ===`
122+
123+
**Expected:**
124+
- A red error indicator appears (red X icon)
125+
- The error message describes the syntax issue
126+
- The **Search** button is disabled (cannot search with invalid expression)
127+
128+
### 3.5 Validation match count
129+
130+
1. Type a valid expression: `r.name != ""`
131+
132+
**Expected:** A green checkmark appears with a count like "X match(es)" showing how many registrants
133+
match before you execute the search.
134+
135+
---
136+
137+
## Test 4: Search — Individuals Profile
138+
139+
### 4.1 Basic search with results
140+
141+
1. Set profile to **Individuals**
142+
2. Type: `r.name != ""`
143+
3. Click **Search**
144+
145+
**Expected:**
146+
- A loading spinner appears briefly with "Searching..." text
147+
- Results appear showing "X Result(s) Found" (or "Showing 50 of X Result(s)" if more than 50)
148+
- Each result shows:
149+
- Registrant name
150+
- Type badge: "Individual" with a person icon
151+
- Registration date (right side)
152+
- Phone number (if present, with phone icon)
153+
- Email (if present, with envelope icon)
154+
- A right chevron indicating the row is clickable
155+
156+
### 4.2 Search with no results
157+
158+
1. Type an expression that matches nothing: `r.name == "ZZZZNONEXISTENT999"`
159+
2. Click **Search**
160+
161+
**Expected:**
162+
- Result section shows: "0 Result(s) Found"
163+
- An info alert appears: "No registrants found matching your CEL expression."
164+
165+
### 4.3 Result limit (50 records)
166+
167+
1. Type an expression that matches many registrants: `r.name != ""`
168+
2. Click **Search**
169+
170+
**Expected:** If more than 50 matches exist:
171+
- Header shows: "Showing 50 of X Result(s)"
172+
- Only 50 results are displayed in the list
173+
174+
### 4.4 Click a result to open form
175+
176+
1. Perform a search that returns results
177+
2. Click on any result row
178+
179+
**Expected:** The individual's form view opens (the standard Individual form from `spp_registry`).
180+
You should be able to navigate back using the browser back button or breadcrumbs.
181+
182+
### 4.5 Disabled registrant display
183+
184+
1. Ensure at least one registrant is disabled (has `disabled = True`)
185+
2. Search with an expression that includes disabled registrants
186+
187+
**Expected:** Disabled registrants appear in the list with:
188+
- Muted text (gray, reduced opacity)
189+
- A yellow "Disabled" badge with a ban icon next to the name
190+
- The row is still clickable and opens the form view
191+
192+
---
193+
194+
## Test 5: Search — Groups Profile
195+
196+
### 5.1 Switch to Groups profile
197+
198+
1. Change the **Profile** dropdown to "Groups"
199+
200+
**Expected:**
201+
- The dropdown shows "Groups" as selected
202+
- If there was an expression in the editor, validation re-runs for the Groups profile
203+
- The editor may show different autocomplete options appropriate for groups
204+
205+
### 5.2 Search groups
206+
207+
1. With "Groups" selected, type: `r.name != ""`
208+
2. Click **Search**
209+
210+
**Expected:**
211+
- Results show group registrants
212+
- Each result shows type badge: "Group" with a people icon (fa-users)
213+
- Clicking a result opens the Group form view (with membership tab)
214+
215+
### 5.3 Profile switch triggers re-validation
216+
217+
1. Type a valid expression with "Individuals" selected
218+
2. Note the validation status (green checkmark)
219+
3. Switch to "Groups"
220+
221+
**Expected:** The validation re-runs. The expression may still be valid (if it uses fields common to
222+
both profiles) or may become invalid (if it uses individual-specific fields).
223+
224+
---
225+
226+
## Test 6: Clear Functionality
227+
228+
### 6.1 Clear after search
229+
230+
1. Perform a search that returns results
231+
2. Click **Clear**
232+
233+
**Expected:**
234+
- The expression editor is emptied
235+
- The results section disappears
236+
- The empty state (with examples) reappears
237+
- The **Search** button is disabled
238+
- The **Clear** button is disabled
239+
240+
### 6.2 Clear with expression but no search
241+
242+
1. Type an expression but do NOT click Search
243+
2. Click **Clear**
244+
245+
**Expected:**
246+
- The expression editor is emptied
247+
- The empty state remains (no results were shown)
248+
- Both buttons are disabled
249+
250+
---
251+
252+
## Test 7: Error Handling
253+
254+
### 7.1 Backend error
255+
256+
1. Type an expression that causes a backend error (e.g., reference a field that does not exist and
257+
somehow bypasses validation): `r.nonexistent_field_xyz > 0`
258+
259+
**Expected:**
260+
- A red error notification appears with the error message
261+
- The page returns to the empty state (does NOT show "0 Result(s) Found")
262+
- The expression remains in the editor so the user can fix it
263+
264+
### 7.2 Empty expression warning
265+
266+
1. Clear the editor completely
267+
2. If the Search button is somehow clickable, click it
268+
269+
**Expected:** The Search button should be disabled when the expression is empty. If triggered
270+
programmatically, a warning notification appears: "Please enter a CEL expression to search."
271+
272+
### 7.3 Invalid expression warning
273+
274+
1. Type an invalid expression (e.g., `r.name ===`)
275+
2. If the Search button is somehow clickable, click it
276+
277+
**Expected:** The Search button should be disabled when the expression is invalid. If triggered
278+
programmatically, a warning notification appears: "Please fix the expression errors before
279+
searching."
280+
281+
---
282+
283+
## Test 8: Visual and Layout Checks
284+
285+
### 8.1 Hover effect on results
286+
287+
1. Perform a search that returns results
288+
2. Hover your mouse over a result row
289+
290+
**Expected:** The row background changes to a slightly darker shade (light gray), indicating it is
291+
clickable.
292+
293+
### 8.2 Responsive layout
294+
295+
1. Resize the browser window to a narrow width (< 768px)
296+
297+
**Expected:**
298+
- The page remains usable
299+
- The header font size reduces
300+
- The profile dropdown takes full width
301+
- Result items stack gracefully
302+
303+
### 8.3 Page scrolling
304+
305+
1. Perform a search that returns many results (close to 50)
306+
2. Scroll down the page
307+
308+
**Expected:** The page scrolls smoothly. The results list does not get clipped or overflow
309+
incorrectly.
310+
311+
---
312+
313+
## Test 9: Security Verification
314+
315+
### 9.1 Direct URL access without permission
316+
317+
1. Log in as a base user who does NOT have the CEL Search User or Registry Officer group
318+
2. Navigate directly to `/odoo/registry-cel`
319+
320+
**Expected:** The user should either see an access error or be redirected. They should NOT be able
321+
to use the search portal.
322+
323+
### 9.2 CEL Search User can only view (not edit) registrants
324+
325+
1. Log in as a user with ONLY the **CEL Search User** group
326+
2. Perform a search and click a result to open the form
327+
328+
**Expected:** The registrant form opens in read-only mode. The user should be able to view but not
329+
modify the registrant (since CEL Search User only implies Registry Viewer, not Officer).
330+
331+
---
332+
333+
## Test Summary Checklist
334+
335+
| # | Test | Pass/Fail |
336+
|---|------|-----------|
337+
| 1.1 | Module installs without errors | |
338+
| 1.2 | Menu visible to Registry Officer | |
339+
| 1.3 | Menu not visible to base user | |
340+
| 1.4 | Menu visible to CEL Search User | |
341+
| 2.1 | Page loads with correct empty state | |
342+
| 2.2 | Profile dropdown has correct options | |
343+
| 3.1 | Editor accepts input and enables Search | |
344+
| 3.2 | Autocomplete works | |
345+
| 3.3 | Toolbar and symbol browser visible | |
346+
| 3.4 | Invalid expression shows error | |
347+
| 3.5 | Validation shows match count | |
348+
| 4.1 | Individual search returns results | |
349+
| 4.2 | Search with no results shows info alert | |
350+
| 4.3 | Result limit (50) works correctly | |
351+
| 4.4 | Clicking result opens Individual form | |
352+
| 4.5 | Disabled registrant displayed correctly | |
353+
| 5.1 | Profile switch to Groups works | |
354+
| 5.2 | Groups search returns group results | |
355+
| 5.3 | Profile switch triggers re-validation | |
356+
| 6.1 | Clear after search resets everything | |
357+
| 6.2 | Clear with expression but no search | |
358+
| 7.1 | Backend error shows notification, returns to empty state | |
359+
| 7.2 | Empty expression warning | |
360+
| 7.3 | Invalid expression warning | |
361+
| 8.1 | Hover effect visible on result rows | |
362+
| 8.2 | Responsive layout on narrow screens | |
363+
| 8.3 | Page scrolling works correctly | |
364+
| 9.1 | Direct URL access denied without permission | |
365+
| 9.2 | CEL Search User has read-only access | |

0 commit comments

Comments
 (0)