test(e2e): replace waitForVolumeLoad with viewport render waits#6000
Merged
jbocce merged 3 commits intoMay 7, 2026
Conversation
✅ Deploy Preview for ohif-dev canceled.
|
jbocce
reviewed
May 7, 2026
| const dataOverlayPageObject = (await viewportPageObject.getById('default')).overlayMenu | ||
| .dataOverlay; | ||
| await dataOverlayPageObject.toggle(); | ||
| const viewportRenderCycle1 = waitForViewportRenderCycle(page); |
Collaborator
There was a problem hiding this comment.
You could use a let here instead of const and then just have a single variable used over and over again... up to you. No big deal either way.
jbocce
approved these changes
May 7, 2026
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
waitForVolumeLoadhelper from all E2E tests and replaces it with precise, signal-based viewport render waitsassertNumberOfModalityLoadBadgeswas called withoutawaitChanges & Results
Testing
Checklist
PR
semantic-release format and guidelines.
Code
etc.)
Public Documentation Updates
additions or removals.
Tested Environment
Greptile Summary
This PR replaces the blunt
waitForVolumeLoadhelper (a fixed 2 s sleep + networkidle) with precise, signal-based viewport render waits (waitForViewportsRenderedandwaitForViewportRenderCycle) across 11 E2E test files, and fixes a pre-existing bug whereassertNumberOfModalityLoadBadgeswas called withoutawait.Invert,MPRThenRTOverlayNoHydration,RTDataOverlayNoHydrationThenMPR, andMultipleSegmentationDataOverlaysall adopt the new pattern cleanly and fix the missing-awaitbug.mpr2.spec.tsremoves the only render wait before its first screenshot;ArrowAnnotate.spec.tsleaves screenshots 2 and 3 unguarded after annotation edits; and the first two tests inDicomTagBrowser.spec.tsdropwaitForVolumeLoadwith no replacement before their pixel screenshots.MainToolbarPageObject.tscorrectly removes the implicitwaitForVolumeLoadfrom layout-selection helpers, delegating wait responsibility to each call site.Confidence Score: 5/5
Safe to merge; all changes are in E2E test files only with no production code affected.
The change is entirely in test infrastructure. The new render-wait utilities are well-designed and the majority of migrations are correct. The three files with missing render waits introduce potential screenshot flakiness but do not break functionality.
tests/mpr2.spec.ts, tests/ArrowAnnotate.spec.ts, and the first two tests in tests/DicomTagBrowser.spec.ts are missing render waits before pixel screenshots that were previously guarded.
Important Files Changed
Comments Outside Diff (3)
tests/mpr2.spec.ts, line 19-23 (link)The original test called
waitForVolumeLoad()(networkidle + 2 s settle) before this screenshot. That guard is now gone;visitStudywith 10 000 ms provides only a navigation/page-ready wait, not a viewport-render guarantee. If the MPR volumes haven't finished rendering when this screenshot is taken the baseline comparison will be against a partially-loaded frame.Prompt To Fix With AI
tests/ArrowAnnotate.spec.ts, line 50-58 (link)The
fillAndSavecall (editing annotation text via double-click) and therenamecall both mutate annotation state, which can trigger a canvas re-render. The original code hadwaitForVolumeLoad()after each of these before taking a screenshot. Those guards were removed without a replacementwaitForViewportRenderCycleorwaitForViewportsRendered, so the screenshot may be captured before the annotation overlay has fully re-painted — potentially causing flaky pixel-diff failures.Prompt To Fix With AI
tests/DicomTagBrowser.spec.ts, line 28-38 (link)waitForVolumeLoadremoved before screenshot in first two tests with no replacementTests
'should display the dicom tag browser'and'should render the scroll bar...'previously calledwaitForVolumeLoad()(networkidle) betweenvisitStudyandtagBrowser.click(). Both tests immediately take a full-page screenshot that includes the viewport area; if the initial series hasn't rendered yet the baseline will capture a loading/blank viewport. Tests 4 and 5 in the same file correctly addwaitForViewportsRenderedafter their layout change — applying the same pattern here would make all tests consistent.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "test: use let for viewportRenderCycle" | Re-trigger Greptile