tests(Playwright): Full implementation of Page Object Models (POMs) to Playwright tests (#5608)

This commit is contained in:
Vinícius Alves de Faria Resende authored and GitHub committed 2025-12-12 11:46:45 -05:00
1 parent 7b12dcf048
commit d917e74e68
58 files changed
+1167 -496

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
import { Page } from '@playwright/test';
export class LeftPanelPageObject {
readonly page: Page;
constructor(page: Page) {
this.page = page;
}
async toggle() {
await this.page.getByTestId('side-panel-header-left').click();
}
get thumbnails() {
return this.page.locator('[data-cy^="study-browser-thumbnail"]');
}
async loadSeriesByModality(modality: string, nth: number = 0) {
const matchingThumbnail = this.thumbnails
.filter({
has: this.page.locator('[data-cy="series-modality-label"]', { hasText: modality }),
})
.nth(nth);
await matchingThumbnail.dblclick();
}
async loadSeriesByDescription(description: string, nth: number = 0) {
const matchingThumbnail = this.thumbnails
.filter({
has: this.page.locator('[data-cy="series-description-label"]', { hasText: description }),
})
.nth(nth);
await matchingThumbnail.dblclick();
}
}