tests(Playwright): Full implementation of Page Object Models (POMs) to Playwright tests (#5608)
This commit is contained in:
1 parent
7b12dcf048
commit
d917e74e68
58 files changed
+1167
-496
No files matched your search
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user