[ACS-5761] Demo Shell Cleanup (part 2) (#8807)

cleanup demo shell
This commit is contained in:
Denys Vuika
2023-08-10 22:18:21 +01:00
committed by GitHub
parent ca60b392d4
commit f201efd56a
203 changed files with 1005 additions and 10703 deletions

View File

@@ -1,45 +0,0 @@
/*!
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { TogglePage } from '@alfresco/adf-testing';
import { $ } from 'protractor';
export class AppSettingsTogglesPage {
togglePage = new TogglePage();
showDetailsHeaderToggle = $('#adf-show-header');
showTaskFilterIconsToggle = $('#adf-show-task-filter-icon');
showProcessFilterIconsToggle = $('#adf-show-process-filter-icon');
async enableShowHeader(): Promise<void> {
await this.togglePage.enableToggle(this.showDetailsHeaderToggle);
}
async disableShowHeader(): Promise<void> {
await this.togglePage.disableToggle(this.showDetailsHeaderToggle);
}
async enableTaskFiltersIcon(): Promise<void> {
await this.togglePage.enableToggle(this.showTaskFilterIconsToggle);
}
async enableProcessFiltersIcon(): Promise<void> {
await this.togglePage.enableToggle(this.showProcessFilterIconsToggle);
}
}

View File

@@ -26,7 +26,7 @@ export class ProcessDetailsPage {
propertiesList = TestElement.byCss('.adf-property-list');
showDiagramButton = TestElement.byId('show-diagram-button');
diagramCanvas = TestElement.byCss('svg[xmlns="http://www.w3.org/2000/svg"]');
backButton = TestElement.byCss('app-show-diagram button.mat-mini-fab.mat-accent');
backButton = TestElement.byCss('#btn-diagram-back');
commentInput = TestElement.byId('comment-input');
auditLogButton = TestElement.byCss('button[adf-process-audit]');
cancelProcessButton = TestElement.byCss('div[data-automation-id="header-status"] > button');

View File

@@ -19,16 +19,13 @@ import { BrowserActions, BrowserVisibility, DataTableComponentPage, StartProcess
import { $, $$ } from 'protractor';
export class ProcessFiltersPage {
dataTable = new DataTableComponentPage();
createProcessButton = $('.app-processes-menu button[data-automation-id="create-button"] > span');
newProcessButton = $('div > button[data-automation-id="btn-start-process"]');
processesPage = $('#app-processes-menu');
accordionMenu = $('.app-processes-menu mat-accordion');
buttonWindow = $('div > button[data-automation-id="btn-start-process"] > div');
noContentMessage = $$('.adf-empty-content__title').first();
rows = $$('adf-process-instance-list .adf-datatable-body adf-datatable-row[class*="adf-datatable-row"]');
processIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
startProcessEl = $('adf-start-process .adf-start-process');
getButtonFilterLocatorByName = (name: string) => $(`button[data-automation-id='${name}_filter']`);
@@ -57,7 +54,6 @@ export class ProcessFiltersPage {
async clickCreateProcessButton(): Promise<void> {
await BrowserActions.closeMenuAndDialogs();
await BrowserVisibility.waitUntilElementIsVisible(this.accordionMenu);
await BrowserVisibility.waitUntilElementIsVisible(this.processesPage);
await BrowserActions.click(this.createProcessButton);
}
@@ -81,11 +77,6 @@ export class ProcessFiltersPage {
await BrowserActions.click(processName);
}
async checkFilterIsHighlighted(filterName: string): Promise<void> {
const processNameHighlighted = $(`adf-process-instance-filters .adf-active button[data-automation-id='${filterName}_filter']`);
await BrowserVisibility.waitUntilElementIsVisible(processNameHighlighted);
}
async numberOfProcessRows(): Promise<number> {
await BrowserVisibility.waitUntilElementIsVisible(await this.rows.first());
return this.rows.count();
@@ -95,53 +86,13 @@ export class ProcessFiltersPage {
await this.dataTable.waitForTableBody();
}
/**
* Sort the list by name column.
*
* @param sortOrder : 'ASC' to sort the list ascendant and 'DESC' for descendant
*/
async sortByName(sortOrder: string) {
await this.dataTable.sortByColumn(sortOrder, 'name');
}
async getAllRowsNameColumn() {
return this.dataTable.getAllRowsColumnValues('Name');
}
async checkFilterIsDisplayed(name: string): Promise<void> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsVisible(filterName);
}
async checkFilterHasNoIcon(name: string): Promise<void> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsVisible(filterName);
await BrowserVisibility.waitUntilElementIsNotVisible(filterName.$(this.processIcon));
}
async getFilterIcon(name: string): Promise<string> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsVisible(filterName);
const icon = filterName.$(this.processIcon);
return BrowserActions.getText(icon);
}
async checkFilterIsNotDisplayed(name: string): Promise<void> {
const filterName = await this.getButtonFilterLocatorByName(name);
await BrowserVisibility.waitUntilElementIsNotVisible(filterName);
}
async checkProcessesSortedByNameAsc(): Promise<void> {
const list = await this.getAllRowsNameColumn();
for (let i = 1; i < list.length; i++) {
await expect(JSON.stringify(list[i]) > JSON.stringify(list[i - 1])).toEqual(true);
}
}
async checkProcessesSortedByNameDesc(): Promise<void> {
const list = await this.getAllRowsNameColumn();
for (let i = 1; i < list.length; i++) {
await expect(JSON.stringify(list[i]) < JSON.stringify(list[i - 1])).toEqual(true);
}
}
}

