[ACS-6066] viewer special permissions playwright (#3453)

* [ACS-5923] sidenav and singleclick test

* [ACS-5923] remove protractor test and fix flaky test

* [ACS-5923] test fix

* [ACS-5639] fix exclude test  in viewer

* [ACS-5923] remove exclude test and fix test

* [ACS-6066] viewer special permissions playwright test

* [ACS-6066] viewer protractor test remove

* [ACS-6066] viewer failed test fix

* [ACS-5923] review changes added

* [ACS-5923] fix error in script
This commit is contained in:
Akash Rathod
2023-10-05 12:19:57 +02:00
committed by GitHub
parent 4059a3d219
commit f2d09e8b1a
30 changed files with 1515 additions and 39 deletions

View File

@@ -24,6 +24,7 @@
import { Page } from '@playwright/test';
import { BaseComponent } from '../base.component';
import { expect } from '@playwright/test';
export class MatMenuComponent extends BaseComponent {
private static rootElement = '.mat-menu-content';
@@ -51,4 +52,18 @@ export class MatMenuComponent extends BaseComponent {
await menuElement.waitFor({ state: 'attached' });
return await menuElement.isVisible();
}
async verifyActualMoreActions(expectedToolbarMore: string[]): Promise<void> {
await this.page.locator('.mat-menu-content').waitFor({ state: 'attached' });
let menus = await this.page.$$('.mat-menu-content .mat-menu-item');
let actualMoreActions: string[] = await Promise.all(
menus.map(async (button) => {
const title = await (await button.$('span')).innerText();
return title || '';
})
);
for (const action of expectedToolbarMore) {
expect(actualMoreActions.includes(action), `Expected to contain ${action} ${actualMoreActions}`).toBe(true);
}
}
}