ESLint: cleanup await expect from protractor tests (#9630)

This commit is contained in:
Denys Vuika
2024-04-30 08:07:10 -04:00
committed by GitHub
parent 4109f272ea
commit f401b8c13e
114 changed files with 2096 additions and 1908 deletions

View File

@@ -23,7 +23,6 @@ import CONSTANTS = require('../../util/constants');
import { AppDefinitionRepresentation, AppDefinitionsApi } from '@alfresco/js-api';
describe('Modify applications', () => {
const app = browser.params.resources.Files.APP_WITH_PROCESSES;
const appToBeDeleted = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const replacingApp = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
@@ -61,15 +60,15 @@ describe('Modify applications', () => {
});
it('[C260198] Should the app be displayed on dashboard when is deployed on APS', async () => {
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
});
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async () => {
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
await apps.importNewVersionAppDefinitionPublishDeployApp(replacingApp.file_location, firstApp.id);
@@ -78,9 +77,9 @@ describe('Modify applications', () => {
await processServicesPage.checkApsContainer();
await expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.FAVORITE);
await expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
await expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
expect(await processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.FAVORITE);
expect(await processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
expect(await processServicesPage.getDescription(app.title)).toEqual(app.description);
});
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async () => {
@@ -96,7 +95,7 @@ describe('Modify applications', () => {
it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async () => {
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
await apps.importNewVersionAppDefinitionPublishDeployApp(replacingApp.file_location, appVersionToBeDeleted.id);
@@ -105,7 +104,7 @@ describe('Modify applications', () => {
await processServicesPage.getBackgroundColor(appToBeDeleted.title);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
await modelActions.deleteModel(appVersionToBeDeleted.id);
await modelActions.deleteModel(appVersionToBeDeleted.id);
@@ -116,15 +115,15 @@ describe('Modify applications', () => {
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
});
it('[C260207] Should the app be updated when is edited in APS', async () => {
const newDescription = 'new description';
await expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
await expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.description);
expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.description);
const appDefinition = {
appDefinition: {
@@ -146,8 +145,8 @@ describe('Modify applications', () => {
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
await expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(newDescription);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.RED);
await expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
expect(await processServicesPage.getDescription(appToBeDeleted.title)).toEqual(newDescription);
expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.RED);
expect(await processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
});
});

View File

@@ -15,7 +15,8 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
ContentNodeSelectorDialogPage,
IntegrationService,
@@ -84,13 +85,13 @@ describe('Attach Folder', () => {
await searchService.isSearchable(folderName);
await contentNodeSelector.searchAndSelectResult(folderName, folderName);
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
await searchService.isSearchable('Meeting Notes');
await contentNodeSelector.searchAndSelectResult('Meeting Notes', 'Meeting Notes');
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(false);
await contentNodeSelector.clickCancelButton();
await widget.attachFolderWidget().checkFolderIsNotAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, folderName);
@@ -99,8 +100,8 @@ describe('Attach Folder', () => {
await contentNodeSelector.checkDialogIsDisplayed();
await contentNodeSelector.searchAndSelectResult(folderName, folderName);
await expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
await expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
expect(await contentNodeSelector.checkCancelButtonIsEnabled()).toBe(true);
expect(await contentNodeSelector.checkCopyMoveButtonIsEnabled()).toBe(true);
await contentNodeSelector.clickMoveCopyButton();
await widget.attachFolderWidget().checkFolderIsAttached(app.UPLOAD_FOLDER_FORM_CS.FIELD.widget_id, folderName);

View File

@@ -15,14 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
FormFields,
LoginPage,
ModelsActions,
TaskUtil,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, FormFields, LoginPage, ModelsActions, TaskUtil, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { AttachFormPage } from './../pages/attach-form.page';
@@ -47,7 +40,9 @@ describe('Attach Form Component', () => {
const modelsActions = new ModelsActions(apiService);
const formTextField = app.form_fields.form_fieldId;
let user; let tenantId; let appModel;
let user;
let tenantId;
let appModel;
const testNames = {
taskName: 'Test Task',
@@ -78,13 +73,13 @@ describe('Attach Form Component', () => {
await taskUtil.createStandaloneTask(testNames.taskName);
await taskUtil.createStandaloneTask(standaloneTask.taskName);
await loginPage.login(user.username, user.password);
});
});
afterAll(async () => {
await modelsActions.deleteModel(appModel.id);
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(tenantId);
});
});
it('[C280047] Should be able to view the attach-form component after creating a standalone task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
@@ -132,7 +127,7 @@ describe('Attach Form Component', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(testNames.taskName);
await expect(await formFields.getFieldValue(formTextField)).toEqual(testNames.formFieldValue);
expect(await formFields.getFieldValue(formTextField)).toEqual(testNames.formFieldValue);
});
it('[C329804] Attach form from standalone task with no form template', async () => {

View File

@@ -78,7 +78,7 @@ describe('Checklist component', () => {
await (await taskPage.clickOnAddChecklistButton()).clickCreateChecklistButton();
await taskPage.checkChecklistDialogIsNotDisplayed();
await taskPage.checkNoChecklistIsDisplayed();
await expect(await taskPage.getNumberOfChecklists()).toEqual('0');
expect(await taskPage.getNumberOfChecklists()).toEqual('0');
});
it('[C279975] Should no checklist be created when clicking on Cancel button on checklist dialog', async () => {
@@ -89,7 +89,7 @@ describe('Checklist component', () => {
await checklistDialog.clickCancelButton();
await taskPage.checkChecklistDialogIsNotDisplayed();
await taskPage.checkNoChecklistIsDisplayed();
await expect(await taskPage.getNumberOfChecklists()).toEqual('0');
expect(await taskPage.getNumberOfChecklists()).toEqual('0');
});
it('[C261025] Should Checklist dialog be displayed when clicking on add checklist button', async () => {
@@ -98,8 +98,8 @@ describe('Checklist component', () => {
await taskPage.clickOnAddChecklistButton();
await taskPage.checkChecklistDialogIsDisplayed();
await expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
await expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
await taskPage.usingCheckListDialog().checkAddChecklistButtonIsEnabled();
await checklistDialog.checkCancelButtonIsEnabled();
await taskPage.usingCheckListDialog().clickCancelButton();
@@ -112,13 +112,13 @@ describe('Checklist component', () => {
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[2]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(checklists[2]);
await expect(await taskPage.getNumberOfChecklists()).toEqual('1');
expect(await taskPage.getNumberOfChecklists()).toEqual('1');
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[3]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(checklists[3]);
await taskPage.checkChecklistIsDisplayed(checklists[2]);
await expect(await taskPage.getNumberOfChecklists()).toEqual('2');
expect(await taskPage.getNumberOfChecklists()).toEqual('2');
});
it('[C279980] Should checklist be removed when clicking on remove button', async () => {
@@ -159,7 +159,7 @@ describe('Checklist component', () => {
await taskPage.tasksListPage().selectRow(tasks[3]);
await taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
await taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
await expect(await taskPage.getNumberOfChecklists()).toEqual('2');
expect(await taskPage.getNumberOfChecklists()).toEqual('2');
await taskPage.checkChecklistsRemoveButtonIsNotDisplayed(removeChecklist[3]);
});

View File

@@ -15,13 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
StartProcessPage,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UsersActions, Widget } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from './../pages/process-filters.page';
import { ProcessDetailsPage } from './../pages/process-details.page';
import { TaskDetailsPage } from './../pages/task-details.page';
@@ -31,7 +25,6 @@ import { ProcessServiceTabBarPage } from './../pages/process-service-tab-bar.pag
import { TaskFormsApi } from '@alfresco/js-api';
describe('Form widgets - People ', () => {
const app = browser.params.resources.Files.APP_WITH_USER_WIDGET;
const loginPage = new LoginPage();
@@ -86,7 +79,7 @@ describe('Form widgets - People ', () => {
const taskId = await taskDetails.getId();
const taskForm: any = await taskFormsApi.getTaskForm(taskId);
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
await expect(userEmail).toEqual(processUserModel.email);
expect(userEmail).toEqual(processUserModel.email);
});
it('[C286576] Should be able to see user in completed task', async () => {
@@ -106,6 +99,6 @@ describe('Form widgets - People ', () => {
const taskId = await taskDetails.getId();
const taskForm: any = await taskFormsApi.getTaskForm(taskId);
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
await expect(userEmail).toEqual(processUserModel.email);
expect(userEmail).toEqual(processUserModel.email);
});
});

View File

@@ -15,13 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from './../pages/tasks.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { browser } from 'protractor';
@@ -32,7 +26,6 @@ import { TaskFormsApi } from '@alfresco/js-api';
const formInstance = new FormDefinitionModel();
describe('Form widgets', () => {
const taskPage = new TasksPage();
const loginPage = new LoginPage();
const widget = new Widget();
@@ -48,7 +41,6 @@ describe('Form widgets', () => {
let appModelWidget;
describe('Form widgets', () => {
const appWidget = browser.params.resources.Files.WIDGETS_SMOKE_TEST;
const appFields = appWidget.form_fields;
@@ -74,7 +66,7 @@ describe('Form widgets', () => {
await taskPage.tasksListPage().checkContentIsDisplayed(newTask);
await taskPage.formFields().checkFormIsDisplayed();
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const response = await taskPage.taskDetails().getId();
@@ -92,107 +84,124 @@ describe('Form widgets', () => {
});
it('[C272778] Should display text and multi-line in form', async () => {
await expect(await taskPage.formFields().getFieldLabel(appFields.text_id))
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).name);
await expect(await taskPage.formFields().getFieldValue(appFields.text_id))
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).value || '');
expect(await taskPage.formFields().getFieldLabel(appFields.text_id)).toEqual(formInstance.getWidgetBy('id', appFields.text_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.text_id)).toEqual(
formInstance.getWidgetBy('id', appFields.text_id).value || ''
);
await expect(await widget.multilineTextWidget().getFieldValue(appFields.multiline_id))
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).value || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.multiline_id))
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).name);
expect(await widget.multilineTextWidget().getFieldValue(appFields.multiline_id)).toEqual(
formInstance.getWidgetBy('id', appFields.multiline_id).value || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.multiline_id)).toEqual(
formInstance.getWidgetBy('id', appFields.multiline_id).name
);
});
it('[C272779] Should display number and amount in form', async () => {
await expect(await taskPage.formFields().getFieldValue(appFields.number_id))
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).value || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.number_id))
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.number_id)).toEqual(
formInstance.getWidgetBy('id', appFields.number_id).value || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.number_id)).toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
await expect(await taskPage.formFields().getFieldValue(appFields.amount_id))
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).value || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.amount_id))
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.amount_id)).toEqual(
formInstance.getWidgetBy('id', appFields.amount_id).value || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.amount_id)).toEqual(formInstance.getWidgetBy('id', appFields.amount_id).name);
});
it('[C272780] Should display attach file and attach folder in form', async () => {
await expect(await taskPage.formFields().getFieldLabel(appFields.attachFolder_id))
.toEqual(formInstance.getWidgetBy('id', appFields.attachFolder_id).name);
await expect(await taskPage.formFields().getFieldLabel(appFields.attachFile_id))
.toEqual(formInstance.getWidgetBy('id', appFields.attachFile_id).name);
expect(await taskPage.formFields().getFieldLabel(appFields.attachFolder_id)).toEqual(
formInstance.getWidgetBy('id', appFields.attachFolder_id).name
);
expect(await taskPage.formFields().getFieldLabel(appFields.attachFile_id)).toEqual(
formInstance.getWidgetBy('id', appFields.attachFile_id).name
);
});
it('[C272781] Should display date and date & time in form', async () => {
await expect(await taskPage.formFields().getFieldLabel(appFields.date_id))
.toContain(formInstance.getWidgetBy('id', appFields.date_id).name);
await expect(await taskPage.formFields().getFieldValue(appFields.date_id))
.toEqual(formInstance.getWidgetBy('id', appFields.date_id).value || '');
expect(await taskPage.formFields().getFieldLabel(appFields.date_id)).toContain(formInstance.getWidgetBy('id', appFields.date_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.date_id)).toEqual(
formInstance.getWidgetBy('id', appFields.date_id).value || ''
);
await expect(await taskPage.formFields().getFieldLabel(appFields.dateTime_id))
.toContain(formInstance.getWidgetBy('id', appFields.dateTime_id).name);
await expect(await taskPage.formFields().getFieldValue(appFields.dateTime_id))
.toEqual(formInstance.getWidgetBy('id', appFields.dateTime_id).value || '');
expect(await taskPage.formFields().getFieldLabel(appFields.dateTime_id)).toContain(
formInstance.getWidgetBy('id', appFields.dateTime_id).name
);
expect(await taskPage.formFields().getFieldValue(appFields.dateTime_id)).toEqual(
formInstance.getWidgetBy('id', appFields.dateTime_id).value || ''
);
});
it('[C272782] Should display people and group in form', async () => {
await expect(await taskPage.formFields().getFieldValue(appFields.people_id))
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).value || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.people_id))
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.people_id)).toEqual(
formInstance.getWidgetBy('id', appFields.people_id).value || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.people_id)).toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
await expect(await taskPage.formFields().getFieldValue(appFields.group_id))
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).value || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.group_id))
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.group_id)).toEqual(
formInstance.getWidgetBy('id', appFields.group_id).value || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.group_id)).toEqual(formInstance.getWidgetBy('id', appFields.group_id).name);
});
it('[C272783] Should display displayText and displayValue in form', async () => {
await expect(await widget.displayTextWidget().getFieldLabel(appFields.displayText_id))
.toEqual(formInstance.getWidgetBy('id', appFields.displayText_id).value);
await expect(await widget.displayValueWidget().getFieldLabel(appFields.displayValue_id))
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || 'Display value' || '');
await expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || '');
const expected0 = formInstance.getWidgetBy('id', appFields.displayText_id).value;
const expected1 = (formInstance.getWidgetBy('id', appFields.displayValue_id).value as string) || 'Display value';
const expected2 = (formInstance.getWidgetBy('id', appFields.displayValue_id).value as string) || '';
expect(await widget.displayTextWidget().getFieldLabel(appFields.displayText_id)).toEqual(expected0);
expect(await widget.displayValueWidget().getFieldLabel(appFields.displayValue_id)).toEqual(expected1);
expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id)).toEqual(expected2);
});
it('[C272784] Should display typeahead and header in form', async () => {
await expect(await widget.headerWidget().getFieldLabel(appFields.header_id))
.toEqual(formInstance.getWidgetBy('id', appFields.header_id).name);
await expect(await taskPage.formFields().getFieldValue(appFields.typeAhead_id))
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).value || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.typeAhead_id))
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).name);
expect(await widget.headerWidget().getFieldLabel(appFields.header_id)).toEqual(formInstance.getWidgetBy('id', appFields.header_id).name);
expect(await taskPage.formFields().getFieldValue(appFields.typeAhead_id)).toEqual(
formInstance.getWidgetBy('id', appFields.typeAhead_id).value || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.typeAhead_id)).toEqual(
formInstance.getWidgetBy('id', appFields.typeAhead_id).name
);
});
it('[C272785] Should display checkbox and radio button in form', async () => {
const radioOption = 1;
await expect(await taskPage.formFields().getFieldLabel(appFields.checkbox_id))
.toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name);
expect(await taskPage.formFields().getFieldLabel(appFields.checkbox_id)).toContain(
formInstance.getWidgetBy('id', appFields.checkbox_id).name
);
await expect(await taskPage.formFields().getFieldLabel(appFields.radioButtons_id))
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).name);
await expect(await widget.radioWidget().getSpecificOptionLabel(appFields.radioButtons_id, radioOption))
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).options[radioOption - 1].name);
expect(await taskPage.formFields().getFieldLabel(appFields.radioButtons_id)).toContain(
formInstance.getWidgetBy('id', appFields.radioButtons_id).name
);
expect(await widget.radioWidget().getSpecificOptionLabel(appFields.radioButtons_id, radioOption)).toContain(
formInstance.getWidgetBy('id', appFields.radioButtons_id).options[radioOption - 1].name
);
});
it('[C268149] Should display hyperlink, dropdown and dynamic table in form', async () => {
await expect(await widget.hyperlink().getFieldText(appFields.hyperlink_id))
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || '');
await expect(await taskPage.formFields().getFieldLabel(appFields.hyperlink_id))
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).name);
expect(await widget.hyperlink().getFieldText(appFields.hyperlink_id)).toEqual(
formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || ''
);
expect(await taskPage.formFields().getFieldLabel(appFields.hyperlink_id)).toEqual(
formInstance.getWidgetBy('id', appFields.hyperlink_id).name
);
await expect(await taskPage.formFields().getFieldLabel(appFields.dropdown_id))
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).name);
await expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id))
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).value);
expect(await taskPage.formFields().getFieldLabel(appFields.dropdown_id)).toContain(
formInstance.getWidgetBy('id', appFields.dropdown_id).name
);
expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id)).toContain(
formInstance.getWidgetBy('id', appFields.dropdown_id).value
);
await expect(await widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id))
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).name);
await expect(await widget.dynamicTable().getColumnName(appFields.dynamicTable_id))
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).columnDefinitions[0].name);
expect(await widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id)).toContain(
formInstance.getWidgetBy('id', appFields.dynamicTable_id).name
);
expect(await widget.dynamicTable().getColumnName(appFields.dynamicTable_id)).toContain(
formInstance.getWidgetBy('id', appFields.dynamicTable_id).columnDefinitions[0].name
);
});
});
});
describe('with fields involving other people', () => {
const app = browser.params.resources.Files.FORM_ADF;
@@ -227,19 +236,16 @@ describe('Form widgets', () => {
it('[C260405] Value fields configured with process variables', async () => {
await taskPage.formFields().checkFormIsDisplayed();
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.formFields().setValueInInputById('label', 'value 1');
await taskPage.formFields().completeForm();
/* cspell:disable-next-line */
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await expect(await widget.displayTextWidget().getFieldText(appFields.displayText_id))
.toContain('value 1');
await expect(await widget.textWidget().getFieldValue(appFields.text_id))
.toEqual('value 1');
await expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
.toEqual('value 1');
expect(await widget.displayTextWidget().getFieldText(appFields.displayText_id)).toContain('value 1');
expect(await widget.textWidget().getFieldValue(appFields.text_id)).toEqual('value 1');
expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id)).toEqual('value 1');
});
});
});

