test: add Playwright coverage and test ids for CpsCheckboxComponent - #777
Open
fateeand wants to merge 2 commits into
Open
test: add Playwright coverage and test ids for CpsCheckboxComponent#777fateeand wants to merge 2 commits into
fateeand wants to merge 2 commits into
Conversation
fateeand
requested review from
TerranceKhumalo-absa,
korel-san and
lukasmatta
as code owners
July 27, 2026 15:54
Contributor
Coverage report for library
Test suite run success2386 tests passing in 76 suites. Report generated by 🧪jest coverage report action from 9255cdd |
Contributor
There was a problem hiding this comment.
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-testidattributes to key internal elements ofcps-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. |
Contributor
Playwright test resultsDetails
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.data-testidattributes tocps-checkbox's internal template (label, input, label text, icon, info circle) so consumer apps have stable selectors for their own tests.iconColorinput.TODO: Merge with
feat: add test ids to checkbox componentto generate a releaseRelease notes: