[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

@@ -20,32 +20,29 @@ import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AttachmentListPage } from './../pages/attachment-list.page';
import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.page';
import { TasksPage } from './../pages/tasks.page';
import { AttachmentListPage } from '../pages/attachment-list.page';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
import { AppDefinitionRepresentation } from '@alfresco/js-api';
describe('Start Task - Custom App', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const attachmentListPage = new AttachmentListPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
const apiService = createApiService();
const usersActions = new UsersActions(apiService);
const applicationsService = new ApplicationsUtil(apiService);
let processUserModel; let assigneeUserModel;
const formTextField = app.form_fields.form_fieldId;
const formFieldValue = 'First value ';
let processUserModel: UserModel;
let assigneeUserModel: UserModel;
const taskPage = new TasksPage();
const firstComment = 'comm1'; const firstChecklist = 'checklist1';
const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File', 'Spinner'];
const showHeaderTask = 'Show Header';
let appModel;
let appModel: AppDefinitionRepresentation;
const pngFile = new FileModel({
location: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_location,
name: browser.params.resources.Files.ADF_DOCUMENTS.PNG.file_name
@@ -62,7 +59,7 @@ describe('Start Task - Custom App', () => {
appModel = await applicationsService.importPublishDeployApp(app.file_path);
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
it('[C263942] Should be possible to modify a task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
@@ -86,14 +83,19 @@ describe('Start Task - Custom App', () => {
await taskDetails.clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
).toEqual(assigneeUserModel.email);
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
await taskDetails.selectActivityTab();
const firstComment = 'comm1';
await taskDetails.addComment(firstComment);
await taskDetails.checkCommentIsDisplayed(firstComment);
const checklistDialog = await taskPage.clickOnAddChecklistButton();
const firstChecklist = 'checklist1';
await checklistDialog.addName(firstChecklist);
await checklistDialog.clickCreateChecklistButton();
@@ -137,6 +139,8 @@ describe('Start Task - Custom App', () => {
});
it('[C263949] Should be possible to save filled form', async () => {
const formFieldValue = 'First value ';
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
@@ -146,22 +150,15 @@ describe('Start Task - Custom App', () => {
await task.addName(tasks[4]);
await task.clickStartButton();
const formTextField = app.form_fields.form_fieldId;
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
await taskPage.formFields().refreshForm();
await taskPage.formFields().checkFieldValue(formTextField, '');
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await taskPage.formFields().setFieldValue(formTextField, formFieldValue);
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
await taskPage.formFields().saveForm();
await taskPage.formFields().checkFieldValue(formTextField, formFieldValue);
});
@@ -198,25 +195,4 @@ describe('Start Task - Custom App', () => {
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
});
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(showHeaderTask);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
await processServiceTabBarPage.clickTasksButton();
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
await processServiceTabBarPage.clickTasksButton();
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
});
});