mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-08-07 17:48:27 +00:00
[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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user