mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-870] add tests for right click actions (#625)
This commit is contained in:
committed by
Denys Vuika
parent
1c86b4e4a4
commit
28a4fb7ba7
@@ -26,6 +26,7 @@
|
||||
import { ElementFinder, ElementArrayFinder, promise, by, browser, ExpectedConditions as EC, protractor } from 'protractor';
|
||||
import { BROWSER_WAIT_TIMEOUT } from '../../configs';
|
||||
import { Component } from '../component';
|
||||
import { Menu } from '../menu/menu';
|
||||
import { Utils } from '../../utilities/utils';
|
||||
|
||||
export class DataTable extends Component {
|
||||
@@ -67,6 +68,8 @@ export class DataTable extends Component {
|
||||
emptyListSubtitle: ElementFinder = this.component.element(by.css(DataTable.selectors.emptyListSubtitle));
|
||||
emptyListText: ElementArrayFinder = this.component.all(by.css(DataTable.selectors.emptyListText));
|
||||
|
||||
menu: Menu = new Menu();
|
||||
|
||||
constructor(ancestor?: ElementFinder) {
|
||||
super(DataTable.selectors.root, ancestor);
|
||||
}
|
||||
@@ -208,6 +211,16 @@ export class DataTable extends Component {
|
||||
});
|
||||
}
|
||||
|
||||
async rightClickOnItem(itemName: string) {
|
||||
const item = this.getRowFirstCell(itemName);
|
||||
await browser.actions().click(item, protractor.Button.RIGHT).perform();
|
||||
}
|
||||
|
||||
async rightClickOnMultipleSelection() {
|
||||
const itemFromSelection = this.getSelectedRows().get(0);
|
||||
await browser.actions().click(itemFromSelection, protractor.Button.RIGHT).perform();
|
||||
}
|
||||
|
||||
getItemLocation(name: string) {
|
||||
return this.getRowByName(name).element(this.locationLink);
|
||||
}
|
||||
@@ -273,4 +286,8 @@ export class DataTable extends Component {
|
||||
return this.getRows().all(by.cssContainingText(DataTable.selectors.cell, name))
|
||||
.map(cell => cell.getText());
|
||||
}
|
||||
|
||||
async hasContextMenu() {
|
||||
return (await this.menu.getItemsCount()) > 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user