[ACS-8845] viewer file types fixes pr (#4159)

* [ACS-8845] [E2E] Added e2e tests for verifying file types in viewer

* [ACS-8845] [E2E] Viewer tests fixes

* [ACS-8845] eslint fix
This commit is contained in:
Adam Świderski
2024-10-02 14:00:23 +02:00
committed by GitHub
parent 8099ca9de4
commit b72009f9e1
2 changed files with 27 additions and 13 deletions

View File

@@ -45,6 +45,7 @@ export class ViewerComponent extends BaseComponent {
public thumbnailsCloseButton = this.getChild('[data-automation-id="adf-thumbnails-close"]');
public viewerPage = this.getChild('[data-automation-id="adf-page-selector"]');
public viewerMedia = this.getChild('adf-media-player');
public viewerSpinner = this.getChild('.adf-viewer-render__loading-screen');
toolbar = new AcaHeader(this.page);
@@ -69,6 +70,18 @@ export class ViewerComponent extends BaseComponent {
return this.viewerLocator.isVisible();
}
async waitForViewerLoaderToFinish(): Promise<void> {
await this.viewerSpinner.waitFor({ state: 'hidden', timeout: timeouts.extraLarge });
}
async checkViewerActivePage(pageNumber: number): Promise<void> {
await expect(this.viewerPage).toHaveValue(pageNumber.toString());
}
async clickViewerThumbnailPage(pageNumber: number): Promise<void> {
await this.thumbnailsPages.nth(pageNumber - 1).click();
}
async isCloseButtonDisplayed(): Promise<boolean> {
await this.closeButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
return this.closeButtonLocator.isEnabled({ timeout: timeouts.normal });