Skip to content

[REPLACED] fix: Misc ohif-downstream integration test failures#5907

Open
wayfarer3130 wants to merge 23 commits into
masterfrom
fix/cs3d-combined-integration
Open

[REPLACED] fix: Misc ohif-downstream integration test failures#5907
wayfarer3130 wants to merge 23 commits into
masterfrom
fix/cs3d-combined-integration

Conversation

@wayfarer3130
Copy link
Copy Markdown
Contributor

@wayfarer3130 wayfarer3130 commented Mar 19, 2026

Being replaced by individual changes for some of this.

Miscellaneous ohif-downstream integration test failures

No functional changes

Context

Changes & Results

Update to grid comparison for 3D tests

What are the effects of this change?

  • Before vs After
  • Screenshots / GIFs / Videos
    -->

Testing

Checklist

PR

  • [] My Pull Request title is descriptive, accurate and follows the
    semantic-release format and guidelines.

Code

  • [] My code has been well-documented (function documentation, inline comments,
    etc.)

Public Documentation Updates

  • [] The documentation page has been updated as necessary for any public API
    additions or removals.

Tested Environment

  • [] OS:
  • [] Node version:
  • [] Browser:

Greptile Summary

This PR fixes flaky downstream integration test failures in the 3D viewport tests by scoping the screenshot comparison from the full page to only the viewport-grid element (via viewportPageObject.grid). Updated baseline screenshots are included to match the new comparison area.

  • tests/3DFourUp.spec.ts & tests/3DMain.spec.ts: viewportPageObject fixture added to the test destructuring; the second argument to checkForScreenshot changed from page (full-page screenshot) to viewportPageObject.grid (data-testid="viewport-grid" locator). Test names updated with a "grid compare" suffix to reflect the change.
  • Baseline PNGs updated: Both threeDFourUpDisplayedCorrectly.png and threeDMainDisplayedCorrectly.png regenerated to match the narrowed comparison region.
  • The PR description states "No functional changes", but this change does meaningfully narrow the screenshot comparison area — it now ignores toolbar/sidebar chrome that may render differently across environments, which is intentional and desirable.
  • The ViewportPageObject.grid getter correctly returns this.page.getByTestId('viewport-grid'), which is a valid Locator | Page input for checkForScreenshot, so there are no type or runtime concerns.

Confidence Score: 5/5

  • This PR is safe to merge — all changes are confined to test files and baseline screenshots with no production code impact.
  • The change is minimal: two test specs and two PNG baselines. The fix correctly scopes screenshot comparison to the viewport grid locator (viewportPageObject.grid) which is already defined and properly typed in ViewportPageObject.ts. The checkForScreenshot utility accepts Locator | Page so the call is type-correct. No application logic is touched.
  • No files require special attention.

Important Files Changed

Filename Overview
tests/3DFourUp.spec.ts Adds viewportPageObject fixture and changes screenshot comparison from full-page (page) to the viewport grid locator; test name updated to reflect "grid compare" intent.
tests/3DMain.spec.ts Same pattern as 3DFourUp.spec.ts — viewport grid locator replaces page for the screenshot target and test name updated; no logic issues found.
tests/screenshots/chromium/3DFourUp.spec.ts/threeDFourUpDisplayedCorrectly.png Baseline screenshot updated to match the new, narrower viewport-grid scope rather than the full page.
tests/screenshots/chromium/3DMain.spec.ts/threeDMainDisplayedCorrectly.png Baseline screenshot updated to match the new viewport-grid scope; binary diff expected and correct.

Sequence Diagram

sequenceDiagram
    participant Test as 3D Spec Test
    participant Fixture as Playwright Fixture
    participant VP as ViewportPageObject
    participant Check as checkForScreenshot
    participant Expect as expect(locator)

    Test->>Fixture: destructure { page, mainToolbarPageObject, viewportPageObject }
    Fixture-->>Test: viewportPageObject = new ViewportPageObject(page)

    Test->>VP: viewportPageObject.grid
    VP-->>Test: page.getByTestId("viewport-grid") [Locator]

    Note over Test: Before fix: checkForScreenshot(page, page, path)<br/>After fix: checkForScreenshot(page, viewportPageObject.grid, path)

    Test->>Check: checkForScreenshot(page, gridLocator, screenshotPath)
    Check->>Expect: expect(gridLocator).toHaveScreenshot(path, options)
    Expect-->>Check: pass / fail (scoped to viewport-grid only)
    Check-->>Test: true or throws
Loading

Last reviewed commit: "fix: Misc ohif-downs..."

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 19, 2026

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit ed33fb3
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/69cd2c053387590008fbc497
😎 Deploy Preview https://deploy-preview-5907--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@wayfarer3130 wayfarer3130 added the ohif-integration Causes a CS3D/OHIF integraiton build to be run label Mar 19, 2026
@cypress
Copy link
Copy Markdown

cypress Bot commented Mar 19, 2026

Viewers    Run #6138

Run Properties:  status check passed Passed #6138  •  git commit ed33fb3592: Update bun
Project Viewers
Branch Review fix/cs3d-combined-integration
Run status status check passed Passed #6138
Run duration 02m 17s
Commit git commit ed33fb3592: Update bun
Committer Bill Wallace
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 37
View all changes introduced in this branch ↗︎

Comment thread tests/utils/visitStudy.ts
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test waits for the images to render after loading - so it can be really fast if stuff is in cache, but can wait quite a while on slow systems, rather than using a fixed delay and just hoping it works.

Comment thread tests/utils/viewportScreenshotStabilization.ts Dismissed
Comment thread tests/utils/viewportScreenshotStabilization.ts Dismissed
@wayfarer3130 wayfarer3130 changed the title fix: Misc ohif-downstream integraiton test failures fix: Misc ohif-downstream integration test failures Mar 31, 2026
@wayfarer3130 wayfarer3130 changed the title fix: Misc ohif-downstream integration test failures [REPLACED] fix: Misc ohif-downstream integration test failures Apr 9, 2026
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@GhadeerAlbattarni - this file has changes to prevent updating viewports that haven't been otherwise changed - it allows rendering the gray part of the image area on the 3d four up spec test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@GhadeerAlbattarni - I think you need this file too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@GhadeerAlbattarni - this is some testing for the changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

And this fixes the hyrdation so that it loads the viewports clicking "load", otherwise those don't get applied.

@GhadeerAlbattarni

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@GhadeerAlbattarni - I think you need this bit to notify the viewports they need to render.

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

Labels

ohif-integration Causes a CS3D/OHIF integraiton build to be run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants