Skip to content

test: add Playwright coverage and test ids for CpsCheckboxComponent - #777

Open
fateeand wants to merge 2 commits into
masterfrom
771-cover-checkbox-component-with-playwright-tests
Open

test: add Playwright coverage and test ids for CpsCheckboxComponent#777
fateeand wants to merge 2 commits into
masterfrom
771-cover-checkbox-component-with-playwright-tests

Conversation

@fateeand

@fateeand fateeand commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added Playwright E2E coverage for CpsCheckboxComponent, covering behavior that requires a real browser and isn't exercised by the existing Jest unit suite: real click-through via the visible label text (native <label>-to-<input> association), real disabled-state semantics, real accessible-name computation, and a real two-way-binding readout round trip.
  • Added data-testid attributes to cps-checkbox's internal template (label, input, label text, icon, info circle) so consumer apps have stable selectors for their own tests.
  • Added a "Checkbox with custom icon color" example to showcase the previously-undemonstrated iconColor input.

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


Release notes:

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

Copilot AI review requested due to automatic review settings July 27, 2026 15:54
@fateeand fateeand linked an issue Jul 27, 2026 that may be closed by this pull request
@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Coverage report for library

St.
Category Percentage Covered / Total
🟡 Statements 77.03% 6031/7829
🟡 Branches 66.73% 2782/4169
🟡 Functions 77.77% 1123/1444
🟡 Lines 78.09% 5634/7215

Test suite run success

2386 tests passing in 76 suites.

Report generated by 🧪jest coverage report action from 9255cdd

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 stable data-testid hooks and Playwright E2E coverage for CpsCheckboxComponent to validate browser-native behaviors (label click-through, keyboard interaction, disabled semantics, accessible name) using the composition /checkbox page as the test surface.

Changes:

  • Added data-testid attributes to key internal elements of cps-checkbox (label wrapper, input, icon, label text, info circle).
  • Extended the checkbox composition page/examples, including a new “custom icon color” example and added page-level test ids for E2E targeting.
  • Introduced a new Playwright spec covering disabled state, label click-through, keyboard interaction, accessible name, and two-way binding readout.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
projects/cps-ui-kit/src/lib/components/cps-checkbox/cps-checkbox.component.html Adds internal data-testid hooks to enable stable selectors for E2E and consumer tests.
projects/composition/src/app/pages/checkbox-page/checkbox-page.examples.ts Updates example code strings to include the new custom icon color example.
projects/composition/src/app/pages/checkbox-page/checkbox-page.component.html Adds page-level data-testid hooks and renders the new custom icon color example.
playwright/cps-ui-kit/components/cps-checkbox.spec.ts Adds Playwright coverage for real browser interactions and semantics.

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

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Playwright test results

passed  248 passed

Details

stats  248 tests across 6 suites
duration  9 minutes, 42 seconds
commit  9255cdd
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 Checkbox component with Playwright tests

2 participants