Feat/contour and label color change coverage#6042
Open
diattamo wants to merge 7 commits into
Open
Conversation
add stable test ids for the color picker dialog, save/cancel actions, and segment color swatch extend page objects with color picker controls and segment change color helpers add ContourSegmentColorChange e2e tests
❌ Deploy Preview for ohif-dev failed. Why did it fail? →
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Context
Add coverage for changing the color of contours and labelmaps
Changes & Results
tests/utils/screenShotPaths.ts— registered newlabelMapSegmentationColorChangebaseline keys.tests/ContourSegmentColorChange.spec.ts— four tests covering:opening the dialog with the current hex prefilled, saving a new
color, cancelling the dialog, and verifying a duplicated contour
segment is created with a different stroke color. Verification uses
getSvgAttribute(... 'stroke')for the canvas-side check.tests/LabelMapSegmentationColorChange.spec.ts— three testscovering: opening the dialog with the current hex prefilled, saving
a new color, and cancelling the dialog. Verification uses
checkForScreenshotscoped to the default viewport for thecanvas-side check; four baseline screenshots are added under
tests/screenshots/chromium/LabelMapSegmentationColorChange.spec.ts/.Testing
From the repo root, run both new specs:
To regenerate the labelmap baselines after an intentional rendering
change:
yarn playwright test tests/LabelMapSegmentationColorChange.spec.ts --update-snapshotsChecklist
PR
semantic-release format and guidelines.
Code
Public Documentation Updates
Tested Environment
Greptile Summary
This PR adds Playwright test coverage for changing the color of contour and labelmap segmentations, along with the
data-cyinstrumentation needed to make those tests work. Production changes are minimal — addingdata-cyattributes to the color picker dialog, its action buttons, and theDataRowcolor swatch.colorPickerDialog.tsxandDataRow.tsxgaindata-cyhooks;FooterActionalready forwardsdataCYviaButton, so the wiring is correct.ContourSegmentColorChange.spec.tscovers open/save/cancel/duplicate flows using SVG stroke-attribute assertions;LabelMapSegmentationColorChange.spec.tscovers open/save/cancel using screenshot comparison, with four baseline images committed.DOMOverlayPageObjectgains acolorPickersub-object andRightPanelPageObjectgainschangeColor/cancelChangeColoractions andsegmentsVisibilityTogglefor the labelmap panel.Confidence Score: 5/5
Safe to merge — production changes are limited to additive
data-cyattributes with no behavioral impact; new tests are well-structured and hydration is handled correctly.The only production code changed is the addition of test-id attributes, which cannot affect runtime behavior. Test logic is sound: hydration is confirmed and clicked in both
beforeEachblocks, the duplicate-segment count guard is present, and screenshot baselines are committed.No files require special attention.
Important Files Changed
data-cyattributes to the dialog wrapper and both action buttons so Playwright can locate them reliably.data-cy="data-row-colorhex"to the color swatch span so tests can assert its CSS background-color.colorPickergetter to dialog object; hexInput is dialog-scoped but save/cancel buttons are page-scoped — inconsistent locator strategy.openChangeColor,changeColor, andcancelChangeColoractions to the segment actions menu; exposesrowDataColorHexandsegmentsVisibilityToggleon labelmap panel.labelMapSegmentationColorChange.Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "Fix gereptile comments" | Re-trigger Greptile