Skip to content

Commit

Permalink
Add rightclick method to browseractions (Alfresco#4942)
Browse files Browse the repository at this point in the history
* added right click method to browseractions

* added rightclickrowbyindex method to DataTableComponentPage

* updated row locator

* removed the rightclick from here
  • Loading branch information
gmandakini authored and eromano committed Jul 18, 2019
1 parent 715d3b1 commit 8ee5cd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/testing/src/lib/core/pages/data-table-component.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions lib/testing/src/lib/core/utils/browser-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 8ee5cd1

Please sign in to comment.