Skip to content

test: add Playwright coverage and test ids for CpsPaginatorComponent - #826

Open
fateeand wants to merge 2 commits into
masterfrom
796-cover-paginator-component-with-playwright-tests
Open

test: add Playwright coverage and test ids for CpsPaginatorComponent#826
fateeand wants to merge 2 commits into
masterfrom
796-cover-paginator-component-with-playwright-tests

Conversation

@fateeand

@fateeand fateeand commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added 8 tests covering real browser behavior: real ArrowLeft/ArrowRight keyboard navigation, real focus redirection on both boundary directions (First and Last), real aria-disabled/tabindex reflecting page state, the real nested cps-select rows-per-page dropdown, real alwaysShow=false collapse (driven interactively via a real toggle, not just compared against a second static example), real resetPageOnRowsChange behavior, and real applied backgroundColor CSS.
  • Wired the "Basic usage" demo example and added three new examples: single-page collapse (toggleable via a real cps-checkbox), custom rows-per-page with reset, and custom background color.
  • Added testids to the component's template (cps-paginator, cps-paginator-rows-per-page, cps-paginator-rows-per-page-title, cps-paginator-rows-per-page-select) for downstream consumers.

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


Release notes:

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

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

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🟡 Statements 77.85% 6267/8050
🟡 Branches 66.98% 2889/4313
🟡 Functions 79.61% 1183/1486
🟡 Lines 78.83% 5859/7432

Test suite run success

2474 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from 227684a

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

This PR improves the cps-paginator component’s testability and demo coverage by adding stable data-testid hooks, expanding the composition-page examples, and introducing Playwright E2E tests that validate real browser interactions and accessibility-relevant behavior.

Changes:

  • Added data-testid attributes to key paginator template elements to enable reliable E2E selection and downstream consumer testing.
  • Updated the composition “Paginator” docs page to use interactive state (first/rows) and added new examples (single-page collapse, custom rows-per-page reset, custom background).
  • Added a new Playwright spec covering keyboard navigation, focus redirection, aria-disabled/tabindex behavior, rows-per-page interactions, alwaysShow collapse, reset-on-rows-change, and backgroundColor styling.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
projects/cps-ui-kit/src/lib/components/cps-paginator/cps-paginator.component.html Adds data-testid hooks for the paginator root and rows-per-page UI elements.
projects/composition/src/app/pages/paginator-page/paginator-page.examples.ts Expands the demo examples and wires Basic usage to interactive state with a TS snippet.
projects/composition/src/app/pages/paginator-page/paginator-page.component.ts Adds state + handler for the interactive example and imports FormsModule/checkbox for toggling.
projects/composition/src/app/pages/paginator-page/paginator-page.component.html Renders updated and new examples (including a toggle-driven single-page collapse).
playwright/cps-ui-kit/components/cps-paginator.spec.ts Introduces Playwright coverage for real browser behavior and accessibility-adjacent states.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  526 passed

Details

stats  526 tests across 20 suites
duration  16 minutes, 42 seconds
commit  227684a
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 Paginator component with Playwright tests

2 participants