[ADF-4829] - Add e2e tests for custom action menu in TaskList and ProcessList (#5081)

* in progress custom action menu on tasklist

* C315723 - automated

* split into 2 methods, addAction, addDisabledAction
This commit is contained in:
Geeta Mandakini Ayyalasomayajula
2019-09-19 13:32:45 +01:00
committed by Maurizio Vitale
parent c2af8a23f0
commit 1527397b7b
5 changed files with 182 additions and 3 deletions

View File

@@ -102,15 +102,23 @@ export class ProcessListCloudComponentPage {
return this.dataTable.getAllRowsColumnValues(column);
}
async clickOnCustomActionMenu(content: string, action: string): Promise<void> {
async clickOptionsButton(content: string) {
await BrowserActions.closeMenuAndDialogs();
const row: ElementFinder = this.dataTable.getRow('Id', content);
await BrowserActions.click(row.element(this.optionButton));
await BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
}
async clickOnCustomActionMenu(action: string): Promise<void> {
const actionButton = element(by.css(`button[data-automation-id*="${action}"]`));
await BrowserActions.click(actionButton);
}
async isCustomActionEnabled(action: string): Promise<boolean> {
const actionButton = element(by.css(`button[data-automation-id*="${action}"]`));
return actionButton.isEnabled();
}
async rightClickOnRow(processInstance: string): Promise<void> {
await this.dataTable.rightClickOnRow('Id', processInstance);
}

View File

@@ -17,7 +17,7 @@
import { BrowserVisibility } from '../../core/utils/browser-visibility';
import { DataTableComponentPage } from '../../core/pages/data-table-component.page';
import { element, by, ElementFinder } from 'protractor';
import { element, by, ElementFinder, Locator } from 'protractor';
import { BrowserActions } from '../../core/utils/browser-actions';
const column = {
@@ -36,6 +36,8 @@ export class TaskListCloudComponentPage {
taskList = element(by.css('adf-cloud-task-list'));
noTasksFound = element.all(by.css("div[class='adf-empty-content__title']")).first();
actionMenu: ElementFinder = element(by.css('div[role="menu"]'));
optionButton: Locator = by.css('button[data-automation-id*="action_menu_"]');
dataTable = new DataTableComponentPage(this.taskList);
@@ -156,4 +158,29 @@ export class TaskListCloudComponentPage {
return BrowserActions.getText(locator);
}
async clickOptionsButton(content: string) {
await BrowserActions.closeMenuAndDialogs();
const row: ElementFinder = this.dataTable.getRow('Id', content);
await BrowserActions.click(row.element(this.optionButton));
await BrowserVisibility.waitUntilElementIsVisible(this.actionMenu);
}
async clickOnCustomActionMenu(action: string): Promise<void> {
const actionButton = element(by.css(`button[data-automation-id*="${action}"]`));
await BrowserActions.click(actionButton);
}
async isCustomActionEnabled(action: string): Promise<boolean> {
const actionButton = element(by.css(`button[data-automation-id*="${action}"]`));
return actionButton.isEnabled();
}
async rightClickOnRow(taskId: string): Promise<void> {
await this.dataTable.rightClickOnRow('Id', taskId);
}
async clickContextMenuActionNamed(actionName): Promise<void> {
await BrowserActions.clickExecuteScript(`button[data-automation-id="context-${actionName}"]`);
}
}