Skip to content

test: add Playwright coverage and test ids for CpsMenuComponent - #821

Open
fateeand wants to merge 3 commits into
masterfrom
794-cover-menu-component-with-playwright-tests
Open

test: add Playwright coverage and test ids for CpsMenuComponent#821
fateeand wants to merge 3 commits into
masterfrom
794-cover-menu-component-with-playwright-tests

Conversation

@fateeand

@fateeand fateeand commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added Playwright E2E coverage for CpsMenuComponent, covering real browser behavior the Jest unit suite can't exercise: the Angular open/close animation and z-index stacking, focus-on-show timing, keyboard-vs-mouse focus-ring suppression on Escape-close (via CpsFocusService), real viewport-relative flip positioning with arrow visibility, focusOnShow=false trigger-retention, internal-link (routerLink) items, containerClass, and the beforeMenuHidden/containerMouseLeave outputs.
  • Added "Menu with custom container class" example, plus a previously-unwired beforeMenuHidden output and an internal-link menu item.
  • Added test ids to the component's template.

TODO: Merge with feat: add test ids to menu component to generate a release


Release notes:

  • added Playwright E2E coverage for cps-menu component
  • added test ids to cps-menu component

Copilot AI lite review requested due to automatic review settings August 4, 2026 14:55
@fateeand
fateeand requested a review from lukasmatta as a code owner August 4, 2026 14:55
@fateeand fateeand linked an issue Aug 4, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🟡 Statements 77.2% 6209/8043
🟡 Branches 66.4% 2864/4313
🟡 Functions 78.73% 1170/1486
🟡 Lines 78.16% 5805/7427

Test suite run success

2438 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from db4a080

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Playwright E2E coverage for CpsMenuComponent and wires stable selectors/examples in the composition app to validate real browser behaviors (animation lifecycle, focus management, positioning/flip, routerLink rendering, and emitted outputs).

Changes:

  • Added data-testid attributes to key cps-menu DOM nodes and menu items to support reliable E2E selectors.
  • Updated the menu composition page + examples to demonstrate beforeMenuHidden, containerClass, and an internal-link menu item, with matching test hooks.
  • Introduced a new Playwright spec covering real-world interactions/behavior for the menu (animation, focus, mouse/keyboard modality, flip positioning, outputs).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/cps-ui-kit/src/lib/components/cps-menu/cps-menu.component.html Adds data-testid attributes to menu container/parts and item anchors for Playwright targeting.
projects/composition/src/app/pages/menu-page/menu-page.examples.ts Updates example snippets to include internal link, beforeMenuHidden, and a custom container-class example.
projects/composition/src/app/pages/menu-page/menu-page.component.ts Adds state for new examples (lastHideReason, isCustomClassMenuOpen) and includes internal-link item.
projects/composition/src/app/pages/menu-page/menu-page.component.scss Adds styles to visually distinguish a custom containerClass and the hide-reason display.
projects/composition/src/app/pages/menu-page/menu-page.component.html Wires new example UIs and adds page-level data-testid hooks used by Playwright tests.
playwright/cps-ui-kit/components/cps-menu.spec.ts New E2E coverage for menu behaviors (animation/unmounting, focus, flip positioning, outputs, routerLink).

Comment thread playwright/cps-ui-kit/components/cps-menu.spec.ts
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  474 passed

Details

stats  474 tests across 17 suites
duration  15 minutes, 60 seconds
commit  db4a080
info  For details, download the Playwright report

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cover Menu component with Playwright tests

2 participants