View File

@@ -23,7 +23,6 @@ import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
describe('People component', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -36,7 +35,9 @@ describe('People component', () => {
const taskUtil = new TaskUtil(apiService);
const applicationUtil = new ApplicationsUtil(apiService);
let processUserModel; let assigneeUserModel; let secondAssigneeUserModel;
let processUserModel;
let assigneeUserModel;
let secondAssigneeUserModel;
const peopleTitle = 'People this task is shared with ';
const tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter'];
@@ -102,8 +103,8 @@ describe('People component', () => {
const taskDetails = taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await expect(await taskPage.taskDetails().getInvolvePeopleHeader()).toEqual('Add people and groups');
await expect(await taskPage.taskDetails().getInvolvePeoplePlaceholder()).toEqual('Search user');
expect(await taskPage.taskDetails().getInvolvePeopleHeader()).toEqual('Add people and groups');
expect(await taskPage.taskDetails().getInvolvePeoplePlaceholder()).toEqual('Search user');
await taskDetails.checkAddPeopleButtonIsEnabled();
await taskDetails.checkCancelButtonIsEnabled();
@@ -134,8 +135,9 @@ describe('People component', () => {
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
await taskPage.taskDetails().removeInvolvedUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().checkNoPeopleIsInvolved();
});
@@ -151,8 +153,9 @@ describe('People component', () => {
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
await navigationBarPage.clickLogoutButton();
await loginPage.login(assigneeUserModel.username, assigneeUserModel.password);
@@ -175,9 +178,10 @@ describe('People component', () => {
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
await expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(1)');
expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(1)');
const taskDetails2 = taskPage.taskDetails();
await taskDetails2.clickInvolvePeopleButton();
@@ -187,9 +191,10 @@ describe('People component', () => {
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName))
.toEqual(secondAssigneeUserModel.email);
await expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(2)');
expect(await taskPage.taskDetails().getInvolvedUserEmail(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName)).toEqual(
secondAssigneeUserModel.email
);
expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(2)');
});
it('[C280014] Should involved user see the task in completed filters when the task is completed', async () => {
@@ -204,14 +209,16 @@ describe('People component', () => {
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(tasks[3]);
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
await navigationBarPage.clickLogoutButton();
await loginPage.login(assigneeUserModel.username, assigneeUserModel.password);

View File

@@ -15,13 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
StartProcessPage,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, StartProcessPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { TasksPage } from './../pages/tasks.page';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -33,7 +27,6 @@ import { ProcessListPage } from './../pages/process-list.page';
import CONSTANTS = require('../../util/constants');
describe('Stencil', () => {
const app = browser.params.resources.Files.STENCIL_PROCESS;
const loginPage = new LoginPage();
@@ -74,7 +67,7 @@ describe('Stencil', () => {
it('[C245648] Can start an app with custom stencil included', async () => {
const name = 'test stencil process';
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();