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

* Add click on context menu action

* Export context-menu class through public-api.ts

* Add isContextMenuDisplayed method

* Add select row method for process list

* Typo in context-menu class

* Move Context Menu class in core folder

* Add async and await to select process row method

* Remove return from select process row method

* Rename selectRow method for Process and Task list
This commit is contained in:
Iulia Burcă 2020-06-02 11:39:20 +03:00 committed by GitHub
parent 3649e9239f
commit 2372710f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 2 deletions

View File

@ -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}"]`)));
}
}

View File

@ -32,3 +32,4 @@ export * from './config-editor-page';
export * from './about.page'; export * from './about.page';
export * from './snackbar.page'; export * from './snackbar.page';
export * from './data-table/public-api'; export * from './data-table/public-api';
export * from './context-menu.page';

View File

@ -45,4 +45,8 @@ export class ProcessListPage {
checkContentIsNotDisplayedByColumn(column: string, processName: string): Promise<void> { checkContentIsNotDisplayedByColumn(column: string, processName: string): Promise<void> {
return this.dataTable.checkContentIsNotDisplayed(column, processName); return this.dataTable.checkContentIsNotDisplayed(column, processName);
} }
async selectRowByName(processName: string): Promise<void> {
await this.dataTable.selectRow('Name', processName);
}
} }

View File

@ -63,8 +63,8 @@ export class TaskListPage {
return this.dataTable.checkRowIsSelected('Name', taskName); return this.dataTable.checkRowIsSelected('Name', taskName);
} }
selectRow(taskName): Promise<void> { async selectRowByName(taskName: string): Promise<void> {
return this.dataTable.selectRow('Name', taskName); await this.dataTable.selectRow('Name', taskName);
} }
getAllRowsNameColumn(): Promise<any> { getAllRowsNameColumn(): Promise<any> {