Some checks failed
Go Benchmark / Performance Regression Check (push) Has been cancelled
Cerberus Integration / Cerberus Security Stack Integration (push) Has been cancelled
Upload Coverage to Codecov / Backend Codecov Upload (push) Has been cancelled
Upload Coverage to Codecov / Frontend Codecov Upload (push) Has been cancelled
CodeQL - Analyze / CodeQL analysis (go) (push) Has been cancelled
CodeQL - Analyze / CodeQL analysis (javascript-typescript) (push) Has been cancelled
CrowdSec Integration / CrowdSec Bouncer Integration (push) Has been cancelled
Docker Build, Publish & Test / build-and-push (push) Has been cancelled
Quality Checks / Auth Route Protection Contract (push) Has been cancelled
Quality Checks / Codecov Trigger/Comment Parity Guard (push) Has been cancelled
Quality Checks / Backend (Go) (push) Has been cancelled
Quality Checks / Frontend (React) (push) Has been cancelled
Rate Limit integration / Rate Limiting Integration (push) Has been cancelled
Security Scan (PR) / Trivy Binary Scan (push) Has been cancelled
Supply Chain Verification (PR) / Verify Supply Chain (push) Has been cancelled
WAF integration / Coraza WAF Integration (push) Has been cancelled
Docker Build, Publish & Test / Security Scan PR Image (push) Has been cancelled
Repo Health Check / Repo health (push) Has been cancelled
History Rewrite Dry-Run / Dry-run preview for history rewrite (push) Has been cancelled
Prune Renovate Branches / prune (push) Has been cancelled
Renovate / renovate (push) Has been cancelled
Nightly Build & Package / sync-development-to-nightly (push) Has been cancelled
Nightly Build & Package / Trigger Nightly Validation Workflows (push) Has been cancelled
Nightly Build & Package / build-and-push-nightly (push) Has been cancelled
Nightly Build & Package / test-nightly-image (push) Has been cancelled
Nightly Build & Package / verify-nightly-supply-chain (push) Has been cancelled
46 lines
2.7 KiB
Markdown
Executable File
46 lines
2.7 KiB
Markdown
Executable File
# Plan: Fix E2E Test Failures
|
|
|
|
## Objective
|
|
Fix implementation bugs and test logic issues causing failures in `certificates.spec.ts`, `navigation.spec.ts`, and `proxy-acl-integration.spec.ts`.
|
|
|
|
## Analysis of Failures
|
|
|
|
### 1. Certificates Test (`tests/core/certificates.spec.ts`)
|
|
- **Failure**: Fails to assert "Domain" column header. Received `undefined`.
|
|
- **Root Cause**: Race condition. The test attempts to valid header text before the table has finished rendering (likely while in Loading or Empty state).
|
|
- **Fix**: explicit wait for the table element to be visible before asserting headers.
|
|
|
|
### 2. Navigation Test (`tests/core/navigation.spec.ts`)
|
|
- **Failure**: Sidebar expected to be hidden on mobile but is detected as visible.
|
|
- **Root Cause**: The Sidebar implementation in `Layout.tsx` uses CSS transforms (`-translate-x-full`) to hide the menu on mobile. Playwright's `.toBeVisible()` matcher considers elements with `opacity: 1` and non-zero size as "visible", even if translated off-screen.
|
|
- **Fix**: Update the assertion to check that the sidebar is hidden from the viewport OR check for the presence of the `-translate-x-full` class.
|
|
|
|
### 3. Proxy ACL Integration (`tests/integration/proxy-acl-integration.spec.ts`)
|
|
- **Failure**: Timeout waiting for `select[name="access_list_id"]`.
|
|
- **Root Cause**: The `AccessListSelector.tsx` component renders a standard `<select>` element but omits the `name` attribute. The test specifically queries by this attribute.
|
|
- **Fix**: Add `name="access_list_id"` (and `id="access_list_id"` for accessibility) to the `select` element in `AccessListSelector.tsx`.
|
|
|
|
## Tasks
|
|
|
|
### Phase 1: Fix Component Implementation
|
|
- [ ] **Task 1.1**: Update `frontend/src/components/AccessListSelector.tsx`
|
|
- Add `name="access_list_id"` to the `<select>` element.
|
|
- Add `id="access_list_id"` to the `<select>` element.
|
|
|
|
### Phase 2: Fix Test Logic
|
|
- [ ] **Task 2.1**: Update `tests/core/certificates.spec.ts`
|
|
- Insert `await expect(page.getByRole('table')).toBeVisible()` before header assertions.
|
|
- [ ] **Task 2.2**: Update `tests/core/navigation.spec.ts`
|
|
- Change `.not.toBeVisible()` to `.not.toBeInViewport()` (if available in project Playwright version) or check for class: `await expect(page.getByRole('complementary')).toHaveClass(/-translate-x-full/)`.
|
|
|
|
### Phase 3: Verification
|
|
- [ ] **Task 3.1**: Run affected tests to verify fixes.
|
|
- `npx playwright test tests/core/certificates.spec.ts`
|
|
- `npx playwright test tests/core/navigation.spec.ts`
|
|
- `npx playwright test tests/integration/proxy-acl-integration.spec.ts`
|
|
|
|
## Files to Modify
|
|
- `frontend/src/components/AccessListSelector.tsx`
|
|
- `tests/core/certificates.spec.ts`
|
|
- `tests/core/navigation.spec.ts`
|