Skip to content

E2E Test Coverage Implementation Plan #889

Description

@carlosthe19916

Overview

Implement comprehensive E2E test coverage for Trustify UI pages using vanilla Playwright spec tests following Page Object Model pattern.

Test Approach:

  • Vanilla Playwright spec tests (.spec.ts files)
  • Page Object Model pattern
  • Custom assertions from existing framework
  • No BDD/Gherkin features

Testing Decisions:

  • Breadcrumb navigation tests excluded - Justified as low risk (standard PatternFly component behavior)

Total Deliverables: 34 spec files + 5 page objects


Phase 1: File Upload Tests

Goal: Implement upload functionality tests for advisories and SBOMs

Estimated Files: 9 spec files + 2 page objects

Foundation Tasks (Do First)

  • Verify test data structure in e2e/tests/common/assets/ for upload test files
  • Create upload helpers in e2e/tests/ui/pages/common/ if patterns differ from existing tests
  • Add custom assertions for upload validation if needed (extend e2e/tests/ui/assertions/)

Advisory Upload - /advisories/upload

Tasks:

  • Create AdvisoryUploadPage.ts page object
  • Create upload.spec.ts - Single file uploads (CSAF, CVE, OSV)
  • Create multi-file-upload.spec.ts - Multiple file uploads, progress tracking
  • Create navigation.spec.ts - Success messages, navigation to details (no breadcrumb tests)
  • Create error-handling.spec.ts - Invalid formats, malformed files, network errors

SBOM Upload - /sboms/upload

Tasks:

  • Create SbomUploadPage.ts page object
  • Create upload.spec.ts - Single file uploads (CycloneDX 1.3-1.6, SPDX 2.2-2.3)
  • Create format-validation.spec.ts - Format validation, version support
  • Create multi-file-upload.spec.ts - Mixed format uploads
  • Create navigation.spec.ts - Success messages, navigation to details (no breadcrumb tests)

Phase 2: License List

Goal: Implement license list page tests

Estimated Files: 4 spec files + 1 page object

Foundation Tasks (Do First)

  • Update e2e/tests/ui/pages/Navigation.ts - Add "Licenses" menu option for navigation

License List Tests - /licenses

Tasks:

  • Create LicenseListPage.ts page object
  • Create filter.spec.ts - Text filters, clear filters, URL persistence
  • Create pagination.spec.ts - Pagination controls, items per page
  • Create sort.spec.ts - Column sorting
  • Create columns.spec.ts - Column visibility and data rendering

Phase 3: Not Found Page

Goal: Implement 404 error page tests

Estimated Files: 1 spec file + 1 page object

Tasks:

  • Create NotFoundPage.ts page object
  • Create error-page.spec.ts - 404 display, error icon, invalid routes

Phase 4: Importer List Enhancements

Goal: Enhance importer list tests with advanced functionality

Estimated Files: 4 spec files + 1 page object

Tasks:

  • Create ImporterListPage.ts page object
  • Create enable-disable.spec.ts - Enable/disable with confirmation dialogs
  • Create run-now.spec.ts - Run Now functionality, progress tracking
  • Create expandable-reports.spec.ts - Reports table, pagination, sorting
  • Create log-viewer.spec.ts - Log modal functionality

Phase 5: Advisory Details Enhancements

Goal: Complete advisory details page test coverage

Estimated Files: 3 spec files (1 enhanced, 2 new)

Tasks:

  • Enhance info.spec.ts - Overview, publisher, tracking cards
  • Create actions.spec.ts - Download and delete actions
  • Create vulnerabilities/columns.spec.ts - Discovery, release, score, CWE columns

Phase 6: Package Details Enhancements

Goal: Complete package details page test coverage

Estimated Files: 3 spec files (1 enhanced, 2 new)

Tasks:

  • Enhance info.spec.ts - Package name, qualifiers
  • Create vulnerabilities/filter.spec.ts - Filter functionality, affected vulnerabilities
  • Create sboms/help.spec.ts - Help icon popover

Phase 7: SBOM Details Enhancements

Goal: Complete SBOM details page test coverage

Estimated Files: 5 spec files (2 enhanced, 3 new)

Tasks:

  • Enhance info.spec.ts - Metadata, creation, statistics, package cards
  • Enhance actions.spec.ts - Delete with confirmation
  • Create packages/expandable-rows.spec.ts - Vulnerabilities per package
  • Create packages/license.spec.ts - License info and mappings
  • Create vulnerabilities/expandable-rows.spec.ts - Detailed vuln info
  • Create vulnerabilities/help.spec.ts - Help popover

Phase 8: Vulnerability Details Enhancements

Goal: Complete vulnerability details page test coverage

Estimated Files: 5 spec files (1 enhanced, 4 new)

Tasks:

  • Enhance info.spec.ts - Severity shield, CVSS score
  • Create overview.spec.ts - Description, reserved/published/modified dates with help popovers
  • Create sboms/expandable-rows.spec.ts - Affected packages per SBOM
  • Create sboms/status-labels.spec.ts - Vulnerability status labels
  • Create advisories/filter.spec.ts - Filter functionality

Key Patterns

  • Use custom assertions from e2e/tests/ui/assertions/
  • Follow Page Object Model from existing tests
  • Test critical user flows end-to-end
  • Verify URL state persistence for filters/pagination
  • Test both success and error scenarios
  • Exclude breadcrumb navigation tests (low risk, standard PatternFly behavior)

Reference Files

  • e2e/tests/ui/pages/Table.ts - Table interaction patterns
  • e2e/tests/ui/pages/Toolbar.ts - Filter patterns
  • e2e/tests/ui/pages/common/filter-test-helpers.ts - Reusable helpers
  • client/src/app/components/UploadFiles.tsx - Upload UI structure
  • e2e/tests/ui/pages/sbom-list/SbomListPage.ts - List page pattern
  • client/src/app/pages/importer-list/importer-list.tsx - Expandable row pattern

Verification

# Run individual tests
npm run e2e:test -- <test-file-path>

# Run full suite
npm run e2e:test

Metadata

Metadata

Labels

kind/featureCategorizes issue or PR as related to a new feature.priority/backlogHigher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions