Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACA-3332] Add Context menu click action for process and task list and selectRow for process list #5730

Merged
merged 9 commits into from Jun 2, 2020
37 changes: 37 additions & 0 deletions lib/testing/src/lib/core/pages/context-menu.page.ts
@@ -0,0 +1,37 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { BrowserActions } from '../utils/browser-actions';
import { element, by, ElementFinder } from 'protractor';
import { BrowserVisibility } from '../public-api';

export class ContextMenuPage {
contextMenu: ElementFinder = element(by.id('adf-context-menu-content'));

async isContextMenuDisplayed(): Promise<boolean> {
try {
await BrowserVisibility.waitUntilElementIsVisible(this.contextMenu);
return true;
} catch (error) {
return false;
}
}

async clickContextMenuActionNamed(actionName: string): Promise<void> {
await BrowserActions.click(element(by.css(`button[data-automation-id="context-${actionName}"]`)));
}
}
1 change: 1 addition & 0 deletions lib/testing/src/lib/core/pages/public-api.ts
Expand Up @@ -32,3 +32,4 @@ export * from './config-editor-page';
export * from './about.page';
export * from './snackbar.page';
export * from './data-table/public-api';
export * from './context-menu.page';
Expand Up @@ -45,4 +45,8 @@ export class ProcessListPage {
checkContentIsNotDisplayedByColumn(column: string, processName: string): Promise<void> {
return this.dataTable.checkContentIsNotDisplayed(column, processName);
}

async selectRowByName(processName: string): Promise<void> {
await this.dataTable.selectRow('Name', processName);
iuliaib marked this conversation as resolved.
Show resolved Hide resolved
}
}
Expand Up @@ -63,8 +63,8 @@ export class TaskListPage {
return this.dataTable.checkRowIsSelected('Name', taskName);
}

selectRow(taskName): Promise<void> {
return this.dataTable.selectRow('Name', taskName);
async selectRowByName(taskName: string): Promise<void> {
await this.dataTable.selectRow('Name', taskName);
}

getAllRowsNameColumn(): Promise<any> {
Expand Down