Skip to content

[daily-playwright] Add tests for Licenses page - #16791

Draft
github-actions[bot] wants to merge 1 commit into
developfrom
daily-playwright/2026-09-08-86522292398db8fb
Draft

github-actions[bot] wants to merge 1 commit into
developfrom
daily-playwright/2026-09-08-86522292398db8fb

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Overview

Added comprehensive Playwright E2E tests for the Licenses page (src/pages/Licenses/Licenses.tsx), which was previously untested.

What Was Tested

The Licenses page displays SBOM (Software Bill of Materials) information for both frontend and backend dependencies. Tests cover:

  • Page Loading: Title, description, and initial state
  • Tab Navigation: Switching between frontend/backend SBOM tabs
  • Data Display: SBOM version, creation date, package listing
  • User Interactions: Copy-to-clipboard button functionality
  • Link Validation: Package and license links are properly formatted
  • Layout: Responsive grid layout verification

Test Cases Added

Created tests/profile/licenses.spec.ts with 6 test cases:

  1. Page load verification - Ensures title and description render correctly
  2. Tab switching - Verifies frontend/backend tab switching works
  3. SBOM data loading - Validates package cards and metadata display
  4. Copy functionality - Tests the "Copy BOM JSON" button
  5. Link validation - Checks package and license links
  6. Backend data loading - Ensures backend SBOM tab also loads data
  7. Responsive layout - Verifies responsive design patterns

Test Quality Checklist

  • ✅ Uses role-based selectors (getByRole, getByText, getByLabel)
  • ✅ Avoids hardcoded CSS selectors where possible
  • ✅ Includes proper assertions and test.step() organization
  • ✅ Handles loading states appropriately (external SBOM URLs)
  • ✅ Tests both frontend and backend data paths
  • ✅ Independent tests with no shared state
  • ✅ Follows file naming convention: licenses.spec.ts

How to Run Locally

# Run the new Licenses page tests
npx playwright test tests/profile/licenses.spec.ts

# Run with UI mode for debugging
npx playwright test tests/profile/licenses.spec.ts --ui

Coverage Impact

  • Before: 0 tests for Licenses page
  • After: 6 new test cases covering core workflows
  • Related issue: Tracks overall Playwright coverage expansion

Notes

  • Tests use existing authentication state from tests/.auth/user.json
  • SBOM data is fetched from external URLs configured in care.config.ts
  • Tests gracefully handle notification elements that may not exist (copy feedback varies)
  • No changes to application source code

AI generated by Daily Playwright Test Improver

- Added comprehensive tests for Licenses page (previously untested)
- Covers tab switching, SBOM data loading, copy functionality
- Tests both frontend and backend SBOM tabs
- Includes layout and link validation tests
- 6 test cases with full step documentation
@github-actions github-actions Bot added enhancement New feature or request testing labels Sep 8, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying care-preview with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8a06f91
Status: ✅  Deploy successful!
Preview URL: https://aae50250.care-preview-a7w.pages.dev
Branch Preview URL: https://daily-playwright-2026-09-08.care-preview-a7w.pages.dev

View logs

@github-actions github-actions Bot added the stale label Sep 15, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request stale testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants