[ACS-9291] [ACA] [E2E] Automate XAT-5488, XAT-5490 (#4405)

* [XAT-5488] [XAT-5490] Percentage of the zoom when an image is opened in viewer mode

* [XAT-5488] [XAT-5490] Percentage of the zoom when an image is opened in viewer mode_2

* [XAT-5488] [XAT-5490] Percentage of the zoom when an image is opened in viewer mode_3

* Zoom activity on different files in viewer_Committed on 022125_1

* Committed on 022525_1

* Committed on 022725_1

* Committed on 02282025_1
This commit is contained in:
Swarnajit3004
2025-02-28 16:49:53 +05:30
committed by GitHub
parent b3e2af7f0f
commit 03b5ac83cc
3 changed files with 256 additions and 1 deletions

View File

@@ -46,6 +46,11 @@ export class ViewerComponent extends BaseComponent {
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');
public zoomInButton = this.getChild('#viewer-zoom-in-button');
public zoomOutButton = this.getChild('#viewer-zoom-out-button');
public zoomScale = this.getChild('[data-automation-id="adf-page-scale"]');
public zoomResetButton = this.getChild('#viewer-reset-button');
public fitToPageButton = this.getChild('#viewer-scale-page-button');
toolbar = new AcaHeader(this.page);
@@ -92,6 +97,24 @@ export class ViewerComponent extends BaseComponent {
return this.fileTitleButtonLocator.isVisible();
}
async waitForZoomPercentageToDisplay(): Promise<void> {
await this.zoomScale.waitFor({ state: 'visible', timeout: timeouts.normal });
const startTime = Date.now();
let textContent: string;
while (Date.now() - startTime <= timeouts.medium) {
textContent = await this.zoomScale.innerText();
if (textContent.trim() !== '') {
break;
}
await this.page.waitForTimeout(timeouts.tiny);
}
if (textContent.trim() === '') {
throw new Error(`Timeout: Text did not show up within ${timeouts.medium} ms`);
}
}
async getFileTitle(): Promise<string> {
await this.fileTitleButtonLocator.waitFor({ state: 'visible', timeout: timeouts.normal });
await this.waitForViewerLoaderToFinish();

View File

@@ -35,5 +35,5 @@ export const timeouts = {
extendedTest: 150 * 1000,
extendedLongTest: 200 * 1000,
webServer: 240 * 1000,
globalSpec: 60 * 10 * 1000
globalSpec: 90 * 10 * 1000
};