Skip to content

Conversation

@ViniciusResende
Copy link
Collaborator

Context

This PR finalizes the effort that was introduced at #5557, of the introduction of POMs to our tests, in a way that we'll benefit in terms of readability and reusability, allowing our test structure to grow without prejudicing maintainability.

This concludes the first step of the architecture enhancement of Playwright tests.

Changes & Results

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: Windows 11 25H2 + WSL Ubuntu 22.04.4 LTS
  • Node version: 20.9.0
  • Browser: Microsoft Edge 141.0.3537.71

@netlify
Copy link

netlify bot commented Dec 3, 2025

Deploy Preview for ohif-dev canceled.

Name Link
🔨 Latest commit c29e957
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/69308f991ab0040009d97bcd

@ViniciusResende ViniciusResende marked this pull request as ready for review December 3, 2025 19:47
@sedghi
Copy link
Member

sedghi commented Dec 3, 2025

@jbocce what is the status of this

@jbocce
Copy link
Collaborator

jbocce commented Dec 3, 2025

@jbocce what is the status of this

@sedghi it just got created. I will likely look at it next week.

Copy link
Collaborator

@jbocce jbocce left a comment

Choose a reason for hiding this comment

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

Great changes. A few comments to consider. Thanks.

<FooterAction.Right>
<FooterAction.Secondary onClick={hide}>Cancel</FooterAction.Secondary>
<FooterAction.Secondary
dataCY="cancel-button"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider making this more specific, like 'untracked-series-modal-cancel-button'

Cancel
</FooterAction.Secondary>
<FooterAction.Primary
dataCY="confirm-button"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one too.

isSelected || !isVisible ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'
}`}
aria-label={isVisible ? 'Hide' : 'Show'}
dataCY="visibilityToggle"
Copy link
Collaborator

Choose a reason for hiding this comment

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

More specific.

<div className="text-[11px] font-semibold text-white">{modality}</div>
<div
className="text-[11px] font-semibold text-white"
data-cy="series-modality-label"
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is for a particular series consider adding something to distinguish it from the other series thumbnail, like series instance uid or something. If the locator though is straightforward, then maybe this is not so big a deal, but something to consider. This comment applies to the other data-cy values in this file too.

};
}

get viewport() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am a little surprised to see viewport here. Do we need this level of indirection? And why are things like the overlay menu not here? It is a bit confusing. And why not the context menu that is above too? I think I would expect to see everything that appears in a viewport in the viewport PageObject regardless of where it is in the DOM. Something to consider anyway.

};
},
get contourMenuButton() {
const button = page.getByTestId('panelSegmentationWithToolsContour-btn');
Copy link
Collaborator

Choose a reason for hiding this comment

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

This button and the labelMapMenuButton below are NOT part of the segmentation panel, but instead are the tabs/buttons to change what is displayed in the right panel. So please move these accessors directly into the RightPanelPageObject. Or maybe just rename them panelTabButton to make it clear these are the buttons to switch to that panel.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should have two segmentation panel page objects: one for contour and one for label map. They have different tools and are actually two separate panels.

this.page = page;
}

get button() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is weird to have button always get the first dataOverlayMenu. Is it being used? If so rename to make it clear that it is a specific (i.e. the first) instance. If not please remove.

await this.page.getByTestId(`${to}-SEG`).click();
}

async remove() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This currently only ever removes the segmentation named (literally) SEGMENTATION. The name of the segmentation overlay should be passed in and templated into the selectors/locators.

expectedCount: number;
}) {
await expect(page.locator('css=div[data-cy^="ModalityLoadBadge-"]')).toHaveCount(expectedCount);
const overlayPageObject = new OverlayPageObject(page);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this page object be one of those that get created in fixture.ts?


await expect(page.getByTestId('data-row')).toContainText('Segment One');
await expect(page.getByTestId('data-row')).not.toContainText('Segment 1');
await expect(segment1.locator).toContainText('Segment One');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like how this was all simplified. Good work!

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.

3 participants