Add rightclick method to browseractions (#4942)

* added right click method to browseractions

* added rightclickrowbyindex method to DataTableComponentPage

* updated row locator

* removed the rightclick from here
This commit is contained in:
Geeta Mandakini Ayyalasomayajula 2019-07-18 10:54:15 +01:00 committed by Eugenio Romano
parent 715d3b13cc
commit 8ee5cd1908
2 changed files with 10 additions and 0 deletions

View File

@ -258,6 +258,11 @@ export class DataTableComponentPage {
return row;
}
getRowByIndex(index: number) {
const row = this.rootElement.element(by.xpath(`//div[contains(@class,'adf-datatable-body')]//div[contains(@class,'adf-datatable-row')][${index}]`));
return row;
}
contentInPosition(position) {
BrowserVisibility.waitUntilElementIsVisible(this.contents);
return this.contents.get(position - 1).getText();

View File

@ -60,6 +60,11 @@ export class BrowserActions {
return this;
}
static async rightClick(elementFinder: ElementFinder) {
BrowserVisibility.waitUntilElementIsVisible(elementFinder);
return browser.actions().click(elementFinder, protractor.Button.RIGHT).perform();
}
static async closeMenuAndDialogs() {
return browser.actions().sendKeys(protractor.Key.ESCAPE).perform();
}