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();

View File

@@ -19,7 +19,6 @@ import { $ } from 'protractor';
import { BrowserVisibility, BrowserActions, DropdownPage, materialLocators } from '@alfresco/adf-testing';
export class AttachFormPage {
noFormMessage = $('.adf-empty-content__title');
attachFormButton = $('#adf-attach-form-attach-button');
completeButton = $('#adf-attach-form-complete-button');
@@ -38,11 +37,11 @@ export class AttachFormPage {
async checkDefaultFormTitleIsDisplayed(formTitle: string): Promise<void> {
const result = await BrowserActions.getText(this.defaultTitle);
await expect(result).toEqual(formTitle);
expect(result).toEqual(formTitle);
}
async openDropDownForms(): Promise<void> {
await BrowserActions.click(this.formDropdown);
await BrowserActions.click(this.formDropdown);
}
async checkFormDropdownIsDisplayed(): Promise<void> {

View File

@@ -43,13 +43,13 @@ export class ProcessFiltersPage {
async clickCompletedFilterButton(): Promise<void> {
const completedFilterButtonLocator = await this.getButtonFilterLocatorByName('Completed');
await BrowserActions.click(completedFilterButtonLocator);
await expect(await completedFilterButtonLocator.isEnabled()).toBe(true);
expect(await completedFilterButtonLocator.isEnabled()).toBe(true);
}
async clickAllFilterButton(): Promise<void> {
const allFilterButtonLocator = await this.getButtonFilterLocatorByName('All');
await BrowserActions.click(allFilterButtonLocator);
await expect(await allFilterButtonLocator.isEnabled()).toBe(true);
expect(await allFilterButtonLocator.isEnabled()).toBe(true);
}
async clickCreateProcessButton(): Promise<void> {

View File

@@ -77,11 +77,9 @@ describe('Comment component for Processes', () => {
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.getTotalNumberOfComments('Comments (' + addedComment.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
await expect(await commentsPage.getUserName(0)).toEqual(
addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName
);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
expect(await commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
it('[C260465] Should not be able to view process comment on included task', async () => {
@@ -97,7 +95,7 @@ describe('Comment component for Processes', () => {
const taskId = taskQuery.data[0].id;
const taskComments = await commentsApi.getTaskComments(taskId, { latestFirst: true });
await expect(taskComments.total).toEqual(0);
expect(taskComments.total).toEqual(0);
});
it('[C260466] Should be able to display comments from Task on the related Process', async () => {
@@ -117,10 +115,10 @@ describe('Comment component for Processes', () => {
await commentsPage.checkUserIconIsDisplayed();
await commentsPage.getTotalNumberOfComments('Comments (' + addedTaskComment.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
await expect(await commentsPage.getUserName(0)).toEqual(
expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
expect(await commentsPage.getUserName(0)).toEqual(
addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName
);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
});

View File

@@ -107,9 +107,9 @@ describe('Sorting for process filters', () => {
state: 'running',
sort: 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
await expect(processesQuery.data[2].name).toEqual(thirdProc.name);
expect(processesQuery.data[0].name).toEqual(firstProc.name);
expect(processesQuery.data[1].name).toEqual(secondProc.name);
expect(processesQuery.data[2].name).toEqual(thirdProc.name);
});
it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', async () => {
@@ -141,9 +141,9 @@ describe('Sorting for process filters', () => {
state: 'completed',
sort: 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
await expect(processesQuery.data[2].name).toEqual(thirdProc.name);
expect(processesQuery.data[0].name).toEqual(firstProc.name);
expect(processesQuery.data[1].name).toEqual(secondProc.name);
expect(processesQuery.data[2].name).toEqual(thirdProc.name);
});
it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', async () => {
@@ -179,12 +179,12 @@ describe('Sorting for process filters', () => {
state: 'all',
sort: 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual(firstProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
await expect(processesQuery.data[2].name).toEqual(thirdProc.name);
await expect(processesQuery.data[3].name).toEqual(deleteFirstProc.name);
await expect(processesQuery.data[4].name).toEqual(deleteSecondProc.name);
await expect(processesQuery.data[5].name).toEqual(deleteThirdProc.name);
expect(processesQuery.data[0].name).toEqual(firstProc.name);
expect(processesQuery.data[1].name).toEqual(secondProc.name);
expect(processesQuery.data[2].name).toEqual(thirdProc.name);
expect(processesQuery.data[3].name).toEqual(deleteFirstProc.name);
expect(processesQuery.data[4].name).toEqual(deleteSecondProc.name);
expect(processesQuery.data[5].name).toEqual(deleteThirdProc.name);
});
it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', async () => {
@@ -212,9 +212,9 @@ describe('Sorting for process filters', () => {
state: 'running',
sort: 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
await expect(processesQuery.data[2].name).toEqual(firstProc.name);
expect(processesQuery.data[0].name).toEqual(thirdProc.name);
expect(processesQuery.data[1].name).toEqual(secondProc.name);
expect(processesQuery.data[2].name).toEqual(firstProc.name);
});
it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', async () => {
@@ -245,9 +245,9 @@ describe('Sorting for process filters', () => {
state: 'completed',
sort: 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
await expect(processesQuery.data[1].name).toEqual(secondProc.name);
await expect(processesQuery.data[2].name).toEqual(firstProc.name);
expect(processesQuery.data[0].name).toEqual(thirdProc.name);
expect(processesQuery.data[1].name).toEqual(secondProc.name);
expect(processesQuery.data[2].name).toEqual(firstProc.name);
});
it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', async () => {
@@ -283,12 +283,12 @@ describe('Sorting for process filters', () => {
state: 'all',
sort: 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name);
await expect(processesQuery.data[1].name).toEqual(deleteSecondProc.name);
await expect(processesQuery.data[2].name).toEqual(deleteFirstProc.name);
await expect(processesQuery.data[3].name).toEqual(thirdProc.name);
await expect(processesQuery.data[4].name).toEqual(secondProc.name);
await expect(processesQuery.data[5].name).toEqual(firstProc.name);
expect(processesQuery.data[0].name).toEqual(deleteThirdProc.name);
expect(processesQuery.data[1].name).toEqual(deleteSecondProc.name);
expect(processesQuery.data[2].name).toEqual(deleteFirstProc.name);
expect(processesQuery.data[3].name).toEqual(thirdProc.name);
expect(processesQuery.data[4].name).toEqual(secondProc.name);
expect(processesQuery.data[5].name).toEqual(firstProc.name);
});
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', async () => {
@@ -320,9 +320,9 @@ describe('Sorting for process filters', () => {
state: 'completed',
sort: 'ended-asc'
});
await expect(processesQuery.data[0].name).toEqual(secondProc.name);
await expect(processesQuery.data[1].name).toEqual(firstProc.name);
await expect(processesQuery.data[2].name).toEqual(thirdProc.name);
expect(processesQuery.data[0].name).toEqual(secondProc.name);
expect(processesQuery.data[1].name).toEqual(firstProc.name);
expect(processesQuery.data[2].name).toEqual(thirdProc.name);
});
it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', async () => {
@@ -354,8 +354,8 @@ describe('Sorting for process filters', () => {
state: 'completed',
sort: 'ended-desc'
});
await expect(processesQuery.data[0].name).toEqual(thirdProc.name);
await expect(processesQuery.data[1].name).toEqual(firstProc.name);
await expect(processesQuery.data[2].name).toEqual(secondProc.name);
expect(processesQuery.data[0].name).toEqual(thirdProc.name);
expect(processesQuery.data[1].name).toEqual(firstProc.name);
expect(processesQuery.data[2].name).toEqual(secondProc.name);
});
});

View File

@@ -59,8 +59,8 @@ describe('Empty Process List Test', () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await (await processServicesPage.goToApp(appWithProcess.title)).clickProcessButton();
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
await expect(await processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
expect(await processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
@@ -68,14 +68,14 @@ describe('Empty Process List Test', () => {
await startProcessPage.selectFromProcessDropdown(appWithProcess.process_wse_name);
await startProcessPage.clickStartProcessButton();
await expect(await processFiltersPage.numberOfProcessRows()).toEqual(1);
expect(await processFiltersPage.numberOfProcessRows()).toEqual(1);
await processDetailsPage.propertiesList.waitVisible();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await (await processServicesPage.goToApp(simpleAppWithUserForm.title)).clickProcessButton();
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
await expect(await processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
expect(await processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
@@ -83,7 +83,7 @@ describe('Empty Process List Test', () => {
await startProcessPage.selectFromProcessDropdown(simpleAppWithUserForm.processName);
await startProcessPage.clickStartProcessButton();
await expect(await processFiltersPage.numberOfProcessRows()).toEqual(1);
expect(await processFiltersPage.numberOfProcessRows()).toEqual(1);
await processDetailsPage.propertiesList.waitVisible();
});

View File

@@ -71,11 +71,11 @@ describe('Process List - Pagination when adding processes', () => {
await processFiltersPage.dataTable.waitTillContentLoaded();
await processDetailsPage.checkProcessTitleIsDisplayed();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20');
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of 20');
expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
@@ -87,11 +87,11 @@ describe('Process List - Pagination when adding processes', () => {
await paginationPage.clickOnNextPage();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25');
await expect(await processFiltersPage.numberOfProcessRows()).toBe(10);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-25 of 25');
expect(await processFiltersPage.numberOfProcessRows()).toBe(10);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
});

View File

@@ -66,7 +66,7 @@ describe('Process Filters Test', () => {
it('[C260387] Should the running process be displayed when clicking on Running filter', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
@@ -96,7 +96,7 @@ describe('Process Filters Test', () => {
it('[C280063] Should both the new created process and a completed one to be displayed when clicking on All filter', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickAllFilterButton();
await processFiltersPage.selectFromProcessList(processTitle.running);
@@ -107,7 +107,7 @@ describe('Process Filters Test', () => {
it('[C280064] Should the completed process be displayed when clicking on Completed filter', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList(processTitle.completed);
@@ -117,7 +117,7 @@ describe('Process Filters Test', () => {
it('[C260463] Should Cancel process be displayed in Completed process filters', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();

View File

@@ -61,7 +61,7 @@ describe('Process Instance Details', () => {
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
process = await processApi.getProcessInstance(processModel.id);
});

View File

@@ -191,12 +191,12 @@ describe('Process List Test', () => {
const sortedProcessListNamesAsc = await processListDemoPage.getDisplayedProcessesNames();
await expect(JSON.stringify(processList) === JSON.stringify(sortedProcessListNamesAsc)).toBe(true);
expect(JSON.stringify(processList) === JSON.stringify(sortedProcessListNamesAsc)).toBe(true);
await processListDemoPage.selectSorting('desc');
await processListDemoPage.dataTable.waitTillContentLoaded();
const sortedProcessListNamesDesc = await processListDemoPage.getDisplayedProcessesNames();
await expect(JSON.stringify(processList.reverse()) === JSON.stringify(sortedProcessListNamesDesc)).toBe(true);
expect(JSON.stringify(processList.reverse()) === JSON.stringify(sortedProcessListNamesDesc)).toBe(true);
});
});

View File

@@ -16,10 +16,12 @@
*/
import CONSTANTS = require('../../util/constants');
import { createApiService,
import {
createApiService,
ApplicationsUtil,
FileBrowserUtil,
LoginPage, ModelsActions,
LoginPage,
ModelsActions,
ProcessInstanceTasksPage,
StartProcessPage,
StringUtil,
@@ -137,7 +139,7 @@ describe('Start Process Component', () => {
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.selectFromProcessDropdown(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
});
it('[C260445] Should require process definition and be possible to click cancel button', async () => {
@@ -179,12 +181,12 @@ describe('Start Process Component', () => {
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.checkSelectProcessPlaceholderIsDisplayed()).toBe('');
expect(await startProcessPage.checkSelectProcessPlaceholderIsDisplayed()).toBe('');
await startProcessPage.selectFromProcessDropdown(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
});
it('[C260449] Should be possible to start a process with start event', async () => {
@@ -201,14 +203,14 @@ describe('Start Process Component', () => {
const processId = await processDetailsPage.getId();
const response = await processApi.getProcessInstance(processId);
await expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
await expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
await expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
await expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
await expect(await processDetailsPage.getCreatedBy()).toEqual(`${response.startedBy.firstName} ${response.startedBy.lastName}`);
await expect(await processDetailsPage.getId()).toEqual(response.id);
await expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
await expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(response.name);
expect(await processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
expect(await processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
expect(await processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
expect(await processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
expect(await processDetailsPage.getCreatedBy()).toEqual(`${response.startedBy.firstName} ${response.startedBy.lastName}`);
expect(await processDetailsPage.getId()).toEqual(response.id);
expect(await processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
expect(await processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(response.name);
});
it('[C286503] Should NOT display any process definition when typing a non-existent one', async () => {
@@ -230,7 +232,7 @@ describe('Start Process Component', () => {
await startProcessPage.checkProcessOptionIsDisplayed(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.checkProcessOptionIsDisplayed(browser.params.resources.Files.APP_WITH_PROCESSES.process_se_name);
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
});
it('[C286508] Should display only one option when typing an existent process definition', async () => {
@@ -242,7 +244,7 @@ describe('Start Process Component', () => {
await startProcessPage.checkProcessOptionIsDisplayed(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.checkProcessOptionIsNotDisplayed(browser.params.resources.Files.APP_WITH_PROCESSES.process_se_name);
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
});
it('[C286509] Should select automatically the processDefinition when the app contains only one', async () => {
@@ -250,8 +252,8 @@ describe('Start Process Component', () => {
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(simpleApp.title);
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.getProcessDefinitionValue()).toBe(simpleApp.title);
expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
});
it('[C286511] Should be able to type the process definition and start a process', async () => {
@@ -262,10 +264,8 @@ describe('Start Process Component', () => {
await startProcessPage.typeProcessDefinition(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.enterProcessName('Type');
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
);
expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.clickStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Type');
@@ -279,9 +279,7 @@ describe('Start Process Component', () => {
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.pressDownArrowAndEnter();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
);
expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
});
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => {
@@ -291,12 +289,10 @@ describe('Start Process Component', () => {
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.selectProcessOption(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(
browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name
);
expect(await startProcessPage.getProcessDefinitionValue()).toBe(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await startProcessPage.clickProcessDropdownArrow();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe('');
expect(await startProcessPage.getProcessDefinitionValue()).toBe('');
});
it('[C260453] Should be possible to add a comment on an active process', async () => {
@@ -440,7 +436,7 @@ describe('Start Process Component', () => {
await startProcessPage.enterProcessName(processName255Characters);
await startProcessPage.selectFromProcessDropdown(browser.params.resources.Files.APP_WITH_PROCESSES.process_wse_name);
await expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.isStartProcessButtonEnabled()).toEqual(true);
await startProcessPage.enterProcessName(processNameBiggerThen255Characters);
await startProcessPage.checkValidationErrorIsDisplayed(lengthValidationError);
@@ -455,15 +451,15 @@ describe('Start Process Component', () => {
await startProcessPage.enterProcessName('DateFormProcess');
await startProcessPage.formFields().checkWidgetIsVisible('testdate');
await widget.dateWidget().setDateInput('testdate', '15-7-2019');
await expect(await startProcessPage.isStartFormProcessButtonEnabled()).toEqual(true);
expect(await startProcessPage.isStartFormProcessButtonEnabled()).toEqual(true);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('DateFormProcess');
await processInstanceTasksPage.clickOnStartForm();
await processInstanceTasksPage.checkStartProcessDialogIsDisplayed();
await expect(await processInstanceTasksPage.getTitle()).toBe('Start Form');
await expect(await widget.dateWidget().getDateInput('testdate')).toBe('15-7-2019');
expect(await processInstanceTasksPage.getTitle()).toBe('Start Form');
expect(await widget.dateWidget().getDateInput('testdate')).toBe('15-7-2019');
await processInstanceTasksPage.clickCloseButton();
await processInstanceTasksPage.checkStartProcessDialogIsNotDisplayed();
});

View File

@@ -17,14 +17,7 @@
import { browser } from 'protractor';
import { createApiService,
ApplicationsUtil,
LoginPage,
ModelsActions,
TaskUtil,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, TaskUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { CommentsPage } from '../../core/pages/comments.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -32,7 +25,6 @@ import { ActivitiCommentsApi, TaskActionsApi } from '@alfresco/js-api';
import CONSTANTS = require('../../util/constants');
describe('Comment component for Processes', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -92,7 +84,7 @@ describe('Comment component for Processes', () => {
});
it('[C212864] Should be able to add multiple comments on a single task using different users', async () => {
const newTask = await taskUtil.createStandaloneTask(taskName.multiple_users);
const newTask = await taskUtil.createStandaloneTask(taskName.multiple_users);
await taskActionsApi.involveUser(newTask.id, { email: secondUser.email });
@@ -117,14 +109,18 @@ describe('Comment component for Processes', () => {
await commentsPage.getTotalNumberOfComments('Comments (' + totalCommentsLatest.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(totalCommentsLatest.data[0].message);
await expect(await commentsPage.getMessage(1)).toEqual(totalCommentsLatest.data[1].message);
expect(await commentsPage.getMessage(0)).toEqual(totalCommentsLatest.data[0].message);
expect(await commentsPage.getMessage(1)).toEqual(totalCommentsLatest.data[1].message);
await expect(await commentsPage.getUserName(0)).toEqual(totalCommentsLatest.data[0].createdBy.firstName + ' ' + totalCommentsLatest.data[0].createdBy.lastName);
await expect(await commentsPage.getUserName(1)).toEqual(totalCommentsLatest.data[1].createdBy.firstName + ' ' + totalCommentsLatest.data[1].createdBy.lastName);
expect(await commentsPage.getUserName(0)).toEqual(
totalCommentsLatest.data[0].createdBy.firstName + ' ' + totalCommentsLatest.data[0].createdBy.lastName
);
expect(await commentsPage.getUserName(1)).toEqual(
totalCommentsLatest.data[1].createdBy.firstName + ' ' + totalCommentsLatest.data[1].createdBy.lastName
);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTime(1)).toMatch(/(ago|few)/);
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
expect(await commentsPage.getTime(1)).toMatch(/(ago|few)/);
await navigationBarPage.clickLogoutButton();
await loginPage.login(secondUser.username, secondUser.password);
@@ -145,16 +141,16 @@ describe('Comment component for Processes', () => {
await commentsPage.getTotalNumberOfComments('Comments (' + totalComments.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(totalComments.data[0].message);
await expect(await commentsPage.getMessage(1)).toEqual(totalComments.data[1].message);
await expect(await commentsPage.getMessage(2)).toEqual(totalComments.data[2].message);
expect(await commentsPage.getMessage(0)).toEqual(totalComments.data[0].message);
expect(await commentsPage.getMessage(1)).toEqual(totalComments.data[1].message);
expect(await commentsPage.getMessage(2)).toEqual(totalComments.data[2].message);
await expect(await commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName);
await expect(await commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
await expect(await commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName);
expect(await commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName);
expect(await commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
expect(await commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTime(1)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTime(2)).toMatch(/(ago|few)/);
expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
expect(await commentsPage.getTime(1)).toMatch(/(ago|few)/);
expect(await commentsPage.getTime(2)).toMatch(/(ago|few)/);
});
});

View File

@@ -175,19 +175,19 @@ describe('Start Task - Custom App', () => {
});
it('[C286362] Default pagination settings on task list', async () => {
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
});
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
await expect(await paginationPage.getTotalPages()).toEqual('of 1');
expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
expect(await paginationPage.getTotalPages()).toEqual('of 1');
await paginationPage.checkPageSelectorIsNotDisplayed();
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
@@ -196,15 +196,15 @@ describe('Start Task - Custom App', () => {
it('[C286367] 20 Items per page', async () => {
await taskListSinglePage.typeItemsPerPage(itemsPerPage.twentyValue);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
});
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
@@ -213,61 +213,57 @@ describe('Start Task - Custom App', () => {
it('[C286365] 5 Items per page', async () => {
await taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
});
await paginationPage.clickOnNextPage();
currentPage++;
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
});
await paginationPage.clickOnNextPage();
currentPage++;
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(
'Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks
);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
});
await paginationPage.clickOnNextPage();
currentPage++;
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual(
'Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks
);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
});
});
@@ -275,26 +271,26 @@ describe('Start Task - Custom App', () => {
currentPage = 1;
await taskListSinglePage.typeItemsPerPage(itemsPerPage.tenValue);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 10))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 10))).toEqual(true);
});
await paginationPage.clickOnNextPage();
currentPage++;
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 20))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 20))).toEqual(true);
});
});
@@ -302,34 +298,32 @@ describe('Start Task - Custom App', () => {
currentPage = 1;
await taskListSinglePage.typeItemsPerPage(itemsPerPage.fifteenValue);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual(
'Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfTasks
);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 15))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 15))).toEqual(true);
});
currentPage++;
await paginationPage.clickOnNextPage();
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
});
});
it('[C286366] Pagination is not displayed when no task is displayed', async () => {
await taskListSinglePage.typeAppId(secondAppRuntime.id.toString());
await expect(await taskListSinglePage.getAppId()).toEqual(secondAppRuntime.id.toString());
expect(await taskListSinglePage.getAppId()).toEqual(secondAppRuntime.id.toString());
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
@@ -337,7 +331,7 @@ describe('Start Task - Custom App', () => {
it('[C286406] Invalid values for items per page', async () => {
await taskListSinglePage.typeItemsPerPage(0);
await taskListSinglePage.clickAppId();
await expect(await taskListSinglePage.getItemsPerPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
expect(await taskListSinglePage.getItemsPerPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
});
it('[C286404] Navigate using page field', async () => {
@@ -348,18 +342,18 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
});
currentPage++;
@@ -367,60 +361,60 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
});
currentPage++;
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
});
currentPage++;
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage
.taskList()
.getAllRowsNameColumn('Name')
.then(async (list) => {
await expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
});
});
it('[C286405] Type invalid values to page field', async () => {
await taskListSinglePage.typePage(0);
await taskListSinglePage.clickAppId();
await expect(await taskListSinglePage.getPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
expect(await taskListSinglePage.getPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
await taskListSinglePage.clickResetButton();
await taskListSinglePage.typePage(2);
@@ -430,7 +424,7 @@ describe('Start Task - Custom App', () => {
it('[C286413] Task is displayed when typing into dueAfter field a date before the tasks due date', async () => {
await taskListSinglePage.typeDueAfter(beforeDate);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
});
it('[C286414] Task is not displayed when typing into dueAfter field a date after the task due date', async () => {
@@ -451,7 +445,7 @@ describe('Start Task - Custom App', () => {
it('[C286425] Task is displayed when typing into dueBefore field a date after the task due date', async () => {
await taskListSinglePage.typeDueBefore(afterDate);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
});
it('[C286426] Task is not displayed when typing into dueBefore field the same date as tasks due date', async () => {
@@ -469,19 +463,19 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.typeDueBefore(afterDate);
await taskListSinglePage.typeDueAfter(beforeDate);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
});
it('[C286429] Task is not displayed when typing into dueAfter field a date after the tasks due date and into dueBefore a date after', async () => {
await taskListSinglePage.typeDueBefore(afterDate);
await taskListSinglePage.typeDueAfter(afterDate);
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
it('[C280515] Should be able to see only the tasks of a specific app when typing the apps id in the appId field', async () => {
await taskListSinglePage.typeAppId(appRuntime.id.toString());
await expect(await taskListSinglePage.getAppId()).toEqual(appRuntime.id.toString());
expect(await taskListSinglePage.getAppId()).toEqual(appRuntime.id.toString());
await taskListSinglePage.taskList().checkContentIsDisplayed(app.taskName, 'Name');
await taskListSinglePage.taskList().checkContentIsDisplayed(app.taskName, 'Name');
@@ -490,41 +484,41 @@ describe('Start Task - Custom App', () => {
it('[C280569] Should be able to see No tasks found when typing an invalid appId', async () => {
await taskListSinglePage.typeAppId(invalidAppId);
await expect(await taskListSinglePage.getAppId()).toEqual(invalidAppId.toString());
expect(await taskListSinglePage.getAppId()).toEqual(invalidAppId.toString());
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
it('[C280570] Should be able to see only the tasks with specific name when typing the name in the task name field', async () => {
await taskListSinglePage.typeTaskName(paginationTasksName[13]);
await expect(await taskListSinglePage.getTaskName()).toEqual(paginationTasksName[13]);
expect(await taskListSinglePage.getTaskName()).toEqual(paginationTasksName[13]);
await taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[13], 'Name');
await expect((await taskListSinglePage.taskList().getRowsDisplayedWithSameName(paginationTasksName[13], 'Name')).length).toBe(2);
expect((await taskListSinglePage.taskList().getRowsDisplayedWithSameName(paginationTasksName[13], 'Name')).length).toBe(2);
});
it('[C280571] Should be able to see No tasks found when typing a task name that does not exist', async () => {
await taskListSinglePage.typeTaskName(invalidName);
await expect(await taskListSinglePage.getTaskName()).toEqual(invalidName);
expect(await taskListSinglePage.getTaskName()).toEqual(invalidName);
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
it('[C280629] Should be able to see only the task with specific taskId when typing it in the task Id field', async () => {
await taskListSinglePage.typeTaskId(taskWithDueDate.id);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await taskListSinglePage.getTaskId()).toEqual(taskWithDueDate.id);
expect(await taskListSinglePage.getTaskId()).toEqual(taskWithDueDate.id);
await taskListSinglePage.taskList().checkContentIsDisplayed(taskWithDueDate.name, 'Name');
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
});
it('[C280630] Should be able to see No tasks found when typing an invalid taskId', async () => {
await taskListSinglePage.typeTaskId(invalidTaskId);
await expect(await taskListSinglePage.getTaskId()).toEqual(invalidTaskId);
expect(await taskListSinglePage.getTaskId()).toEqual(invalidTaskId);
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
it('[C286589] Should be able to see only completed tasks when choosing Completed from state drop down', async () => {
@@ -534,7 +528,7 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name, 'Name');
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name, 'Name');
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[2].name, 'Name');
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(3);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(3);
});
it('[C286597] Should be able to see only running tasks when choosing Active from state drop down', async () => {
@@ -547,8 +541,8 @@ describe('Start Task - Custom App', () => {
const list = await taskListSinglePage.taskList().getAllRowsNameColumn('Name');
await expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(20);
expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(20);
});
it('[C286598] Should be able to see all tasks when choosing All from state drop down', async () => {
@@ -561,9 +555,9 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[2].name, 'Name');
const list = await taskListSinglePage.taskList().getAllRowsNameColumn('Name');
await expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, allTasksName)).toEqual(true);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(23);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(23);
});
});
@@ -579,10 +573,10 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.clickResetButton();
await taskListSinglePage.typeProcessDefinitionId(processDefinitionId.processDefinitionId);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(4);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(4);
const list = await taskListSinglePage.getAllProcessDefinitionIds();
await expect(ArrayUtil.arrayContainsArray(list, processDefinitionIds)).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, processDefinitionIds)).toEqual(true);
});
it('[C286623] Should be able to see No tasks found when typing an invalid processDefinitionId', async () => {
@@ -591,7 +585,7 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.typeProcessDefinitionId(invalidTaskId);
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
it('[C286622] Should be able to see only tasks that are part of a specific process when processInstanceId is set', async () => {
@@ -602,11 +596,11 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.typeProcessInstanceId(processDefinitionId.id);
await taskListSinglePage.taskList().getDataTable().waitTillContentLoaded();
await expect(await taskListSinglePage.getProcessInstanceId()).toEqual(processDefinitionId.id);
expect(await taskListSinglePage.getProcessInstanceId()).toEqual(processDefinitionId.id);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
const list = await taskListSinglePage.getAllProcessInstanceIds();
await expect(ArrayUtil.arrayContainsArray(list, processInstanceIds)).toEqual(true);
expect(ArrayUtil.arrayContainsArray(list, processInstanceIds)).toEqual(true);
});
it('[C286623] Should be able to see No tasks found when typing an invalid processInstanceId', async () => {
@@ -614,8 +608,8 @@ describe('Start Task - Custom App', () => {
await taskListSinglePage.clickResetButton();
await taskListSinglePage.typeProcessInstanceId(invalidTaskId);
await expect(await taskListSinglePage.getProcessInstanceId()).toEqual(invalidTaskId);
expect(await taskListSinglePage.getProcessInstanceId()).toEqual(invalidTaskId);
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
});

View File

@@ -15,12 +15,14 @@
* limitations under the License.
*/
import { createApiService,
import {
createApiService,
ApplicationsUtil,
BrowserActions,
BrowserVisibility,
LocalStorageUtil,
LoginPage, ModelsActions,
LoginPage,
ModelsActions,
StringUtil,
UserModel,
UsersActions
@@ -36,7 +38,6 @@ import CONSTANTS = require('../../util/constants');
import { DateFnsUtils } from '../../../lib/core/src/lib/common/utils/date-fns-utils';
describe('Info Drawer', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
@@ -107,7 +108,7 @@ describe('Info Drawer', () => {
await taskPage.tasksListPage().selectRow(name);
await taskPage.checkTaskTitle(name);
await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
await shouldHaveInfoDrawerDetails({
...taskDetails,
dueDate: date.header,
@@ -132,13 +133,13 @@ describe('Info Drawer', () => {
await taskPage.tasksListPage().selectRow(name);
await taskPage.checkTaskTitle(name);
await expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority);
expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority);
await taskPage.taskDetails().updatePriority('40');
await taskPage.taskDetails().checkTaskDetailsDisplayed();
await expect(await taskPage.taskDetails().getPriority()).toEqual('40');
expect(await taskPage.taskDetails().getPriority()).toEqual('40');
await taskPage.taskDetails().updatePriority();
await taskPage.taskDetails().checkTaskDetailsDisplayed();
await expect(await taskPage.taskDetails().getPriority()).toEqual('');
expect(await taskPage.taskDetails().getPriority()).toEqual('');
await taskPage.taskDetails().clickCompleteFormTask();
});
@@ -152,7 +153,7 @@ describe('Info Drawer', () => {
await taskPage.tasksListPage().selectRow(name);
await taskPage.checkTaskTitle(name);
await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
await shouldHaveInfoDrawerDetails({
...taskDetails,
dueDate: date.header,
@@ -161,7 +162,7 @@ describe('Info Drawer', () => {
});
await taskPage.taskDetails().updateDueDate();
await expect(await taskPage.taskDetails().getDueDate()).toEqual(DateFnsUtils.formatDate(new Date('Aug 1, 2017'), taskDetails.dateFormat));
expect(await taskPage.taskDetails().getDueDate()).toEqual(DateFnsUtils.formatDate(new Date('Aug 1, 2017'), taskDetails.dateFormat));
await taskPage.taskDetails().clickCompleteFormTask();
@@ -218,7 +219,7 @@ describe('Info Drawer', () => {
formName: app.formName
});
await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
await BrowserActions.click(taskPage.taskDetails().assigneeButton);
const cancelSearch = element(by.css('button[id="close-people-search"]'));
await BrowserVisibility.waitUntilElementIsPresent(cancelSearch);
@@ -231,7 +232,7 @@ describe('Info Drawer', () => {
formName: app.formName
});
await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
await BrowserActions.click(taskPage.taskDetails().assigneeButton);
const addPeople = element(by.css('button[id="add-people"]'));
await BrowserVisibility.waitUntilElementIsPresent(addPeople);
@@ -301,7 +302,7 @@ describe('Info Drawer', () => {
await taskPage.checkTaskTitle(name);
await taskPage.taskDetails().checkTaskDetailsDisplayed();
await browser.sleep(2000);
await expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
expect(await taskPage.taskDetails().isAssigneeClickable()).toBeTruthy();
await shouldHaveInfoDrawerDetails({
...taskDetails,
dueDate: 'Aug 12, 2017',
@@ -310,9 +311,9 @@ describe('Info Drawer', () => {
});
await taskPage.taskDetails().updateDescription('');
await expect(await taskPage.taskDetails().getDescriptionPlaceholder()).toEqual('No description');
expect(await taskPage.taskDetails().getDescriptionPlaceholder()).toEqual('No description');
await taskPage.taskDetails().updateDescription('Good Bye');
await expect(await taskPage.taskDetails().getDescription()).toEqual('Good Bye');
expect(await taskPage.taskDetails().getDescription()).toEqual('Good Bye');
await taskPage.taskDetails().clickCompleteFormTask();
});
@@ -328,10 +329,10 @@ describe('Info Drawer', () => {
await taskPage.tasksListPage().selectRow(name);
await taskPage.checkTaskTitle(name);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(processUserModelFullName);
await expect(await taskPage.taskDetails().getStatus()).toEqual(taskDetails.status);
await expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority);
await expect(await taskPage.taskDetails().getParentName()).toEqual(taskDetails.parentName);
expect(await taskPage.taskDetails().getAssignee()).toEqual(processUserModelFullName);
expect(await taskPage.taskDetails().getStatus()).toEqual(taskDetails.status);
expect(await taskPage.taskDetails().getPriority()).toEqual(taskDetails.priority);
expect(await taskPage.taskDetails().getParentName()).toEqual(taskDetails.parentName);
await taskPage.taskDetails().checkDueDatePickerButtonIsNotDisplayed();
await taskPage.taskDetails().clickCompleteFormTask();
@@ -355,14 +356,16 @@ describe('Info Drawer', () => {
* @param props task details properties to validate
*/
async function shouldHaveInfoDrawerDetails(props: TaskDetailsProps) {
await expect(await taskPage.taskDetails().getAssignee()).toEqual(props.fullName);
await expect(await taskPage.taskDetails().getDescription()).toEqual(props.description);
await expect(await taskPage.taskDetails().getStatus()).toEqual(props.status);
await expect(await taskPage.taskDetails().getPriority()).toEqual(props.priority);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(props.dueDate !== 'No date' ? DateFnsUtils.formatDate(new Date(props.dueDate), props.dateFormat) : 'No date');
await expect(await taskPage.taskDetails().getCategory()).toEqual(props.category);
await expect(await taskPage.taskDetails().getParentName()).toEqual(props.parentName);
await expect(await taskPage.taskDetails().getCreated()).toEqual(DateFnsUtils.formatDate(new Date().getTime(), props.dateFormat));
expect(await taskPage.taskDetails().getAssignee()).toEqual(props.fullName);
expect(await taskPage.taskDetails().getDescription()).toEqual(props.description);
expect(await taskPage.taskDetails().getStatus()).toEqual(props.status);
expect(await taskPage.taskDetails().getPriority()).toEqual(props.priority);
expect(await taskPage.taskDetails().getDueDate()).toEqual(
props.dueDate !== 'No date' ? DateFnsUtils.formatDate(new Date(props.dueDate), props.dateFormat) : 'No date'
);
expect(await taskPage.taskDetails().getCategory()).toEqual(props.category);
expect(await taskPage.taskDetails().getParentName()).toEqual(props.parentName);
expect(await taskPage.taskDetails().getCreated()).toEqual(DateFnsUtils.formatDate(new Date().getTime(), props.dateFormat));
await taskPage.taskDetails().waitFormNameEqual(props.formName);
}
});

View File

@@ -15,20 +15,13 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
PaginationPage,
ProcessUtil,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, ProcessUtil, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksPage } from './../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
describe('Items per page set to 15 and adding of tasks', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -61,12 +54,12 @@ describe('Items per page set to 15 and adding of tasks', () => {
resultApp = await applicationsService.importPublishDeployApp(app.file_path);
const processUtil = new ProcessUtil(apiService);
for (i = 0; i < (nrOfTasks - 5); i++) {
for (i = 0; i < nrOfTasks - 5; i++) {
await processUtil.startProcessOfApp(resultApp.name);
}
await loginPage.login(processUserModel.username, processUserModel.password);
});
});
it('[C260306] Items per page set to 15 and adding of tasks', async () => {
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
@@ -75,11 +68,11 @@ describe('Items per page set to 15 and adding of tasks', () => {
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + (nrOfTasks - 5));
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + (nrOfTasks - 5));
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
const processUtil = new ProcessUtil(apiService);
for (i; i < nrOfTasks; i++) {
@@ -90,11 +83,11 @@ describe('Items per page set to 15 and adding of tasks', () => {
await paginationPage.clickOnNextPage();
await taskPage.tasksListPage().getDataTable().waitTillContentLoaded();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
});

View File

@@ -71,11 +71,11 @@ describe('Task List Pagination - Sorting', () => {
await taskPage.filtersPage().sortByName('ASC');
await taskPage.tasksListPage().getDataTable().waitForTableBody();
const listAsc = await taskPage.filtersPage().getAllRowsNameColumn();
await expect(JSON.stringify(listAsc) === JSON.stringify(taskNames)).toEqual(true);
expect(JSON.stringify(listAsc) === JSON.stringify(taskNames)).toEqual(true);
await taskPage.filtersPage().sortByName('DESC');
const listDesc = await taskPage.filtersPage().getAllRowsNameColumn();
taskNames.reverse();
await expect(JSON.stringify(listDesc) === JSON.stringify(taskNames)).toEqual(true);
expect(JSON.stringify(listDesc) === JSON.stringify(taskNames)).toEqual(true);
});
});

View File

@@ -17,14 +17,7 @@
import { browser } from 'protractor';
import {
ApplicationsUtil,
BrowserVisibility,
createApiService,
LoginPage, UserModel,
UsersActions,
Widget
} from '@alfresco/adf-testing';
import { ApplicationsUtil, BrowserVisibility, createApiService, LoginPage, UserModel, UsersActions, Widget } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TaskActionsApi, TasksApi } from '@alfresco/js-api';
@@ -32,7 +25,6 @@ import CONSTANTS = require('../../util/constants');
import Task = require('../../models/APS/Task');
describe('Start Task - Task App', () => {
const app = browser.params.resources.Files.SIMPLE_APP_WITH_USER_FORM;
const loginPage = new LoginPage();
@@ -64,7 +56,7 @@ describe('Start Task - Task App', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
afterEach( async () => {
afterEach(async () => {
await navigationBarPage.clickLogoutButton();
});
@@ -81,7 +73,7 @@ describe('Start Task - Task App', () => {
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
await taskPage.taskDetails().checkAttachFormButtonIsEnabled();
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
});
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => {
@@ -95,7 +87,7 @@ describe('Start Task - Task App', () => {
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow('Completed standalone task');
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + 'Completed standalone task' + ' completed');
expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + 'Completed standalone task' + ' completed');
await taskPage.formFields().noFormIsDisplayed();
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
@@ -139,7 +131,7 @@ describe('Start Task - Task App', () => {
await taskPage.formFields().noFormIsDisplayed();
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
expect(await taskDetails.getNoFormMessage()).toEqual('No forms attached');
});
it('[C329799] Form actions are enabled in assigned task', async () => {
@@ -164,8 +156,8 @@ describe('Start Task - Task App', () => {
await widget.textWidget().isWidgetVisible(app.form_fields.form_fieldId);
await widget.textWidget().setValue(app.form_fields.form_fieldId, 'value');
await expect(await taskPage.formFields().isSaveFormButtonEnabled()).toEqual(true);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isSaveFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await taskPage.formFields().completeForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
@@ -173,9 +165,9 @@ describe('Start Task - Task App', () => {
await taskPage.tasksListPage().selectRow(taskName);
await taskPage.formFields().checkFormIsDisplayed();
await expect(await widget.textWidget().getFieldValue(app.form_fields.form_fieldId)).toEqual('value');
expect(await widget.textWidget().getFieldValue(app.form_fields.form_fieldId)).toEqual('value');
await BrowserVisibility.waitUntilElementIsNotVisible(await taskPage.formFields().saveButton);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
});
});

View File

@@ -83,7 +83,7 @@ describe('Start Task - Custom App', () => {
await taskDetails.clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(
assigneeUserModel.email
);
@@ -135,7 +135,7 @@ describe('Start Task - Custom App', () => {
await taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
await expect(await taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
expect(await taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
it('[C263949] Should be possible to save filled form', async () => {
@@ -182,7 +182,7 @@ describe('Start Task - Custom App', () => {
await taskPage.checkTaskTitle(tasks[5]);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
expect(await taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
});
it('Attach a file', async () => {

View File

@@ -15,14 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
StringUtil,
TaskUtil,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, StringUtil, TaskUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { FileModel } from '../../models/ACS/file.model';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -89,8 +82,9 @@ describe('Start Task - Task App', () => {
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 taskDetails.selectActivityTab();
const firstComment = 'comm1';
@@ -115,7 +109,7 @@ describe('Start Task - Task App', () => {
await task.clickCancelButton();
await taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
await expect(await taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
expect(await taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
it('[C260423] Should be possible to save filled form', async () => {
@@ -153,7 +147,7 @@ describe('Start Task - Task App', () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[5]);
await taskPage.tasksListPage().selectRow(tasks[5]);
await taskPage.checkTaskTitle(tasks[5]);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
expect(await taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
});
it('Attach a file', async () => {

View File

@@ -15,14 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
StartProcessPage,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, StartProcessPage, UserModel, UsersActions } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from './../pages/process-services.page';
import { ProcessFiltersPage } from './../pages/process-filters.page';
@@ -35,7 +28,6 @@ import CONSTANTS = require('../../util/constants');
import { AdminGroupsApi } from '@alfresco/js-api';
describe('Task Assignee', () => {
const app = browser.params.resources.Files.TEST_ASSIGNEE;
const loginPage = new LoginPage();
@@ -54,18 +46,20 @@ describe('Task Assignee', () => {
const adminGroupsApi = new AdminGroupsApi(apiService.getInstance());
describe('Candidate User Assignee', () => {
let user: UserModel;
beforeAll(async () => {
await apiService.loginWithProfile('admin');
user = await usersActions.createUser(new UserModel({
firstName: app.candidate.firstName,
lastName: app.candidate.lastName
}));
user = await usersActions.createUser(
new UserModel({
firstName: app.candidate.firstName,
lastName: app.candidate.lastName
})
);
try {// creates group if not available
try {
// creates group if not available
await adminGroupsApi.createNewGroup({
name: app.candidateGroup,
tenantId: user.tenantId,
@@ -94,7 +88,7 @@ describe('Task Assignee', () => {
const name = 'sample-process-one';
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await expect(await processListPage.isProcessListDisplayed()).toEqual(true);
expect(await processListPage.isProcessListDisplayed()).toEqual(true);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.startProcess(name, app.processNames[0]);
@@ -132,30 +126,28 @@ describe('Task Assignee', () => {
candidate1 = await usersActions.createUser(new UserModel({ tenantId: user.tenantId }));
candidate2 = await usersActions.createUser(new UserModel({ tenantId: user.tenantId }));
const adminGroup = await adminGroupsApi.createNewGroup(
{ name: app.adminGroup, tenantId: user.tenantId }
);
const adminGroup = await adminGroupsApi.createNewGroup({ name: app.adminGroup, tenantId: user.tenantId });
await adminGroupsApi.addGroupMember(adminGroup.id, user.id);
await adminGroupsApi.addGroupCapabilities(adminGroup.id, { capabilities: app.adminCapabilities });
const candidateGroup = await adminGroupsApi.createNewGroup(
{ name: app.candidateGroup, tenantId: user.tenantId, type: 1 }
);
const candidateGroup = await adminGroupsApi.createNewGroup({ name: app.candidateGroup, tenantId: user.tenantId, type: 1 });
await adminGroupsApi.addGroupMember(candidateGroup.id, candidate1.id);
await adminGroupsApi.addGroupMember(candidateGroup.id, candidate2.id);
await adminGroupsApi.addGroupMember(candidateGroup.id, user.id);
try {// for creates user if not available
await usersActions.createUser(new UserModel({
tenantId: user.tenantId,
firstName: app.candidate.firstName,
lastName: app.candidate.lastName
}));
} catch (e) {
}
try {
// for creates user if not available
await usersActions.createUser(
new UserModel({
tenantId: user.tenantId,
firstName: app.candidate.firstName,
lastName: app.candidate.lastName
})
);
} catch (e) {}
await apiService.login(user.username, user.password);
const appModel = await applicationsService.importPublishDeployApp(app.file_path, { renewIdmEntries: true });

View File

@@ -87,7 +87,7 @@ describe('Task Audit', () => {
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(taskTaskApp);
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + taskTaskApp + ' completed');
expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + taskTaskApp + ' completed');
await taskPage.taskDetails().clickAuditLogButton();
await FileBrowserUtil.isFileDownloaded(auditLogFile);
@@ -105,7 +105,7 @@ describe('Task Audit', () => {
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(taskCompleteCustomApp);
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + taskCompleteCustomApp + ' completed');
expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + taskCompleteCustomApp + ' completed');
await taskPage.taskDetails().clickAuditLogButton();
await FileBrowserUtil.isFileDownloaded(auditLogFile);

View File

@@ -272,7 +272,7 @@ describe('Task Details - Form', () => {
await widget.tab().clickTabByLabel(tab.tabFieldField);
await widget.textWidget().setValue(widgets.numberOneId, value.displayTab);
await expect(await taskDetailsPage.isCompleteButtonWithFormEnabled()).toEqual(false);
expect(await taskDetailsPage.isCompleteButtonWithFormEnabled()).toEqual(false);
});
it('[C315193] Should be able to complete a standalone task with invisible tab with invalid value for field', async () => {
@@ -371,7 +371,7 @@ describe('Task Details - Form', () => {
await tasksListPage.checkTaskListIsLoaded();
await tasksListPage.selectRow(app.visibilityProcess.taskName);
await expect(await taskDetailsPage.getParentName()).toEqual(app.visibilityProcess.name);
expect(await taskDetailsPage.getParentName()).toEqual(app.visibilityProcess.name);
await widget.tab().checkTabIsDisplayedByLabel(tab.tabWithFields);
await widget.tab().checkTabIsDisplayedByLabel(tab.tabFieldField);
@@ -405,7 +405,7 @@ describe('Task Details - Form', () => {
await tasksListPage.checkTaskListIsLoaded();
await tasksListPage.selectRow(app.taskName);
await expect(await taskDetailsPage.getParentName()).toEqual(app.processName);
expect(await taskDetailsPage.getParentName()).toEqual(app.processName);
await widget.textWidget().isWidgetVisible(app.form_fields.form_fieldId);
await widget.textWidget().setValue(app.form_fields.form_fieldId, 'value');
@@ -413,7 +413,7 @@ describe('Task Details - Form', () => {
await taskPage.formFields().refreshForm();
await widget.textWidget().isWidgetVisible(app.form_fields.form_fieldId);
await expect(await widget.textWidget().getFieldValue(app.form_fields.form_fieldId)).toEqual('');
expect(await widget.textWidget().getFieldValue(app.form_fields.form_fieldId)).toEqual('');
await widget.textWidget().setValue(app.form_fields.form_fieldId, 'value');
await taskPage.taskDetails().saveTaskForm();
@@ -423,7 +423,7 @@ describe('Task Details - Form', () => {
await filtersPage.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await tasksListPage.checkTaskListIsLoaded();
await expect(await widget.textWidget().getFieldValue(app.form_fields.form_fieldId)).toEqual('value');
expect(await widget.textWidget().getFieldValue(app.form_fields.form_fieldId)).toEqual('value');
await taskDetailsPage.clickCompleteFormTask();
});

View File

@@ -64,6 +64,6 @@ describe('Task Details - No form', () => {
await taskPage.taskDetails().waitFormNameEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
const noFormMessage = 'No forms attached';
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
});
});

View File

@@ -90,23 +90,23 @@ describe('Task Details component', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.createTask({ name: tasks[1], description: 'Description', formName: app.formName });
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(taskModel.getDescription());
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(taskModel.getDescription());
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(await taskPage.taskDetails().getDuration()).toEqual('');
expect(await taskPage.taskDetails().getEndDate()).toEqual('');
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
formModel = new FormModel(taskForm);
@@ -119,25 +119,25 @@ describe('Task Details component', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.createTask({ name: tasks[1], description: 'Description', formName: app.formName });
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(taskModel.getDescription());
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(taskModel.getDescription());
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(await taskPage.taskDetails().getDuration()).toEqual('');
expect(await taskPage.taskDetails().getEndDate()).toEqual('');
expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
@@ -153,24 +153,24 @@ describe('Task Details component', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
expect(await taskPage.taskDetails().getDuration()).toEqual('');
expect(await taskPage.taskDetails().getEndDate()).toEqual('');
expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
@@ -185,23 +185,23 @@ describe('Task Details component', () => {
await (await processServices.goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await tasksApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(appModel['definition'].models[1].name);
expect(await taskPage.taskDetails().getDuration()).toEqual('');
expect(await taskPage.taskDetails().getEndDate()).toEqual('');
expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
const taskForm = await taskFormsApi.getTaskForm(allTasks.data[0].id);
@@ -233,17 +233,17 @@ describe('Task Details component', () => {
const taskModel = new TaskModel(allTasks.data[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual(taskModel.getParentTaskId());
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(await taskPage.taskDetails().getDuration()).toEqual('');
expect(await taskPage.taskDetails().getEndDate()).toEqual('');
expect(await taskPage.taskDetails().getParentTaskId()).toEqual(taskModel.getParentTaskId());
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
});
it('[C286707] Should display task details for subtask - Custom App', async () => {
@@ -255,7 +255,7 @@ describe('Task Details component', () => {
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const dialog = await taskPage.clickOnAddChecklistButton();
await dialog.addName(checklistName);
@@ -270,17 +270,17 @@ describe('Task Details component', () => {
const taskModel = new TaskModel(allTasks.data[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(taskModel.getCategory());
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
await expect(await taskPage.taskDetails().getDuration()).toEqual('');
await expect(await taskPage.taskDetails().getEndDate()).toEqual('');
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual(taskModel.getParentTaskId());
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCategory()).toEqual(taskModel.getCategory());
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(await taskPage.taskDetails().getDuration()).toEqual('');
expect(await taskPage.taskDetails().getEndDate()).toEqual('');
expect(await taskPage.taskDetails().getParentTaskId()).toEqual(taskModel.getParentTaskId());
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
});
it('[C286709] Should display task details for completed task - Task App', async () => {
@@ -301,17 +301,17 @@ describe('Task Details component', () => {
const taskModel = new TaskModel(getTaskResponse);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
await expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
await expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
await expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
await expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
await expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
await expect(await taskPage.taskDetails().getDuration()).toEqual(await taskPage.taskDetails().getDuration());
await expect(await taskPage.taskDetails().getEndDate()).toEqual(await taskPage.taskDetails().getEndDate());
await expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
await expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED);
expect(await taskPage.taskDetails().getCreated()).toEqual(format(new Date(taskModel.getCreated()), TASK_DATE_FORMAT));
expect(await taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(await taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(await taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(await taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(await taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(await taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(await taskPage.taskDetails().getDuration()).toEqual(await taskPage.taskDetails().getDuration());
expect(await taskPage.taskDetails().getEndDate()).toEqual(await taskPage.taskDetails().getEndDate());
expect(await taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(await taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED);
});
it('[C260321] Should not be able to edit a completed task details', async () => {

View File

@@ -15,12 +15,7 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage, ModelsActions,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ModelsActions, UserModel, UsersActions } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { ProcessServicesPage } from '../pages/process-services.page';
import { TasksPage } from '../pages/tasks.page';
@@ -80,23 +75,23 @@ describe('Task', () => {
await tasksPage.createTask({ name: 'Test' });
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
});
it('[C260348] Should display task in Complete Tasks List when task is completed', async () => {
@@ -110,23 +105,23 @@ describe('Task', () => {
await task.clickStartButton();
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
await expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
expect(await tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
expect(await taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
});
it('[C260349] Should sort task by name when Name sorting is clicked', async () => {
@@ -145,17 +140,17 @@ describe('Task', () => {
await taskDetailsPage.checkTaskDetailsDisplayed();
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
await tasksPage.clickSortByNameDesc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test1');
await tasksListPage.checkContentIsDisplayed('Test2');
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test3');
@@ -167,6 +162,6 @@ describe('Task', () => {
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
});
});

View File

@@ -97,9 +97,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
});
it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => {
@@ -114,9 +114,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[2].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[2].name);
});
it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => {
@@ -131,9 +131,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
});
it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => {
@@ -148,9 +148,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[2].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[2].name);
});
it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => {
@@ -165,9 +165,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[3].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[3].name);
});
it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => {
@@ -182,9 +182,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
});
it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => {
@@ -199,9 +199,9 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[3].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[3].name);
});
it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => {
@@ -216,8 +216,8 @@ describe('Task Filters Sorting', () => {
await browser.refresh();
await taskFiltersDemoPage.customTaskFilter(newFilter.name).clickTaskFilter();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
await expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
await expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
expect(await tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(await tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
});
});

View File

@@ -15,21 +15,13 @@
* limitations under the License.
*/
import { createApiService,
ApplicationsUtil,
LoginPage,
PaginationPage,
ProcessUtil,
UserModel,
UsersActions
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, PaginationPage, ProcessUtil, UserModel, UsersActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { TasksPage } from '../pages/tasks.page';
import CONSTANTS = require('../../util/constants');
describe('Task List Pagination', () => {
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const taskPage = new TasksPage();
@@ -71,86 +63,86 @@ describe('Task List Pagination', () => {
await loginPage.login(processUserModel.username, processUserModel.password);
});
afterAll( async () => {
afterAll(async () => {
await apiService.loginWithProfile('admin');
await usersActions.deleteTenant(processUserModel.tenantId);
});
it('[C260301] Should display default pagination', async () => {
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.default);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.default);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
});
it('[C260304] Should be possible to set Items per page to 5', async () => {
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.clickOnNextPage();
currentPage++;
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.clickOnNextPage();
currentPage++;
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.clickOnNextPage();
currentPage++;
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
});
it('[C260303] Should be possible to set Items per page to 10', async () => {
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await paginationPage.clickOnNextPage();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
});
it('[C260302] Should be possible to set Items per page to 15', async () => {
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
await paginationPage.clickOnNextPage();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
});
it('[C261006] Should be possible to navigate to a page with page number dropdown', async () => {
@@ -161,37 +153,37 @@ describe('Task List Pagination', () => {
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
currentPage = 2;
await paginationPage.clickOnPageDropdownOption('2');
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
currentPage = 1;
await paginationPage.clickOnPageDropdownOption('1');
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
await expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(await taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});

View File

@@ -72,23 +72,23 @@ describe('Amount Widget', () => {
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.amount_input_id);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await expect(await widget.amountWidget().getAmountFieldLabel(app.FIELD.amount_input_id)).toContain('Amount');
await expect(await widget.amountWidget().getPlaceholder(app.FIELD.amount_input_id)).toContain('Type amount');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.amountWidget().getAmountFieldLabel(app.FIELD.amount_input_id)).toContain('Amount');
expect(await widget.amountWidget().getPlaceholder(app.FIELD.amount_input_id)).toContain('Type amount');
const fieldCurrency = await widget.amountWidget().getAmountFieldCurrency(app.FIELD.amount_input_id);
await expect(fieldCurrency.trim()).toBe('$');
expect(fieldCurrency.trim()).toBe('$');
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4);
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be less than 5`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be less than 5`);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101);
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be greater than 100`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe(`Can't be greater than 100`);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 6);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
});

View File

@@ -71,6 +71,6 @@ describe('Attach Folder widget', () => {
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.upload_button_id);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
});
});

View File

@@ -67,10 +67,10 @@ describe('Checkbox Widget', () => {
it('[C268554] Should be able to set general settings for Checkbox widget ', async () => {
await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, '2');
await expect(await widget.checkboxWidget().getCheckboxLabel()).toContain(app.FIELD.checkbox_label);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.checkboxWidget().getCheckboxLabel()).toContain(app.FIELD.checkbox_label);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_input_id);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C272812] Should be able to set visibility settings for Checkbox widget', async () => {

View File

@@ -67,6 +67,6 @@ describe('Document Template widget', () => {
});
it('[C260406] should check that the template contains assigned file ', async () => {
await expect(await widget.containerWidget().getFieldText(app.form_fields.container_id)).toEqual(app.attached_file);
expect(await widget.containerWidget().getFieldText(app.form_fields.container_id)).toEqual(app.attached_file);
});
});

View File

@@ -15,14 +15,7 @@
* limitations under the License.
*/
import {
createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget, UserModel
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import CONSTANTS = require('../../util/constants');
@@ -74,19 +67,19 @@ describe('Dropdown widget', () => {
});
it('[C269051] Should be possible to set general and options properties for Dropdown widget ', async () => {
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.dropdown().selectOption('Happy');
await expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Happy');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Happy');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await widget.dropdown().selectOption('Choose one');
await expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Choose one');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Choose one');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.dropdown().selectOption('Sad');
await expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Sad');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Sad');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C269052] Should be possible to set visibility properties for Dropdown widget', async () => {

View File

@@ -15,14 +15,7 @@
* limitations under the License.
*/
import {
createApiService,
ApplicationsUtil,
LoginPage,
ProcessUtil,
UsersActions,
Widget, UserModel
} from '@alfresco/adf-testing';
import { createApiService, ApplicationsUtil, LoginPage, ProcessUtil, UsersActions, Widget, UserModel } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/tasks.page';
import { browser } from 'protractor';
import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
@@ -129,18 +122,18 @@ describe('Dynamic Table widget ', () => {
await widget.dynamicTable().clickAddRow(app.FIELD.dynamic_table_id);
await widget.dynamicTable().setDatatableInput('User1');
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User1');
expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User1');
await widget.dynamicTable().clickTableRow(0);
await widget.dynamicTable().clickEditButton();
await widget.dynamicTable().setDatatableInput('User2');
await widget.dynamicTable().clickCancelButton();
await expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User1');
expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User1');
await widget.dynamicTable().clickEditButton();
await widget.dynamicTable().setDatatableInput('User2');
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User2');
expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User2');
await widget.dynamicTable().clickAddRow(app.FIELD.dynamic_table_id);
await widget.dynamicTable().setDatatableInput('User3');
@@ -184,19 +177,19 @@ describe('Dynamic Table widget ', () => {
await widget.dynamicTable().clickAddRow();
await widget.dynamicTable().setDatatableInput('admin', app.CUSTOM_VALIDATOR.FIELD.NAME);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe('Sorry, wrong value. You cannot use "admin".');
expect(await widget.dynamicTable().checkErrorMessage()).toBe('Sorry, wrong value. You cannot use "admin".');
await widget.dynamicTable().setDatatableInput('name', app.CUSTOM_VALIDATOR.FIELD.NAME);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Id' is required.`);
expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Id' is required.`);
await widget.dynamicTable().setDatatableInput('id', app.CUSTOM_VALIDATOR.FIELD.ID);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Number' is required.`);
expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Number' is required.`);
await widget.dynamicTable().setDatatableInput('12', app.CUSTOM_VALIDATOR.FIELD.NUM);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Address' is required.`);
expect(await widget.dynamicTable().checkErrorMessage()).toBe(`Field 'Address' is required.`);
await widget.dynamicTable().setDatatableInput('address', app.CUSTOM_VALIDATOR.FIELD.ADDRESS);
await widget.dynamicTable().clickSaveButton();

View File

@@ -71,7 +71,7 @@ describe('Header widget', async () => {
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.header_id);
await expect(await widget.headerWidget().getFieldLabel(app.FIELD.header_id)).toBe('Header');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await widget.headerWidget().getFieldLabel(app.FIELD.header_id)).toBe('Header');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
});

View File

@@ -71,7 +71,7 @@ describe('Hyperlink widget', () => {
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.hyperlink_id);
await expect(await widget.hyperlink().getFieldLabel(app.FIELD.hyperlink_id)).toBe('Hyperlink');
await expect(await widget.hyperlink().getFieldText(app.FIELD.hyperlink_id)).toBe('https://www.google.com/');
expect(await widget.hyperlink().getFieldLabel(app.FIELD.hyperlink_id)).toBe('Hyperlink');
expect(await widget.hyperlink().getFieldText(app.FIELD.hyperlink_id)).toBe('https://www.google.com/');
});
});

View File

@@ -68,29 +68,29 @@ describe('Multi-line Widget', () => {
it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => {
const label = await widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple);
await expect(label).toBe('multiSimple*');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(label).toBe('multiSimple*');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
const placeHolder = await widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple);
await expect(placeHolder).toBe('Type something...');
expect(placeHolder).toBe('Type something...');
await widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C268184] Should be able to set advanced properties for Multi-line Text Widget', async () => {
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'A');
await expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toContain('Enter at least 4 characters');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toContain('Enter at least 4 characters');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAAAAAAAAA');
await expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toContain('Enter no more than 10 characters');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toContain('Enter no more than 10 characters');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAA');
await widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
await widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, '3');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiRegexp)).toContain('Enter a different value');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiRegexp)).toContain('Enter a different value');
await widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, 'TE');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C268232] Should be able to set visibility properties for Multi-line Text Widget', async () => {

View File

@@ -67,12 +67,12 @@ describe('Number widget', () => {
});
it('[C269111] Should be able to set general properties for Number Widget', async () => {
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await expect(await widget.numberWidget().getNumberFieldLabel(app.FIELD.number_general)).toContain('Number General');
await expect(await widget.numberWidget().getPlaceholder(app.FIELD.number_general)).toContain('Type a number');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.numberWidget().getNumberFieldLabel(app.FIELD.number_general)).toContain('Number General');
expect(await widget.numberWidget().getPlaceholder(app.FIELD.number_general)).toContain('Type a number');
await widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C274702] Should be able to set advanced and visibility properties for Number Widget', async () => {
@@ -83,16 +83,16 @@ describe('Number widget', () => {
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible);
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2);
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be less than 3`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be less than 3`);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101);
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be greater than 100`);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe(`Can't be greater than 100`);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 4);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
});

View File

@@ -22,8 +22,16 @@ import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import CONSTANTS = require('../../util/constants');
import { AdminGroupsApi } from '@alfresco/js-api';
describe('People and Group widget', () => {
interface AppGroupUser {
firstName: string;
lastName: string;
}
interface AppSubGroup {
name: string;
}
describe('People and Group widget', () => {
const app = browser.params.resources.Files.MORE_WIDGETS;
const loginPage = new LoginPage();
@@ -59,7 +67,7 @@ describe('People and Group widget', () => {
const name = 'group visibility task';
const groupVisibilityForm = app.ADD_GROUP_VISIBILITY;
await taskPage.createTask({ name, formName: groupVisibilityForm.formName });
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.formFields().checkWidgetIsHidden(groupVisibilityForm.FIELD.widget_id);
await widget.checkboxWidget().clickCheckboxInput(groupVisibilityForm.FIELD.checkbox_id);
@@ -67,8 +75,8 @@ describe('People and Group widget', () => {
await widget.groupWidget().insertGroup(groupVisibilityForm.FIELD.widget_id, groupVisibilityForm.searchTerm);
await widget.groupWidget().checkDropDownListIsDisplayed();
const suggestions = await widget.groupWidget().getDropDownList();
await expect(suggestions.sort()).toEqual(['Heros', 'Users']);
const suggestions = (await widget.groupWidget().getDropDownList()).sort((a, b) => a.localeCompare(b));
expect(suggestions).toEqual(['Heros', 'Users']);
await widget.groupWidget().selectGroupFromDropDown('Users');
await taskPage.taskDetails().clickCompleteFormTask();
});
@@ -77,7 +85,7 @@ describe('People and Group widget', () => {
const name = 'group widget - subgroup restriction';
const subgroupFrom = app.ADD_GROUP_AND_SUBGROUP_RESTRICTION;
await taskPage.createTask({ name, formName: subgroupFrom.formName });
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.formFields().checkWidgetIsHidden(subgroupFrom.FIELD.widget_id);
await widget.checkboxWidget().clickCheckboxInput(subgroupFrom.FIELD.checkbox_id);
@@ -85,8 +93,8 @@ describe('People and Group widget', () => {
await widget.groupWidget().insertGroup(subgroupFrom.FIELD.widget_id, subgroupFrom.searchTerm);
await widget.groupWidget().checkDropDownListIsDisplayed();
const suggestions = await widget.groupWidget().getDropDownList();
await expect(suggestions.sort()).toEqual(getSubGroupsName().sort());
const suggestions = (await widget.groupWidget().getDropDownList()).sort((a, b) => a.localeCompare(b));
expect(suggestions).toEqual(getSubGroupsName());
await widget.groupWidget().selectGroupFromDropDown(getSubGroupsName()[0]);
await taskPage.taskDetails().clickCompleteFormTask();
@@ -95,14 +103,14 @@ describe('People and Group widget', () => {
await taskPage.tasksListPage().selectRow(name);
await widget.groupWidget().checkGroupFieldIsDisplayed();
await expect(await widget.groupWidget().getFieldValue(subgroupFrom.FIELD.widget_id)).toBe('Heros');
expect(await widget.groupWidget().getFieldValue(subgroupFrom.FIELD.widget_id)).toBe('Heros');
});
it('[C275714] Add people widget - group restrictions', async () => {
const name = 'people widget - group restrictions';
const peopleWidget = app.ADD_PEOPLE_AND_GROUP_RESTRICTION;
await taskPage.createTask({ name, formName: peopleWidget.formName });
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.formFields().checkWidgetIsHidden(peopleWidget.FIELD.widget_id);
await widget.checkboxWidget().clickCheckboxInput(peopleWidget.FIELD.checkbox_id);
@@ -110,26 +118,39 @@ describe('People and Group widget', () => {
await widget.peopleWidget().insertUser(peopleWidget.FIELD.widget_id, peopleWidget.searchTerm);
await widget.peopleWidget().checkDropDownListIsDisplayed();
const suggestions = await widget.peopleWidget().getDropDownList();
await expect(suggestions.sort()).toEqual(getGroupMembers().sort());
const suggestions = (await widget.peopleWidget().getDropDownList()).sort((a, b) => a.localeCompare(b));
expect(suggestions).toEqual(getGroupMembers());
await widget.peopleWidget().selectUserFromDropDown(getGroupMembers()[0]);
await taskPage.taskDetails().clickCompleteFormTask();
});
/**
* Create group and users
*
* @param tenantId tenant id
*/
async function createGroupAndUsers(tenantId: number) {
await apiService.loginWithProfile('admin');
const userCreated = await Promise.all(app.groupUser.map(usersToCreate =>
usersActions.createUser(new UserModel({
tenantId,
firstName: usersToCreate.firstName,
lastName: usersToCreate.lastName
}))
));
const userCreated = await Promise.all(
app.groupUser.map((usersToCreate: AppGroupUser) =>
usersActions.createUser(
new UserModel({
tenantId,
firstName: usersToCreate.firstName,
lastName: usersToCreate.lastName
})
)
)
);
const subgroupUser = await usersActions.createUser(new UserModel({
tenantId, firstName: app.subGroupUser.firstName, lastName: app.subGroupUser.lastName
}));
const subgroupUser = await usersActions.createUser(
new UserModel({
tenantId,
firstName: app.subGroupUser.firstName,
lastName: app.subGroupUser.lastName
})
);
const group = await adminGroupsApi.createNewGroup({
name: app.group.name,
@@ -139,24 +160,37 @@ describe('People and Group widget', () => {
await Promise.all(userCreated.map((userToAddGroup: UserModel) => adminGroupsApi.addGroupMember(group.id, userToAddGroup.id)));
const subgroups: any[] = await Promise.all(getSubGroupsName().map((name) =>
adminGroupsApi.createNewGroup({
name,
tenantId,
type: 1,
parentGroupId: group.id
})
));
const subgroups = await Promise.all(
getSubGroupsName().map((name) =>
adminGroupsApi.createNewGroup({
name,
tenantId,
type: 1,
parentGroupId: group.id
})
)
);
await Promise.all(subgroups.map((subgroup) => adminGroupsApi.addGroupMember(subgroup.id, subgroupUser.id)));
}
function getSubGroupsName() {
return app.group.subgroup.map(subgroup => subgroup.name);
/**
* Get subgroups name
*
* @returns list of subgroup names
*/
function getSubGroupsName(): string[] {
return app.group.subgroup.map((subgroup: AppSubGroup) => subgroup.name).sort((a: string, b: string) => a.localeCompare(b));
}
function getGroupMembers() {
return app.groupUser.map(groupUser => `${groupUser.firstName} ${groupUser.lastName}`);
/**
* Get group members
*
* @returns list of group member full names
*/
function getGroupMembers(): string[] {
return app.groupUser
.map((groupUser: AppGroupUser) => `${groupUser.firstName} ${groupUser.lastName}`)
.sort((a: string, b: string) => a.localeCompare(b));
}
});

View File

@@ -72,11 +72,11 @@ describe('Radio Buttons Widget', () => {
it('[C274704] Should be able to set visibility properties for Radio Button widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.radio_buttons_id);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await expect(await widget.radioWidget().getRadioWidgetLabel(app.FIELD.radio_buttons_id)).toContain('Radio posts');
expect(await widget.radioWidget().getRadioWidgetLabel(app.FIELD.radio_buttons_id)).toContain('Radio posts');
await widget.radioWidget().selectOption(app.FIELD.radio_buttons_id, 1);
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
});

View File

@@ -68,43 +68,43 @@ describe('Text widget', () => {
it('[C268157] Should be able to set general properties for Text widget', async () => {
const label = await widget.textWidget().getFieldLabel(app.FIELD.simpleText);
await expect(label).toBe('textSimple*');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(label).toBe('textSimple*');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
const placeHolder = await widget.textWidget().getFieldPlaceHolder(app.FIELD.simpleText);
await expect(placeHolder).toBe('Type something...');
expect(placeHolder).toBe('Type something...');
await widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C268170] Min-max length properties', async () => {
await widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
await widget.textWidget().setValue(app.FIELD.textMinMax, 'A');
await expect(await widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toContain('Enter at least 4 characters');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toContain('Enter at least 4 characters');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.textWidget().setValue(app.FIELD.textMinMax, '01234567890');
await expect(await widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toContain('Enter no more than 10 characters');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toContain('Enter no more than 10 characters');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await widget.textWidget().setValue(app.FIELD.textMinMax, '123456789');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C268171] Input mask reversed checkbox properties', async () => {
await widget.textWidget().setValue(app.FIELD.textMask, '18951523');
await expect(await widget.textWidget().getFieldValue(app.FIELD.textMask)).toBe('1895-1523');
expect(await widget.textWidget().getFieldValue(app.FIELD.textMask)).toBe('1895-1523');
});
it('[C268171] Input mask reversed checkbox properties', async () => {
await widget.textWidget().setValue(app.FIELD.textMaskReversed, '1234567899');
await expect(await widget.textWidget().getFieldValue(app.FIELD.textMaskReversed)).toBe('3456-7899');
expect(await widget.textWidget().getFieldValue(app.FIELD.textMaskReversed)).toBe('3456-7899');
});
it('[C268177] Should be able to set Regex Pattern property for Text widget', async () => {
await widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
await widget.textWidget().setValue(app.FIELD.textRegexp, 'T');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await expect(await widget.textWidget().getErrorMessage(app.FIELD.textRegexp)).toContain('Enter a different value');
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
expect(await widget.textWidget().getErrorMessage(app.FIELD.textRegexp)).toContain('Enter a different value');
await widget.textWidget().setValue(app.FIELD.textRegexp, 'TE');
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
});
it('[C274712] Should be able to set visibility properties for Text widget ', async () => {