View File

@@ -43,7 +43,7 @@ export class ProcessListDemoPage {
await this.stateDropdown.selectDropdownOption(stateOption);
}
async addAppId(appId: string): Promise<void> {
async addAppId(appId: string | number): Promise<void> {
await BrowserActions.click(this.appIdInput);
await this.appIdInput.sendKeys(protractor.Key.ENTER);
await this.appIdInput.clear();

View File

@@ -23,7 +23,6 @@ export class ProcessServiceTabBarPage {
tasksButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Tasks')).first();
processButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Process')).first();
reportsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Reports')).first();
settingsButton = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div', 'Settings')).first();
reportsButtonSelected = element.all(by.cssContainingText('div[class*="mat-tab-label"] .mat-tab-labels div[aria-selected="true"]', 'Reports')).first();
async clickTasksButton(): Promise<void> {
@@ -36,11 +35,6 @@ export class ProcessServiceTabBarPage {
await browser.sleep(500);
}
async clickSettingsButton(): Promise<void> {
await BrowserActions.click(this.settingsButton);
await browser.sleep(500);
}
async clickReportsButton(): Promise<void> {
await BrowserActions.click(this.reportsButton);
await BrowserVisibility.waitUntilElementIsVisible(this.reportsButtonSelected);

View File

@@ -47,7 +47,7 @@ export class ProcessServicesPage {
return new ProcessServiceTabBarPage();
}
async goToAppByAppId(appId: string): Promise<void> {
async goToAppByAppId(appId: string | number): Promise<void> {
const urlToNavigateTo = `${browser.baseUrl}/activiti/apps/${appId}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
const taskPage = new TasksPage();

View File

@@ -17,14 +17,9 @@
import { BrowserActions, BrowserVisibility, DropdownPage, TabsPage } from '@alfresco/adf-testing';
import { browser, by, element, Key, $, $$ } from 'protractor';
import { AppSettingsTogglesPage } from './dialog/app-settings-toggles.page';
export class TaskDetailsPage {
appSettingsTogglesClass = new AppSettingsTogglesPage();
formContent = $('adf-form');
formNameField = $('[data-automation-id="card-textitem-value-formName"]');
formNameButton = $('[data-automation-id="card-textitem-toggle-formName"]');
assigneeField = $('[data-automation-id="card-textitem-value-assignee"]');
@@ -45,7 +40,6 @@ export class TaskDetailsPage {
involvePeopleButton = $('div[class*="add-people"]');
addPeopleField = $('input[data-automation-id="adf-people-search-input"]');
addInvolvedUserButton = $('button[id="add-people"]');
taskDetailsInfoDrawer = element(by.tagName('adf-info-drawer'));
taskDetailsSection = $('div[data-automation-id="app-tasks-details"]');
taskDetailsEmptySection = $('div[data-automation-id="adf-tasks-details--empty"]');
completeTask = $('button[id="adf-no-form-complete-button"]');
@@ -304,18 +298,6 @@ export class TaskDetailsPage {
await BrowserActions.click(this.auditLogButton);
}
appSettingsToggles(): AppSettingsTogglesPage {
return this.appSettingsTogglesClass;
}
async taskInfoDrawerIsDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.taskDetailsInfoDrawer);
}
async taskInfoDrawerIsNotDisplayed(): Promise<void> {
await BrowserVisibility.waitUntilElementIsNotVisible(this.taskDetailsInfoDrawer);
}
async checkNoPeopleIsInvolved(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.noPeopleInvolved);
}

View File

@@ -19,9 +19,7 @@ import { ElementFinder } from 'protractor';
import { BrowserVisibility, BrowserActions } from '@alfresco/adf-testing';
export class TaskFiltersPage {
filter: ElementFinder;
taskIcon = 'adf-icon[data-automation-id="adf-filter-icon"]';
constructor(filter: ElementFinder) {
this.filter = filter;
@@ -31,17 +29,6 @@ export class TaskFiltersPage {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
}
async getTaskFilterIcon(): Promise<string> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
const icon = this.filter.$(this.taskIcon);
return BrowserActions.getText(icon);
}
async checkTaskFilterHasNoIcon(): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(this.filter);
await BrowserVisibility.waitUntilElementIsNotVisible(this.filter.$(this.taskIcon));
}
async clickTaskFilter(): Promise<void> {
return BrowserActions.click(this.filter);
}