mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
[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:
parent
3649e9239f
commit
2372710f3d
37
lib/testing/src/lib/core/pages/context-menu.page.ts
Normal file
37
lib/testing/src/lib/core/pages/context-menu.page.ts
Normal 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}"]`)));
|
||||||
|
}
|
||||||
|
}
|
@ -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';
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user