This commit is contained in:
2026-05-04 13:12:57 +02:00
parent e41831447f
commit 48d57c31e1
7 changed files with 216 additions and 132 deletions

View File

@@ -1816,6 +1816,34 @@ The E2E test suite (`e2e/tests/01_page_loading.robot`) verifies every protected
**Vite SPA note:** All routes return HTTP 200 from the dev server (SPA routing). HTTP status checks are not meaningful — focus on DOM state after client-side navigation.
### Auto-Save Indicator for E2E Tests
The config page (`/config`) uses `useAutoSave` to debounce edits before sending PATCH requests. E2E tests that edit config fields must wait for the "Saved" indicator rather than using fixed `Sleep`, otherwise the reload may fire before the HTTP request is sent.
**How to detect a successful save:**
The `AutoSaveIndicator` component renders a `role="status"` region containing a `Badge` with text "Saved" on success. Wait for this element to appear:
```robot
# Wait for auto-save to complete (debounce fires after ~500 ms of inactivity)
Wait For Elements State css=[role="status"]:has-text("Saved") visible timeout=15s
```
On error, the region shows "Save failed." with a Retry button:
```robot
Get Text css=[role="status"] contains Save failed
```
**Flow for config edit tests:**
1. Navigate to `/config` and activate the relevant tab (Jails / Filters / Actions / Server).
2. Select the target jail/item from the list pane.
3. Read the current value and store it for teardown.
4. Edit the field — each keystroke resets the debounce timer.
5. Stop interacting — wait for debounce to fire, then wait for "Saved" indicator.
6. Verify persistence via reload or API assertion.
7. Teardown: restore the original value using the same flow.
---
## 15. Error Observability & Telemetry