mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-08-07 17:48:27 +00:00
[ACS-5519] viewer-general tests Playwright (#3327)
* [ACS-5519] view general tests Playwright * [ACS-5519] remove same function call
This commit is contained in:
@@ -155,6 +155,17 @@ export class DataTableComponent extends BaseComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used when we want to perform double click on the dataTable row to open a file or folder
|
||||
*
|
||||
* @param name of the data table element with which we want to double click
|
||||
*/
|
||||
async performClickFolderOrFileToOpen(name: string): Promise<void> {
|
||||
await this.goThroughPagesLookingForRowWithName(name);
|
||||
await this.getCellLinkByName(name).click();
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
|
||||
async getActionLocatorFromExpandableMenu(name: string | number, action: string): Promise<Locator> {
|
||||
await this.getRowByName(name).click({ button: 'right' });
|
||||
return this.contextMenuActions.getButtonByText(action);
|
||||
@@ -180,4 +191,17 @@ export class DataTableComponent extends BaseComponent {
|
||||
await this.spinnerWaitForReload();
|
||||
}
|
||||
}
|
||||
|
||||
async selectItem(name: string): Promise<void> {
|
||||
const isSelected = await this.hasCheckMarkIcon(name);
|
||||
if (!isSelected) {
|
||||
const row = await this.getRowByName(name);
|
||||
await row.locator('.mat-checkbox[id*="mat-checkbox"]').check();
|
||||
}
|
||||
}
|
||||
|
||||
async hasCheckMarkIcon(itemName: string): Promise<boolean> {
|
||||
const row = this.getRowByName(itemName);
|
||||
return await row.locator('.mat-checkbox[class*="checked"]').isVisible();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user