get Copy action by title to solve problem from ADW run (#2111)

This commit is contained in:
Adina Parpalita
2021-05-07 22:57:30 +03:00
committed by GitHub
parent ca437eecac
commit c9e79f8ff8
3 changed files with 6 additions and 2 deletions

View File

@@ -41,6 +41,10 @@ export abstract class Component {
return root.element(by.id(css));
}
protected byTitleAttr(title: string, root: ElementFinder | ProtractorBrowser = this.component): ElementFinder {
return root.element(by.css(`[title=${title}]`));
}
protected allByCss(css: string, root: ElementFinder | ProtractorBrowser = this.component): ElementArrayFinder {
return root.all(by.css(css));
}

View File

@@ -43,7 +43,7 @@ export class Menu extends Component {
cancelEditingAction = this.byCss(`.mat-menu-item[title='Cancel Editing']`);
cancelJoinAction = this.byCssText('.mat-menu-item', 'Cancel Join');
copyAction = this.byCssText('.mat-menu-item', 'Copy');
copyAction = this.byTitleAttr('Copy');
downloadAction = this.byCssText('.mat-menu-item', 'Download');
editFolderAction = this.byCss(`.mat-menu-item[id$='editFolder']`);
editOfflineAction = this.byCss(`.mat-menu-item[title='Edit Offline']`);

View File

@@ -128,7 +128,7 @@ export class Toolbar extends Component {
async clickMoreActionsCopy(): Promise<void> {
await this.openMoreMenu();
await this.menu.clickMenuItem('Copy');
await this.menu.copyAction.click();
}
async clickMoreActionsEditOffline(): Promise<void> {