[ACS-5650] viewer action files e2e migration (#3367)

* viewer action files e2e migration

* viewer action files e2e remove comment

* review code fix

* [ci:force]
This commit is contained in:
Akash Rathod
2023-08-03 18:29:10 +02:00
committed by GitHub
parent 26cd95ccbd
commit 4cee6563f5
22 changed files with 402 additions and 76 deletions

View File

@@ -165,6 +165,11 @@ export class DataTableComponent extends BaseComponent {
await this.spinnerWaitForReload();
}
async isItemPresent(name: string): Promise<boolean> {
await this.goThroughPagesLookingForRowWithName(name);
return this.getRowByName(name).isVisible();
}
async getActionLocatorFromExpandableMenu(name: string | number, action: string): Promise<Locator> {
await this.getRowByName(name).click({ button: 'right' });
return this.contextMenuActions.getButtonByText(action);
@@ -199,7 +204,7 @@ export class DataTableComponent extends BaseComponent {
async selectItem(name: string): Promise<void> {
const isSelected = await this.hasCheckMarkIcon(name);
if (!isSelected) {
const row = await this.getRowByName(name);
const row = this.getRowByName(name);
await row.locator('.mat-checkbox[id*="mat-checkbox"]').check();
}
}

View File

@@ -37,4 +37,17 @@ export class MatMenuComponent extends BaseComponent {
public createFolder = this.getChild('[id="app.create.folder"]');
public createLibrary = this.getChild('[id="app.create.library"]');
public getButtonByText = (text: string) => this.getChild('button', { hasText: text });
async clickMenuItem(menuItem: string): Promise<void> {
const menuElement = this.getButtonByText(menuItem);
await menuElement.waitFor({ state: 'attached' });
await menuElement.click();
await menuElement.waitFor({ state: 'detached' });
}
async isMenuItemVisible(menuItem: string): Promise<boolean> {
const menuElement = this.getButtonByText(menuItem);
await menuElement.waitFor({ state: 'attached' });
return await menuElement.isVisible();
}
}