Disable control flow e2e ADF (#4954)

* update project script possible different JS-API

* first commit no controll flow

* second commit no controll flow

* third commit no controll flow

* 4 commit no controll flow

* 5 commit no controll flow

* 6 commit no controll flow

* 7 commit no controll flow

* 8 commit no controll flow

* 9 commit no controll flow

* 10 commit no controll flow

* 11 commit no controll flow

* 12 commit no controll flow

* 13 commit no controll flow

* 14 commit no controll flow

* 15 commit no controll flow

* 16 commit no controll flow

* 17 commit no controll flow

* 18 commit no controll flow

* 19 commit no controll flow

* 20 commit no controll flow

* remove wdpromise, protractor promise and deferred promises

* - fixed some incorrect “expect” calls
- fixed some matchers
- removed “return this;” when not needed
- added a few more await-s

* forgot a file

* fix some failing tests

* replaced driver calls with browser calls and enabled back waitForAngular

* fix rightClick methods and hopefully some tests

* fix settings-component

* some more fixes for core and content tests

* try to fix some more issues

* linting

* revert some changes, allowing download on headless chrome won’t work with multiple browser instances

* fixes for Search tests

* try to remove some wait calls

* fix build

* increase allScriptsTimeout and try another protractor and web driver version

* improve navigation methods

* some fixes for notification history and login sso

* forgot a space

* fix packages and enable some screenshots

* navigation bar fixes

* fix some test

* some fixes for notification history and navigation bar
use correct visibility method in attachFileWidget test

* fix searching and another fix for navigation

* try solve sso login

* some more fixes

* refactor async forEach into for..of

* try fix for search tests

* resolve rebabse problems

* remove install

* fix lint

* fix core e2e

* fix core e2e

* fix core e2e

* fix ps tests

* fix some tests

* fix core e2e

* fix core e2e

* fix core

* fix some issues PS

* fix core

* fix core

* fix some ps test

* fix rebase issues

* remove save

* fix url regressed after rebase

* fix url regressed after rebase

* fix ps and core

* fix lint

* more parallel e2e ps

* fix some ps cloud test

* some cloud fix

* fix lint

* fix some test

* remove files to be ignored

* out-tsc

* improve one cs test

* fix candidate base app

* fix ps test

* remove click function

* clean methods alrady present in browser action

* try ugly wait

* move wait

* remove duplicate call

* remove underscore

* fix after review

* fix imports

* minor cosmetic fixes

* fix comments test
This commit is contained in:
Eugenio Romano
2019-08-17 14:32:02 +02:00
committed by GitHub
parent 4f3cf669f2
commit 83412bb9b6
328 changed files with 17653 additions and 18793 deletions

View File

@@ -41,7 +41,7 @@ describe('Modify applications', () => {
const modelActions = new ModelsActions();
let firstApp, appVersionToBeDeleted;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -60,117 +60,111 @@ describe('Modify applications', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
it('[C260198] Should the app be displayed on dashboard when is deployed on APS', () => {
navigationBarPage.navigateToProcessServicesPage();
it('[C260198] Should the app be displayed on dashboard when is deployed on APS', async () => {
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await processServicesPage.checkApsContainer();
expect(processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
expect(processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
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);
});
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', () => {
navigationBarPage.navigateToProcessServicesPage();
it('[C260213] Should a new version of the app be displayed on dashboard when is replaced by importing another app in APS', async () => {
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await processServicesPage.checkApsContainer();
expect(processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.UNIT);
expect(processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.BLUE);
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
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);
browser.controlFlow().execute(() => {
return apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, firstApp.id);
});
await apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, firstApp.id);
navigationBarPage.clickHomeButton();
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await processServicesPage.checkApsContainer();
expect(processServicesPage.getAppIconType(app.title)).toEqual(CONSTANTS.APP_ICON.FAVORITE);
expect(processServicesPage.getBackgroundColor(app.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
expect(processServicesPage.getDescription(app.title)).toEqual(app.description);
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);
});
it('[C260220] Should the app not be displayed on dashboard after it was deleted in APS', async () => {
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed(app.title);
await processServicesPage.checkAppIsDisplayed(app.title);
browser.controlFlow().execute(() => {
return modelActions.deleteEntireModel(this.alfrescoJsApi, firstApp.id);
});
await modelActions.deleteEntireModel(this.alfrescoJsApi, firstApp.id);
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
navigationBarPage.clickHomeButton();
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.checkAppIsNotDisplayed(app.title);
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsNotDisplayed(app.title);
});
it('[C260215] Should the penultimate version of an app be displayed on dashboard when the last version is deleted in APS', async () => {
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
browser.controlFlow().execute(() => {
return apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, appVersionToBeDeleted.id);
});
await apps.importNewVersionAppDefinitionPublishDeployApp(this.alfrescoJsApi, replacingApp.file_location, appVersionToBeDeleted.id);
navigationBarPage.clickHomeButton();
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.getBackgroundColor(appToBeDeleted.title);
await processServicesPage.getBackgroundColor(appToBeDeleted.title);
expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
await expect(await processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.GREY);
browser.controlFlow().execute(async () => {
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
await apps.publishDeployApp(this.alfrescoJsApi, appVersionToBeDeleted.id);
});
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
await modelActions.deleteVersionModel(this.alfrescoJsApi, appVersionToBeDeleted.id);
await apps.publishDeployApp(this.alfrescoJsApi, appVersionToBeDeleted.id);
navigationBarPage.clickHomeButton();
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
await processServicesPage.checkApsContainer();
await processServicesPage.checkAppIsDisplayed(appToBeDeleted.title);
await 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';
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
expect(processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE);
expect(processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.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);
const appDefinition = {'appDefinition': {'id': appVersionToBeDeleted.id, 'name': appToBeDeleted.title,
'description': newDescription, 'definition': {'models': [firstApp.definition.models[0]], 'theme': 'theme-4',
'icon': 'glyphicon-user'}}, 'publish': true};
const appDefinition = {
'appDefinition': {
'id': appVersionToBeDeleted.id, 'name': appToBeDeleted.title,
'description': newDescription, 'definition': {
'models': [firstApp.definition.models[0]], 'theme': 'theme-4',
'icon': 'glyphicon-user'
}
}, 'publish': true
};
browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
});
await this.alfrescoJsApi.activiti.appsApi.updateAppDefinition(appVersionToBeDeleted.id, appDefinition);
navigationBarPage.clickHomeButton();
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
expect(processServicesPage.getDescription(appToBeDeleted.title)).toEqual(newDescription);
expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.RED);
expect(processServicesPage.getAppIconType(appToBeDeleted.title)).toEqual(CONSTANTS.APP_ICON.USER);
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);
});
});

View File

@@ -45,7 +45,7 @@ describe('Start Task - Task App', () => {
const pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name });
const appFields = app.form_fields;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
const apps = new AppsActions();
@@ -64,10 +64,9 @@ describe('Start Task - Task App', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
afterAll(async (done) => {
afterAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
@@ -77,28 +76,26 @@ describe('Start Task - Task App', () => {
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C274690] Should be able to open a file attached to a start form', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
it('[C274690] Should be able to open a file attached to a start form', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName('View file')
.addForm(app.formName)
.clickStartButton();
const newTask = await taskPage.createNewTask();
await newTask.addName('View file');
await newTask.addForm(app.formName);
await newTask.clickStartButton();
widget.attachFileWidget().attachFile(appFields.attachFile_id, browser.params.testConfig.main.rootPath + pdfFile.location);
widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
await widget.attachFileWidget().attachFile(appFields.attachFile_id, browser.params.testConfig.main.rootPath + pdfFile.location);
await widget.attachFileWidget().checkFileIsAttached(appFields.attachFile_id, pdfFile.name);
widget.attachFileWidget().viewFile(pdfFile.name);
viewerPage.checkFileContent('1', pdfFile.firstPageText);
viewerPage.checkCloseButtonIsDisplayed();
viewerPage.clickCloseButton();
taskPage.tasksListPage().checkContentIsDisplayed('View file');
await widget.attachFileWidget().viewFile(pdfFile.name);
await viewerPage.checkFileContent('1', pdfFile.firstPageText);
await viewerPage.checkCloseButtonIsDisplayed();
await viewerPage.clickCloseButton();
await taskPage.tasksListPage().checkContentIsDisplayed('View file');
});
});

View File

@@ -50,7 +50,7 @@ describe('Attach Form Component', () => {
formFieldValue: 'Test value'
};
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
@@ -76,64 +76,63 @@ describe('Attach Form Component', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C280047] Should be able to view the attach-form component after creating a standalone task', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
it('[C280047] Should be able to view the attach-form component after creating a standalone task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().selectRow(testNames.taskName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().selectRow(testNames.taskName);
attachFormPage.checkNoFormMessageIsDisplayed();
attachFormPage.checkAttachFormButtonIsDisplayed();
attachFormPage.checkCompleteButtonIsDisplayed();
await attachFormPage.checkNoFormMessageIsDisplayed();
await attachFormPage.checkAttachFormButtonIsDisplayed();
await attachFormPage.checkCompleteButtonIsDisplayed();
});
it('[C280048] Should be able to view the attach-form component after clicking cancel button', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
it('[C280048] Should be able to view the attach-form component after clicking cancel button', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().selectRow(testNames.taskName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().selectRow(testNames.taskName);
attachFormPage.clickAttachFormButton();
attachFormPage.checkDefaultFormTitleIsDisplayed(testNames.formTitle);
attachFormPage.checkFormDropdownIsDisplayed();
attachFormPage.checkCancelButtonIsDisplayed();
attachFormPage.checkAttachFormButtonIsDisabled();
attachFormPage.clickAttachFormDropdown();
attachFormPage.selectAttachFormOption(testNames.formName);
await attachFormPage.clickAttachFormButton();
await attachFormPage.checkDefaultFormTitleIsDisplayed(testNames.formTitle);
await attachFormPage.checkFormDropdownIsDisplayed();
await attachFormPage.checkCancelButtonIsDisplayed();
await attachFormPage.checkAttachFormButtonIsDisabled();
await attachFormPage.clickAttachFormDropdown();
await attachFormPage.selectAttachFormOption(testNames.formName);
formFields.checkWidgetIsReadOnlyMode(testNames.widgetTitle);
await formFields.checkWidgetIsReadOnlyMode(testNames.widgetTitle);
attachFormPage.clickCancelButton();
attachFormPage.checkAttachFormButtonIsDisplayed();
await attachFormPage.clickCancelButton();
await attachFormPage.checkAttachFormButtonIsDisplayed();
});
it('[C280017] Should be able to attach a form on a standalone task and complete', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
it('[C280017] Should be able to attach a form on a standalone task and complete', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().selectRow(testNames.taskName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().selectRow(testNames.taskName);
attachFormPage.clickAttachFormButton();
attachFormPage.clickAttachFormDropdown();
attachFormPage.selectAttachFormOption(testNames.formName);
attachFormPage.clickAttachFormButton();
await attachFormPage.clickAttachFormButton();
await attachFormPage.clickAttachFormDropdown();
await attachFormPage.selectAttachFormOption(testNames.formName);
await attachFormPage.clickAttachFormButton();
formFields.setFieldValue(by.id, formTextField, testNames.formFieldValue);
formFields.completeForm();
await formFields.setFieldValue(by.id, formTextField, testNames.formFieldValue);
await formFields.completeForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(testNames.taskName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(testNames.taskName);
expect(formFields.getFieldValue(formTextField)).toEqual(testNames.formFieldValue);
await expect(await formFields.getFieldValue(formTextField)).toEqual(testNames.formFieldValue);
});
});

View File

@@ -48,7 +48,7 @@ describe('Checklist component', () => {
const removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist'];
const hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild'];
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -75,124 +75,137 @@ describe('Checklist component', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async (done) => {
navigationBarPage.clickHomeButton();
navigationBarPage.navigateToProcessServicesPage();
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
done();
beforeEach(async () => {
await navigationBarPage.clickHomeButton();
await navigationBarPage.navigateToProcessServicesPage();
await (await processServices.goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
it('[C279976] Should no checklist be created when no title is typed', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C279976] Should no checklist be created when no title is typed', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.clickOnAddChecklistButton().clickCreateChecklistButton();
taskPage.checkChecklistDialogIsNotDisplayed().checkNoChecklistIsDisplayed();
expect(taskPage.getNumberOfChecklists()).toEqual('0');
await (await taskPage.clickOnAddChecklistButton()).clickCreateChecklistButton();
await taskPage.checkChecklistDialogIsNotDisplayed();
await taskPage.checkNoChecklistIsDisplayed();
await expect(await taskPage.getNumberOfChecklists()).toEqual('0');
});
it('[C279975] Should no checklist be created when clicking on Cancel button on checklist dialog', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C279975] Should no checklist be created when clicking on Cancel button on checklist dialog', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.clickOnAddChecklistButton().addName(checklists[0]).clickCancelButton();
taskPage.checkChecklistDialogIsNotDisplayed().checkNoChecklistIsDisplayed();
expect(taskPage.getNumberOfChecklists()).toEqual('0');
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[0]);
await checklistDialog.clickCancelButton();
await taskPage.checkChecklistDialogIsNotDisplayed();
await taskPage.checkNoChecklistIsDisplayed();
await expect(await taskPage.getNumberOfChecklists()).toEqual('0');
});
it('[C261025] Should Checklist dialog be displayed when clicking on add checklist button', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C261025] Should Checklist dialog be displayed when clicking on add checklist button', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.clickOnAddChecklistButton();
taskPage.checkChecklistDialogIsDisplayed();
expect(taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
expect(taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
taskPage.usingCheckListDialog().checkAddChecklistButtonIsEnabled().checkCancelButtonIsEnabled();
taskPage.usingCheckListDialog().clickCancelButton();
await (await taskPage.clickOnAddChecklistButton());
await taskPage.checkChecklistDialogIsDisplayed();
await expect(await taskPage.usingCheckListDialog().getDialogTitle()).toEqual('New Check');
await expect(await taskPage.usingCheckListDialog().getNameFieldPlaceholder()).toEqual('Name');
await taskPage.usingCheckListDialog().checkAddChecklistButtonIsEnabled();
await checklistDialog.checkCancelButtonIsEnabled();
await taskPage.usingCheckListDialog().clickCancelButton();
});
it('[C261026] Should Checklist number increase when a new checklist is added', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
taskPage.tasksListPage().selectRow(tasks[1]);
it('[C261026] Should Checklist number increase when a new checklist is added', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
await taskPage.tasksListPage().selectRow(tasks[1]);
taskPage.clickOnAddChecklistButton().addName(checklists[2]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(checklists[2]);
expect(taskPage.getNumberOfChecklists()).toEqual('1');
await (await taskPage.clickOnAddChecklistButton()).addName(checklists[2]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(checklists[2]);
await expect(await taskPage.getNumberOfChecklists()).toEqual('1');
taskPage.clickOnAddChecklistButton().addName(checklists[3]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(checklists[3]);
taskPage.checkChecklistIsDisplayed(checklists[2]);
expect(taskPage.getNumberOfChecklists()).toEqual('2');
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');
});
it('[C279980] Should checklist be removed when clicking on remove button', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
taskPage.tasksListPage().selectRow(tasks[2]);
it('[C279980] Should checklist be removed when clicking on remove button', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
await taskPage.tasksListPage().selectRow(tasks[2]);
taskPage.clickOnAddChecklistButton();
taskPage.checkChecklistDialogIsDisplayed();
checklistDialog.addName(removeChecklist[0]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
await (await taskPage.clickOnAddChecklistButton());
await taskPage.checkChecklistDialogIsDisplayed();
await checklistDialog.addName(removeChecklist[0]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
taskPage.clickOnAddChecklistButton().addName(removeChecklist[1]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(removeChecklist[1]);
await (await taskPage.clickOnAddChecklistButton()).addName(removeChecklist[1]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(removeChecklist[1]);
taskPage.removeChecklists(removeChecklist[1]);
taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
taskPage.checkChecklistIsNotDisplayed(removeChecklist[1]);
await taskPage.removeChecklists(removeChecklist[1]);
await taskPage.checkChecklistIsDisplayed(removeChecklist[0]);
await taskPage.checkChecklistIsNotDisplayed(removeChecklist[1]);
});
it('[C261027] Should not be able to remove a completed Checklist when clicking on remove button', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
taskPage.tasksListPage().selectRow(tasks[3]);
it('[C261027] Should not be able to remove a completed Checklist when clicking on remove button', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
await taskPage.tasksListPage().selectRow(tasks[3]);
taskPage.clickOnAddChecklistButton().addName(removeChecklist[2]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
await (await taskPage.clickOnAddChecklistButton()).addName(removeChecklist[2]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
taskPage.clickOnAddChecklistButton().addName(removeChecklist[3]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
await (await taskPage.clickOnAddChecklistButton()).addName(removeChecklist[3]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
taskPage.tasksListPage().selectRow(removeChecklist[3]);
taskPage.completeTaskNoForm();
taskPage.tasksListPage().checkContentIsNotDisplayed(removeChecklist[3]);
await taskPage.tasksListPage().selectRow(removeChecklist[3]);
await taskPage.completeTaskNoForm();
await taskPage.tasksListPage().checkContentIsNotDisplayed(removeChecklist[3]);
taskPage.tasksListPage().selectRow(tasks[3]);
taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
expect(taskPage.getNumberOfChecklists()).toEqual('2');
await taskPage.tasksListPage().selectRow(tasks[3]);
await taskPage.checkChecklistIsDisplayed(removeChecklist[2]);
await taskPage.checkChecklistIsDisplayed(removeChecklist[3]);
await expect(await taskPage.getNumberOfChecklists()).toEqual('2');
taskPage.checkChecklistsRemoveButtonIsNotDisplayed(removeChecklist[3]);
await taskPage.checkChecklistsRemoveButtonIsNotDisplayed(removeChecklist[3]);
});
it('[C261028] Should all checklists of a task be completed when the task is completed', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
taskPage.tasksListPage().selectRow(tasks[4]);
it('[C261028] Should all checklists of a task be completed when the task is completed', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await taskPage.tasksListPage().selectRow(tasks[4]);
taskPage.clickOnAddChecklistButton().addName(hierarchyChecklist[0]).clickCreateChecklistButton();
taskPage.clickOnAddChecklistButton().addName(hierarchyChecklist[1]).clickCreateChecklistButton();
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[0]);
await checklistDialog.clickCreateChecklistButton();
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[1]);
await checklistDialog.clickCreateChecklistButton();
taskPage.tasksListPage().selectRow(hierarchyChecklist[0]);
taskPage.clickOnAddChecklistButton().addName(hierarchyChecklist[2]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(hierarchyChecklist[2]);
await taskPage.tasksListPage().selectRow(hierarchyChecklist[0]);
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[2]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(hierarchyChecklist[2]);
taskPage.tasksListPage().selectRow(hierarchyChecklist[1]);
taskPage.clickOnAddChecklistButton().addName(hierarchyChecklist[3]).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(hierarchyChecklist[3]);
await taskPage.tasksListPage().selectRow(hierarchyChecklist[1]);
await (await taskPage.clickOnAddChecklistButton()).addName(hierarchyChecklist[3]);
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(hierarchyChecklist[3]);
taskPage.tasksListPage().selectRow(tasks[4]);
taskPage.completeTaskNoForm();
await taskPage.tasksListPage().selectRow(tasks[4]);
await taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[0]);
taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[1]);
taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[2]);
taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[3]);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[0]);
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[1]);
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[2]);
await taskPage.tasksListPage().checkContentIsDisplayed(hierarchyChecklist[3]);
});
});

View File

@@ -35,117 +35,95 @@ describe('Comment component for Processes', () => {
const navigationBarPage = new NavigationBarPage();
const app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
let user, tenantId, appId, processInstanceId, comment, taskComment, addedComment;
let user, tenantId, appId, processInstanceId, addedComment;
beforeAll(async(done) => {
this.alfrescoJsApi = new AlfrescoApi({
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
const apps = new AppsActions();
const users = new UsersActions();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
user = await users.createTenantAndUser(this.alfrescoJsApi);
tenantId = user.tenantId;
await this.alfrescoJsApi.login(user.email, user.password);
const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
appId = importedApp.id;
const processWithComment = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Comment APS');
processInstanceId = processWithComment.id;
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async(done) => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
const apps = new AppsActions();
const users = new UsersActions();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
user = await users.createTenantAndUser(this.alfrescoJsApi);
tenantId = user.tenantId;
await this.alfrescoJsApi.login(user.email, user.password);
const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
appId = importedApp.id;
const processWithComment = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Comment APS');
processInstanceId = processWithComment.id;
await loginPage.loginToProcessServicesUsingUserModel(user);
});
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C260464] Should be able to add a comment on APS and check on ADF', () => {
browser.controlFlow().execute(async() => {
comment = {message: 'HELLO'};
it('[C260464] Should be able to add a comment on APS and check on ADF', async () => {
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment({ message: 'HELLO' }, processInstanceId);
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment(comment, processInstanceId);
});
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment APS');
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Comment APS');
addedComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
browser.controlFlow().execute(async() => {
addedComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true});
await commentsPage.checkUserIconIsDisplayed(0);
commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
expect(commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
expect(commentsPage.getUserName(0)).toEqual(addedComment.data[0].createdBy.firstName + ' ' + addedComment.data[0].createdBy.lastName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('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)/);
});
it('[C260465] Should not be able to view process comment on included task', () => {
browser.controlFlow().execute(async() => {
comment = {message: 'GOODBYE'};
it('[C260465] Should not be able to view process comment on included task', async () => {
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment({ message: 'GOODBYE' }, processInstanceId);
await this.alfrescoJsApi.activiti.commentsApi.addProcessInstanceComment(comment, processInstanceId);
});
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment APS');
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Comment APS');
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
browser.controlFlow().execute(async() => {
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId});
const taskId = taskQuery.data[0].id;
const taskId = taskQuery.data[0].id;
const taskComments = await this.alfrescoJsApi.activiti.commentsApi.getTaskComments(taskId, {'latestFirst': true});
expect(taskComments.total).toEqual(0);
});
const taskComments = await this.alfrescoJsApi.activiti.commentsApi.getTaskComments(taskId, { 'latestFirst': true });
await expect(await taskComments.total).toEqual(0);
});
it('[C260466] Should be able to display comments from Task on the related Process', () => {
browser.controlFlow().execute(async() => {
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId});
it('[C260466] Should be able to display comments from Task on the related Process', async () => {
const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({ processInstanceId: processInstanceId });
const taskId = taskQuery.data[0].id;
const taskId = taskQuery.data[0].id;
taskComment = {message: 'Task Comment'};
await this.alfrescoJsApi.activiti.taskApi.addTaskComment({ message: 'Task Comment' }, taskId);
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, taskId);
});
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment APS');
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Comment APS');
const addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
browser.controlFlow().execute(async() => {
const addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true});
await commentsPage.checkUserIconIsDisplayed(0);
commentsPage.checkUserIconIsDisplayed(0);
expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
expect(commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
expect(commentsPage.getUserName(0)).toEqual(addedTaskComment.data[0].createdBy.firstName + ' ' + addedTaskComment.data[0].createdBy.lastName);
expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
});
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
await 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)/);
});
});

View File

@@ -45,7 +45,7 @@ describe('Comment component for Processes', () => {
multiple_users: 'Test Comment multiple users'
};
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
@@ -70,106 +70,97 @@ describe('Comment component for Processes', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C260237] Should not be able to add a comment on a completed task', () => {
browser.controlFlow().execute(async () => {
const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskName.completed_task });
it('[C260237] Should not be able to add a comment on a completed task', async () => {
const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskName.completed_task });
const taskId = newTask.id;
const taskId = newTask.id;
this.alfrescoJsApi.activiti.taskActionsApi.completeTask(taskId);
});
await this.alfrescoJsApi.activiti.taskActionsApi.completeTask(taskId);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(taskName.completed_task);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(taskName.completed_task);
commentsPage.checkCommentInputIsNotDisplayed();
await commentsPage.checkCommentInputIsNotDisplayed();
});
it('[C212864] Should be able to add multiple comments on a single task using different users', () => {
browser.controlFlow().execute(async () => {
const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskName.multiple_users });
it('[C212864] Should be able to add multiple comments on a single task using different users', async () => {
const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskName.multiple_users });
newTaskId = newTask.id;
newTaskId = newTask.id;
await this.alfrescoJsApi.activiti.taskApi.involveUser(newTaskId, { email: secondUser.email });
await this.alfrescoJsApi.activiti.taskApi.involveUser(newTaskId, { email: secondUser.email });
const taskComment = { message: 'Task Comment' };
const secondTaskComment = { message: 'Second Task Comment' };
const taskComment = { message: 'Task Comment' };
const secondTaskComment = { message: 'Second Task Comment' };
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, newTaskId);
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(secondTaskComment, newTaskId);
});
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, newTaskId);
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(secondTaskComment, newTaskId);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().selectRow(taskName.multiple_users);
taskPage.taskDetails().selectActivityTab();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().selectRow(taskName.multiple_users);
await taskPage.taskDetails().selectActivityTab();
browser.controlFlow().execute(async () => {
const totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, { 'latestFirst': true });
const totalCommentsLatest = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, { 'latestFirst': true });
const thirdTaskComment = { message: 'Third Task Comment' };
const thirdTaskComment = { message: 'Third Task Comment' };
await commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.checkUserIconIsDisplayed(1);
await commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.checkUserIconIsDisplayed(1);
await expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalComments.total + ')');
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalCommentsLatest.total + ')');
await expect(commentsPage.getMessage(0)).toEqual(totalComments.data[0].message);
await expect(commentsPage.getMessage(1)).toEqual(totalComments.data[1].message);
await expect(await commentsPage.getMessage(0)).toEqual(totalCommentsLatest.data[0].message);
await expect(await commentsPage.getMessage(1)).toEqual(totalCommentsLatest.data[1].message);
await expect(commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName);
await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
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);
await expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(commentsPage.getTime(1)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(await commentsPage.getTime(1)).toMatch(/(ago|few)/);
await loginPage.loginToProcessServicesUsingUserModel(secondUser);
await loginPage.loginToProcessServicesUsingUserModel(secondUser);
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(thirdTaskComment, newTaskId);
});
await this.alfrescoJsApi.activiti.taskApi.addTaskComment(thirdTaskComment, newTaskId);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage().selectRow(taskName.multiple_users);
taskPage.taskDetails().selectActivityTab();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().selectRow(taskName.multiple_users);
await taskPage.taskDetails().selectActivityTab();
browser.controlFlow().execute(async () => {
const totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, { 'latestFirst': true });
const totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, { 'latestFirst': true });
await commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.checkUserIconIsDisplayed(1);
await commentsPage.checkUserIconIsDisplayed(2);
await commentsPage.checkUserIconIsDisplayed(0);
await commentsPage.checkUserIconIsDisplayed(1);
await commentsPage.checkUserIconIsDisplayed(2);
await expect(commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalComments.total + ')');
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalComments.total + ')');
await expect(commentsPage.getMessage(0)).toEqual(totalComments.data[0].message);
await expect(commentsPage.getMessage(1)).toEqual(totalComments.data[1].message);
await expect(commentsPage.getMessage(2)).toEqual(totalComments.data[2].message);
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);
await expect(commentsPage.getUserName(0)).toEqual(totalComments.data[0].createdBy.firstName + ' ' + totalComments.data[0].createdBy.lastName);
await expect(commentsPage.getUserName(1)).toEqual(totalComments.data[1].createdBy.firstName + ' ' + totalComments.data[1].createdBy.lastName);
await expect(commentsPage.getUserName(2)).toEqual(totalComments.data[2].createdBy.firstName + ' ' + totalComments.data[2].createdBy.lastName);
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);
await expect(commentsPage.getTime(0)).toMatch(/(ago|few)/);
await expect(commentsPage.getTime(1)).toMatch(/(ago|few)/);
await expect(commentsPage.getTime(2)).toMatch(/(ago|few)/);
});
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)/);
});
});

View File

@@ -51,16 +51,15 @@ describe('Sorting for process filters', () => {
completed_least_recently: 'Completed - Least recently'
};
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
const users = new UsersActions();
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
@@ -75,298 +74,240 @@ describe('Sorting for process filters', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C260476] Should be able to create a filter on APS for running processes - Oldest first and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' }
});
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.running_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'running' }
});
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
filtersPage.goToFilter(processFilter.running_old_first);
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
});
expect(processesQuery.data[0].name).toEqual('Process 1');
expect(processesQuery.data[1].name).toEqual('Process 2');
expect(processesQuery.data[2].name).toEqual('Process 3');
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.running_old_first);
await filtersPage.goToFilter(processFilter.running_old_first);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual('Process 1');
await expect(processesQuery.data[1].name).toEqual('Process 2');
await expect(processesQuery.data[2].name).toEqual('Process 3');
});
it('[C260477] Should be able to create a filter on APS for completed processes - Oldest first and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' }
});
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'completed' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.completed_old_first);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
filtersPage.goToFilter(processFilter.completed_old_first);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
});
expect(processesQuery.data[0].name).toEqual('Process 1');
expect(processesQuery.data[1].name).toEqual('Process 2');
expect(processesQuery.data[2].name).toEqual('Process 3');
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed_old_first);
await filtersPage.goToFilter(processFilter.completed_old_first);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual('Process 1');
await expect(processesQuery.data[1].name).toEqual('Process 2');
await expect(processesQuery.data[2].name).toEqual('Process 3');
});
it('[C260478] Should be able to create a filter on APS for all processes - Oldest first and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' }
});
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6');
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.all_old_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-asc', 'name': '', 'state': 'all' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.all_old_first);
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6');
filtersPage.goToFilter(processFilter.all_old_first);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
});
expect(processesQuery.data[0].name).toEqual('Process 1');
expect(processesQuery.data[1].name).toEqual('Process 2');
expect(processesQuery.data[2].name).toEqual('Process 3');
expect(processesQuery.data[3].name).toEqual('Process 4');
expect(processesQuery.data[4].name).toEqual('Process 5');
expect(processesQuery.data[5].name).toEqual('Process 6');
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.all_old_first);
await filtersPage.goToFilter(processFilter.all_old_first);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-asc'
});
await expect(processesQuery.data[0].name).toEqual('Process 1');
await expect(processesQuery.data[1].name).toEqual('Process 2');
await expect(processesQuery.data[2].name).toEqual('Process 3');
await expect(processesQuery.data[3].name).toEqual('Process 4');
await expect(processesQuery.data[4].name).toEqual('Process 5');
await expect(processesQuery.data[5].name).toEqual('Process 6');
});
it('[C260479] Should be able to create a filter on APS for running processes - Newest first and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.running_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.running_new_first);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
filtersPage.goToFilter(processFilter.running_new_first);
await processFiltersPage.checkFilterIsDisplayed(processFilter.running_new_first);
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
});
expect(processesQuery.data[0].name).toEqual('Process 3');
expect(processesQuery.data[1].name).toEqual('Process 2');
expect(processesQuery.data[2].name).toEqual('Process 1');
await filtersPage.goToFilter(processFilter.running_new_first);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'running', 'sort': 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual('Process 3');
await expect(processesQuery.data[1].name).toEqual('Process 2');
await expect(processesQuery.data[2].name).toEqual('Process 1');
});
it('[C260480] Should be able to create a filter on APS for completed processes - Newest first and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' }
});
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'completed' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.completed_new_first);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
filtersPage.goToFilter(processFilter.completed_new_first);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
});
expect(processesQuery.data[0].name).toEqual('Process 3');
expect(processesQuery.data[1].name).toEqual('Process 2');
expect(processesQuery.data[2].name).toEqual('Process 1');
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed_new_first);
await filtersPage.goToFilter(processFilter.completed_new_first);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual('Process 3');
await expect(processesQuery.data[1].name).toEqual('Process 2');
await expect(processesQuery.data[2].name).toEqual('Process 1');
});
it('[C260481] Should be able to create a filter on APS for all processes - Newest first and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' }
});
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6');
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.all_new_first, 'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'all' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.all_new_first);
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6');
filtersPage.goToFilter(processFilter.all_new_first);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
});
expect(processesQuery.data[0].name).toEqual('Process 6');
expect(processesQuery.data[1].name).toEqual('Process 5');
expect(processesQuery.data[2].name).toEqual('Process 4');
expect(processesQuery.data[3].name).toEqual('Process 3');
expect(processesQuery.data[4].name).toEqual('Process 2');
expect(processesQuery.data[5].name).toEqual('Process 1');
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.all_new_first);
await filtersPage.goToFilter(processFilter.all_new_first);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'all', 'sort': 'created-desc'
});
await expect(processesQuery.data[0].name).toEqual('Process 6');
await expect(processesQuery.data[1].name).toEqual('Process 5');
await expect(processesQuery.data[2].name).toEqual('Process 4');
await expect(processesQuery.data[3].name).toEqual('Process 3');
await expect(processesQuery.data[4].name).toEqual('Process 2');
await expect(processesQuery.data[5].name).toEqual('Process 1');
});
it('[C272815] Should be able to create a filter on APS for completed processes - Completed most recently and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random',
'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' }
});
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_most_recently, 'icon': 'glyphicon-random',
'filter': { 'sort': 'ended-asc', 'name': '', 'state': 'completed' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.completed_most_recently);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
filtersPage.goToFilter(processFilter.completed_most_recently);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
});
expect(processesQuery.data[0].name).toEqual('Process 2');
expect(processesQuery.data[1].name).toEqual('Process 1');
expect(processesQuery.data[2].name).toEqual('Process 3');
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed_most_recently);
await filtersPage.goToFilter(processFilter.completed_most_recently);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-asc'
});
await expect(processesQuery.data[0].name).toEqual('Process 2');
await expect(processesQuery.data[1].name).toEqual('Process 1');
await expect(processesQuery.data[2].name).toEqual('Process 3');
});
it('[C272816] Should be able to create a filter on APS for completed processes - Completed least recently and check on ADF', async () => {
await browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random',
'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' }
});
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null, 'name': processFilter.completed_least_recently, 'icon': 'glyphicon-random',
'filter': { 'sort': 'ended-desc', 'name': '', 'state': 'completed' }
});
navigationBarPage
.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1');
const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2');
const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3');
processFiltersPage.checkFilterIsDisplayed(processFilter.completed_least_recently);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id);
await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(thirdProc.id);
filtersPage.goToFilter(processFilter.completed_least_recently);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await browser.controlFlow().execute(async () => {
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
});
expect(processesQuery.data[0].name).toEqual('Process 3');
expect(processesQuery.data[1].name).toEqual('Process 1');
expect(processesQuery.data[2].name).toEqual('Process 2');
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed_least_recently);
await filtersPage.goToFilter(processFilter.completed_least_recently);
processesQuery = await this.alfrescoJsApi.activiti.processApi.getProcessInstances({
'processDefinitionId': null, 'appDefinitionId': null, 'state': 'completed', 'sort': 'ended-desc'
});
await expect(processesQuery.data[0].name).toEqual('Process 3');
await expect(processesQuery.data[1].name).toEqual('Process 1');
await expect(processesQuery.data[2].name).toEqual('Process 2');
});
});

View File

@@ -47,7 +47,7 @@ describe('New Process Filters', () => {
deleted: 'To delete'
};
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -65,161 +65,132 @@ describe('New Process Filters', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C279965] Should be able to view default filters on ADF', async () => {
navigationBarPage.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.running);
processFiltersPage.checkFilterIsDisplayed(processFilter.all);
processFiltersPage.checkFilterIsDisplayed(processFilter.completed);
await processFiltersPage.checkFilterIsDisplayed(processFilter.running);
await processFiltersPage.checkFilterIsDisplayed(processFilter.all);
await processFiltersPage.checkFilterIsDisplayed(processFilter.completed);
});
it('[C260473] Should be able to create a new filter on APS and display it on ADF', async () => {
browser.controlFlow().execute(async () => {
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.new_filter,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
return customProcessFilter;
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.new_filter,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
navigationBarPage.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
filterId = customProcessFilter.id;
processFiltersPage.checkFilterIsDisplayed(processFilter.new_filter);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_filter);
});
it('[C286450] Should display the process filter icon when a custom filter is added', async () => {
browser.controlFlow().execute(async () => {
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.new_icon,
'icon': 'glyphicon-cloud',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
return customProcessFilter;
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.new_icon,
'icon': 'glyphicon-cloud',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
filterId = customProcessFilter.id;
processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processServiceTabBarPage.clickSettingsButton();
appSettingsToggles.enableProcessFiltersIcon();
processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
expect(processFiltersPage.getFilterIcon(processFilter.new_icon)).toEqual('cloud');
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableProcessFiltersIcon();
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.checkFilterIsDisplayed(processFilter.new_icon);
await expect(await processFiltersPage.getFilterIcon(processFilter.new_icon)).toEqual('cloud');
});
it('[C260474] Should be able to edit a filter on APS and check it on ADF', async () => {
browser.controlFlow().execute(() => {
return this.alfrescoJsApi.activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
'appId': null,
'name': processFilter.edited,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
this.alfrescoJsApi.activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
'appId': null,
'name': processFilter.edited,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
navigationBarPage.navigateToProcessServicesPage()
.goToTaskApp()
.clickProcessButton();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.edited);
await processFiltersPage.checkFilterIsDisplayed(processFilter.edited);
});
it('[C286451] Should display changes on a process filter when this filter icon is edited', async () => {
browser.controlFlow().execute(async () => {
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.edit_icon,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
return customProcessFilter;
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.edit_icon,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
filterId = customProcessFilter.id;
processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
browser.controlFlow().execute(() => {
return this.alfrescoJsApi.activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
'appId': null,
'name': processFilter.edit_icon,
'icon': 'glyphicon-cloud',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await this.alfrescoJsApi.activiti.userFiltersApi.updateUserProcessInstanceFilter(filterId, {
'appId': null,
'name': processFilter.edit_icon,
'icon': 'glyphicon-cloud',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
processServiceTabBarPage.clickSettingsButton();
appSettingsToggles.enableProcessFiltersIcon();
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableProcessFiltersIcon();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
expect(processFiltersPage.getFilterIcon(processFilter.edit_icon)).toEqual('cloud');
await processFiltersPage.checkFilterIsDisplayed(processFilter.edit_icon);
await expect(await processFiltersPage.getFilterIcon(processFilter.edit_icon)).toEqual('cloud');
});
it('[C286452] Should display process filter icons only when showIcon property is set on true', async () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
processFiltersPage.checkFilterHasNoIcon(processFilter.all);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterHasNoIcon(processFilter.all);
processServiceTabBarPage.clickSettingsButton();
appSettingsToggles.enableProcessFiltersIcon();
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableProcessFiltersIcon();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.checkFilterIsDisplayed(processFilter.all);
expect(processFiltersPage.getFilterIcon(processFilter.all)).toEqual('dashboard');
await processFiltersPage.checkFilterIsDisplayed(processFilter.all);
await expect(await processFiltersPage.getFilterIcon(processFilter.all)).toEqual('dashboard');
});
it('[C260475] Should be able to delete a filter on APS and check it on ADF', async () => {
browser.controlFlow().execute(async () => {
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.deleted,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
filterId = customProcessFilter.id;
return customProcessFilter;
customProcessFilter = await this.alfrescoJsApi.activiti.userFiltersApi.createUserProcessInstanceFilter({
'appId': null,
'name': processFilter.deleted,
'icon': 'glyphicon-random',
'filter': { 'sort': 'created-desc', 'name': '', 'state': 'running' }
});
browser.controlFlow().execute(() => {
return this.alfrescoJsApi.activiti.userFiltersApi.deleteUserProcessInstanceFilter(filterId);
});
filterId = customProcessFilter.id;
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserProcessInstanceFilter(filterId);
processFiltersPage.checkFilterIsNotDisplayed(processFilter.deleted);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkFilterIsNotDisplayed(processFilter.deleted);
});
});

View File

@@ -72,7 +72,7 @@ describe('Start Task - Custom App', () => {
default: '25'
};
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const appsRuntime = new AppsRuntimeActions();
const users = new UsersActions();
@@ -122,375 +122,380 @@ describe('Start Task - Custom App', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
describe('', () => {
beforeEach(async () => {
navigationBarPage.clickTaskListButton();
taskListSinglePage.clickResetButton();
await navigationBarPage.clickTaskListButton();
await taskListSinglePage.clickResetButton();
});
it('[C286362] Default pagination settings on task list', () => {
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
});
expect(paginationPage.getCurrentPage()).toEqual('Page 1');
expect(paginationPage.getTotalPages()).toEqual('of 1');
paginationPage.checkPageSelectorIsNotDisplayed();
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await expect(await paginationPage.getCurrentPage()).toEqual('Page 1');
await expect(await paginationPage.getTotalPages()).toEqual('of 1');
await paginationPage.checkPageSelectorIsNotDisplayed();
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C286367] 20 Items per page', function () {
taskListSinglePage.typeItemsPerPage(itemsPerPage.twentyValue);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
it('[C286367] 20 Items per page', async () => {
await taskListSinglePage.typeItemsPerPage(itemsPerPage.twentyValue);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
});
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C286365] 5 Items per page', function () {
taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
it('[C286365] 5 Items per page', async () => {
await taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
});
paginationPage.clickOnNextPage();
await paginationPage.clickOnNextPage();
currentPage++;
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await paginationPage.clickOnNextPage();
currentPage++;
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
});
paginationPage.clickOnNextPage();
await paginationPage.clickOnNextPage();
currentPage++;
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
});
});
it('[C286364] 10 Items per page', function () {
it('[C286364] 10 Items per page', async () => {
currentPage = 1;
taskListSinglePage.typeItemsPerPage(itemsPerPage.tenValue);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(0, 10))).toEqual(true);
await taskListSinglePage.typeItemsPerPage(itemsPerPage.tenValue);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(0, 10))).toEqual(true);
});
paginationPage.clickOnNextPage();
await paginationPage.clickOnNextPage();
currentPage++;
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(10, 20))).toEqual(true);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(10, 20))).toEqual(true);
});
});
it('[C286363] 15 Items per page', function () {
it('[C286363] 15 Items per page', async () => {
currentPage = 1;
taskListSinglePage.typeItemsPerPage(itemsPerPage.fifteenValue);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * currentPage + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(0, 15))).toEqual(true);
await taskListSinglePage.typeItemsPerPage(itemsPerPage.fifteenValue);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(0, 15))).toEqual(true);
});
currentPage++;
paginationPage.clickOnNextPage();
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
await paginationPage.clickOnNextPage();
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
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);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
});
});
it('[C286366] Pagination is not displayed when no task is displayed', function () {
taskListSinglePage.typeAppId(secondAppRuntime.id);
expect(taskListSinglePage.getAppId()).toEqual(secondAppRuntime.id.toString());
it('[C286366] Pagination is not displayed when no task is displayed', async () => {
await taskListSinglePage.typeAppId(secondAppRuntime.id);
await expect(await taskListSinglePage.getAppId()).toEqual(secondAppRuntime.id.toString());
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286406] Invalid values for items per page', function () {
taskListSinglePage.typeItemsPerPage('0').clickAppId();
expect(taskListSinglePage.getItemsPerPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
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');
});
it('[C286404] Navigate using page field', function () {
it('[C286404] Navigate using page field', async () => {
currentPage = 1;
taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue);
taskListSinglePage.typePage(currentPage);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual(totalNrOfPages);
paginationPage.checkPageSelectorIsDisplayed();
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
await taskListSinglePage.typeItemsPerPage(itemsPerPage.fiveValue);
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(0, 5))).toEqual(true);
});
currentPage++;
taskListSinglePage.typePage(currentPage);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual(totalNrOfPages);
paginationPage.checkPageSelectorIsDisplayed();
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(5, 10))).toEqual(true);
});
currentPage++;
taskListSinglePage.typePage(currentPage);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual(totalNrOfPages);
paginationPage.checkPageSelectorIsDisplayed();
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(10, 15))).toEqual(true);
});
currentPage++;
taskListSinglePage.typePage(currentPage);
taskListSinglePage.taskList().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual(totalNrOfPages);
paginationPage.checkPageSelectorIsDisplayed();
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
await taskListSinglePage.typePage(currentPage);
await taskListSinglePage.taskList().getDataTable().waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
await expect(await paginationPage.getTotalPages()).toEqual(totalNrOfPages);
await paginationPage.checkPageSelectorIsDisplayed();
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName.slice(15, 20))).toEqual(true);
});
});
it('[C286405] Type invalid values to page field', function () {
taskListSinglePage.typePage('0').clickAppId();
expect(taskListSinglePage.getPageFieldErrorMessage()).toEqual('Value must be greater than or equal to 1');
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');
taskListSinglePage.clickResetButton();
taskListSinglePage.typePage('2');
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
await taskListSinglePage.clickResetButton();
await taskListSinglePage.typePage('2');
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286413] Task is displayed when typing into dueAfter field a date before the tasks due date', function () {
taskListSinglePage.typeDueAfter(beforeDate);
taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
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().checkContentIsDisplayed(paginationTasksName[0]);
await 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', function () {
taskListSinglePage.typeDueAfter(afterDate);
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
it('[C286414] Task is not displayed when typing into dueAfter field a date after the task due date', async () => {
await taskListSinglePage.typeDueAfter(afterDate);
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286415] Task is not displayed when typing into dueAfter field the same date as tasks due date', function () {
taskListSinglePage.typeDueAfter(currentDate);
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
it('[C286415] Task is not displayed when typing into dueAfter field the same date as tasks due date', async () => {
await taskListSinglePage.typeDueAfter(currentDate);
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286424] Task is not displayed when typing into dueBefore field a date before the tasks due date', function () {
taskListSinglePage.typeDueBefore(beforeDate);
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
it('[C286424] Task is not displayed when typing into dueBefore field a date before the tasks due date', async () => {
await taskListSinglePage.typeDueBefore(beforeDate);
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286425] Task is displayed when typing into dueBefore field a date after the task due date', function () {
taskListSinglePage.typeDueBefore(afterDate);
taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
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().checkContentIsDisplayed(paginationTasksName[0]);
await 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', function () {
taskListSinglePage.typeDueBefore(currentDate);
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
it('[C286426] Task is not displayed when typing into dueBefore field the same date as tasks due date', async () => {
await taskListSinglePage.typeDueBefore(currentDate);
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286428] Task is not displayed when typing into dueAfter field a date before the task due date and into dueBefore a date before task due date', function () {
taskListSinglePage.typeDueBefore(beforeDate);
taskListSinglePage.typeDueAfter(beforeDate);
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
it('[C286428] Task is not displayed when typing into dueAfter field a date before the task due date and into dueBefore a date before task due date', async () => {
await taskListSinglePage.typeDueBefore(beforeDate);
await taskListSinglePage.typeDueAfter(beforeDate);
await taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
});
it('[C286427] Task is displayed when typing into dueAfter field a date before the tasks due date and into dueBefore a date after', function () {
taskListSinglePage.typeDueBefore(afterDate);
taskListSinglePage.typeDueAfter(beforeDate);
taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
it('[C286427] Task is displayed when typing into dueAfter field a date before the tasks due date and into dueBefore a date after', async () => {
await taskListSinglePage.typeDueBefore(afterDate);
await taskListSinglePage.typeDueAfter(beforeDate);
await taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[0]);
await 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', function () {
taskListSinglePage.typeDueBefore(afterDate);
taskListSinglePage.typeDueAfter(afterDate);
taskListSinglePage.paginationPage().checkPaginationIsNotDisplayed();
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();
});
it('[C280515] Should be able to see only the tasks of a specific app when typing the apps id in the appId field', () => {
taskListSinglePage.typeAppId(appRuntime.id);
expect(taskListSinglePage.getAppId()).toEqual(appRuntime.id.toString());
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);
await expect(await taskListSinglePage.getAppId()).toEqual(appRuntime.id.toString());
taskListSinglePage.taskList().checkContentIsDisplayed(app.taskName);
taskListSinglePage.taskList().checkContentIsDisplayed(app.taskName);
taskListSinglePage.taskList().checkContentIsNotDisplayed(paginationTasksName[13]);
await taskListSinglePage.taskList().checkContentIsDisplayed(app.taskName);
await taskListSinglePage.taskList().checkContentIsDisplayed(app.taskName);
await taskListSinglePage.taskList().checkContentIsNotDisplayed(paginationTasksName[13]);
});
it('[C280569] Should be able to see No tasks found when typing an invalid appId', () => {
taskListSinglePage.typeAppId(invalidAppId);
expect(taskListSinglePage.getAppId()).toEqual(invalidAppId.toString());
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(taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
await 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', () => {
taskListSinglePage.typeTaskName(paginationTasksName[13]);
expect(taskListSinglePage.getTaskName()).toEqual(paginationTasksName[13]);
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]);
taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[13]);
taskListSinglePage.taskList().getRowsDisplayedWithSameName(paginationTasksName[13]).then((list) => {
expect(list.length).toEqual(2);
await taskListSinglePage.taskList().checkContentIsDisplayed(paginationTasksName[13]);
await expect((await taskListSinglePage.taskList().getRowsDisplayedWithSameName(paginationTasksName[13])).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);
await 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 expect(await taskListSinglePage.getTaskId()).toEqual(taskWithDueDate.id);
await taskListSinglePage.taskList().checkContentIsDisplayed(taskWithDueDate.name);
await 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);
await 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 () => {
await taskListSinglePage.selectState('Completed');
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name);
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name);
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[2].name);
await 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 () => {
await taskListSinglePage.selectState('Active');
await taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[0].name);
await taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[1].name);
await taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[2].name);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
});
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(20);
});
it('[C280571] Should be able to see No tasks found when typing a task name that does not exist', () => {
taskListSinglePage.typeTaskName(invalidName);
expect(taskListSinglePage.getTaskName()).toEqual(invalidName);
it('[C286598] Should be able to see all tasks when choosing All from state drop down', async () => {
await taskListSinglePage.selectState('All');
expect(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', () => {
taskListSinglePage.typeTaskId(taskWithDueDate.id);
expect(taskListSinglePage.getTaskId()).toEqual(taskWithDueDate.id);
taskListSinglePage.taskList().checkContentIsDisplayed(taskWithDueDate.name);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
});
it('[C280630] Should be able to see No tasks found when typing an invalid taskId', () => {
taskListSinglePage.typeTaskId(invalidTaskId);
expect(taskListSinglePage.getTaskId()).toEqual(invalidTaskId);
expect(taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
it('[C286589] Should be able to see only completed tasks when choosing Completed from state drop down', () => {
taskListSinglePage.selectState('Completed');
taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name);
taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name);
taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[2].name);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(3);
});
it('[C286597] Should be able to see only running tasks when choosing Active from state drop down', () => {
taskListSinglePage.selectState('Active');
taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[0].name);
taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[1].name);
taskListSinglePage.taskList().checkContentIsNotDisplayed(completedTasks[2].name);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name);
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name);
await taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[2].name);
await taskListSinglePage.taskList().getAllRowsNameColumn().then(async (list) => {
await expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
});
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(20);
});
it('[C286598] Should be able to see all tasks when choosing All from state drop down', () => {
taskListSinglePage.selectState('All');
taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[0].name);
taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[1].name);
taskListSinglePage.taskList().checkContentIsDisplayed(completedTasks[2].name);
taskListSinglePage.taskList().getAllRowsNameColumn().then(function (list) {
expect(Util.arrayContainsArray(list, allTasksName)).toEqual(true);
});
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(23);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(23);
});
});
it('[C286622] Should be able to see only tasks that are part of a specific process when processDefinitionId is set', () => {
it('[C286622] Should be able to see only tasks that are part of a specific process when processDefinitionId is set', async () => {
const processDefinitionIds = [processDefinitionId.processDefinitionId, processDefinitionId.processDefinitionId,
processDefinitionId.processDefinitionId, processDefinitionId.processDefinitionId];
navigationBarPage.clickTaskListButton();
taskListSinglePage.clickResetButton();
await navigationBarPage.clickTaskListButton();
await taskListSinglePage.clickResetButton();
taskListSinglePage.typeProcessDefinitionId(processDefinitionId.processDefinitionId);
await taskListSinglePage.typeProcessDefinitionId(processDefinitionId.processDefinitionId);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(4);
taskListSinglePage.getAllProcessDefinitionIds().then(function (list) {
expect(Util.arrayContainsArray(list, processDefinitionIds)).toEqual(true);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(4);
await taskListSinglePage.getAllProcessDefinitionIds().then(async (list) => {
await expect(Util.arrayContainsArray(list, processDefinitionIds)).toEqual(true);
});
});
it('[C286623] Should be able to see No tasks found when typing an invalid processDefinitionId', () => {
navigationBarPage.clickTaskListButton();
taskListSinglePage.clickResetButton();
it('[C286623] Should be able to see No tasks found when typing an invalid processDefinitionId', async () => {
await navigationBarPage.clickTaskListButton();
await taskListSinglePage.clickResetButton();
taskListSinglePage.typeProcessDefinitionId(invalidTaskId);
await taskListSinglePage.typeProcessDefinitionId(invalidTaskId);
expect(taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
await 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', () => {
it('[C286622] Should be able to see only tasks that are part of a specific process when processInstanceId is set', async () => {
const processInstanceIds = [processDefinitionId.id];
navigationBarPage.clickTaskListButton();
taskListSinglePage.clickResetButton();
await navigationBarPage.clickTaskListButton();
await taskListSinglePage.clickResetButton();
taskListSinglePage.typeProcessInstanceId(processDefinitionId.id);
expect(taskListSinglePage.getProcessInstanceId()).toEqual(processDefinitionId.id);
await taskListSinglePage.typeProcessInstanceId(processDefinitionId.id);
await expect(await taskListSinglePage.getProcessInstanceId()).toEqual(processDefinitionId.id);
expect(taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
taskListSinglePage.getAllProcessInstanceIds().then(function (list) {
expect(Util.arrayContainsArray(list, processInstanceIds)).toEqual(true);
await expect(await taskListSinglePage.taskList().getDataTable().numberOfRows()).toBe(1);
await taskListSinglePage.getAllProcessInstanceIds().then(async (list) => {
await expect(Util.arrayContainsArray(list, processInstanceIds)).toEqual(true);
});
});
it('[C286623] Should be able to see No tasks found when typing an invalid processInstanceId', () => {
navigationBarPage.clickTaskListButton();
taskListSinglePage.clickResetButton();
it('[C286623] Should be able to see No tasks found when typing an invalid processInstanceId', async () => {
await navigationBarPage.clickTaskListButton();
await taskListSinglePage.clickResetButton();
taskListSinglePage.typeProcessInstanceId(invalidTaskId);
expect(taskListSinglePage.getProcessInstanceId()).toEqual(invalidTaskId);
await taskListSinglePage.typeProcessInstanceId(invalidTaskId);
await expect(await taskListSinglePage.getProcessInstanceId()).toEqual(invalidTaskId);
expect(taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
await expect(await taskListSinglePage.taskList().getNoTasksFoundMessage()).toEqual(noTasksFoundMessage);
});
});

View File

@@ -37,7 +37,7 @@ describe('Dynamic Table', () => {
const widget = new Widget();
let user, tenantId, appId, apps, users;
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
@@ -52,15 +52,13 @@ describe('Dynamic Table', () => {
tenantId = user.tenantId;
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
describe('Date Picker', () => {
@@ -77,67 +75,63 @@ describe('Dynamic Table', () => {
const currentDate = DateUtil.formatDate('DD-MM-YYYY');
const rowPosition = 0;
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(user.email, user.password);
const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
appId = importedApp.id;
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(user.email, user.password);
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
done();
});
beforeEach(() => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
beforeEach(async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
});
it('[C286277] Should have a datepicker and a mask for DateTime field', () => {
widget.dynamicTable().clickAddButton();
widget.dynamicTable().clickColumnDateTime();
it('[C286277] Should have a datepicker and a mask for DateTime field', async () => {
await widget.dynamicTable().clickAddButton();
await widget.dynamicTable().clickColumnDateTime();
expect(widget.dynamicTable().addRandomStringOnDateTime(randomText.wrongDateTime)).toBe('');
await expect(await widget.dynamicTable().addRandomStringOnDateTime(randomText.wrongDateTime)).toBe('');
});
it('[C286279] Should be able to save row with Date field', () => {
widget.dynamicTable().clickAddButton();
widget.dynamicTable().addRandomStringOnDate(randomText.wrongDate);
widget.dynamicTable().clickSaveButton();
expect(widget.dynamicTable().checkErrorMessage()).toBe(randomText.error);
it('[C286279] Should be able to save row with Date field', async () => {
await widget.dynamicTable().clickAddButton();
await widget.dynamicTable().addRandomStringOnDate(randomText.wrongDate);
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(randomText.error);
widget.dynamicTable().clickDateWidget();
datePicker.selectTodayDate()
.checkDatePickerIsNotDisplayed();
widget.dynamicTable().clickSaveButton();
widget.dynamicTable().getTableRow(rowPosition);
expect(widget.dynamicTable().getTableCellText(rowPosition, 1)).toBe(currentDate);
await widget.dynamicTable().clickDateWidget();
await datePicker.selectTodayDate();
await datePicker.checkDatePickerIsNotDisplayed();
await widget.dynamicTable().clickSaveButton();
await widget.dynamicTable().getTableRow(rowPosition);
await expect(await widget.dynamicTable().getTableCellText(rowPosition, 1)).toBe(currentDate);
});
it('[C311456] Should be able to delete date that is not mandatory and save the Dynamic Table', () => {
widget.dynamicTable().clickAddButton();
widget.dynamicTable().clickSaveButton();
expect(widget.dynamicTable().checkErrorMessage()).toBe(randomText.requiredError);
it('[C311456] Should be able to delete date that is not mandatory and save the Dynamic Table', async () => {
await widget.dynamicTable().clickAddButton();
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().checkErrorMessage()).toBe(randomText.requiredError);
widget.dynamicTable().clickDateWidget();
datePicker.selectTodayDate()
.checkDatePickerIsNotDisplayed();
widget.dynamicTable().clickSaveButton();
widget.dynamicTable().getTableRow(rowPosition);
expect(widget.dynamicTable().getTableCellText(rowPosition, 1)).toBe(currentDate);
expect(widget.dynamicTable().getTableCellText(rowPosition, 2)).toBe('');
await widget.dynamicTable().clickDateWidget();
await datePicker.selectTodayDate();
await datePicker.checkDatePickerIsNotDisplayed();
await widget.dynamicTable().clickSaveButton();
await widget.dynamicTable().getTableRow(rowPosition);
await expect(await widget.dynamicTable().getTableCellText(rowPosition, 1)).toBe(currentDate);
await expect(await widget.dynamicTable().getTableCellText(rowPosition, 2)).toBe('');
});
});
@@ -145,7 +139,7 @@ describe('Dynamic Table', () => {
const app = resources.Files.APP_DYNAMIC_TABLE_DROPDOWN;
const dropdown = widget.dropdown();
beforeAll(async (done) => {
beforeAll(async () => {
await this.alfrescoJsApi.login(user.email, user.password);
@@ -154,32 +148,30 @@ describe('Dynamic Table', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(user.email, user.password);
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
done();
});
beforeEach(() => {
navigationBarPage.navigateToProcessServicesPage().goToApp(app.title).clickProcessButton();
beforeEach(async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton();
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
});
it('[C286519] Should be able to save row with required dropdown column', () => {
it('[C286519] Should be able to save row with required dropdown column', async () => {
const dropdownOption = 'Option 1';
widget.dynamicTable().clickAddButton();
dropdown.selectOption(dropdownOption);
widget.dynamicTable().clickSaveButton();
widget.dynamicTable().checkItemIsPresent(dropdownOption);
await widget.dynamicTable().clickAddButton();
await dropdown.selectOption(dropdownOption);
await widget.dynamicTable().clickSaveButton();
await widget.dynamicTable().checkItemIsPresent(dropdownOption);
});
});

View File

@@ -44,7 +44,7 @@ describe('Empty Process List Test', () => {
let user;
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -63,35 +63,35 @@ describe('Empty Process List Test', () => {
await apps.importPublishDeployApp(this.alfrescoJsApi, appB.file_location);
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
it('[C260494] Should add process to list when a process is created', () => {
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(appA.title).clickProcessButton();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
expect(processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
it('[C260494] Should add process to list when a process is created', async () => {
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await (await processServicesPage.goToApp(appA.title)).clickProcessButton();
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
await expect(await processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.selectFromProcessDropdown(appA.process_wse_name);
startProcessPage.clickStartProcessButton();
expect(processFiltersPage.numberOfProcessRows()).toEqual(1);
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.selectFromProcessDropdown(appA.process_wse_name);
await startProcessPage.clickStartProcessButton();
await expect(await processFiltersPage.numberOfProcessRows()).toEqual(1);
processDetailsPage.checkProcessDetailsCard();
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(appB.title).clickProcessButton();
expect(processListPage.checkProcessListTitleIsDisplayed()).toEqual('No Processes Found');
expect(processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
await processDetailsPage.checkProcessDetailsCard();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await (await processServicesPage.goToApp(appB.title)).clickProcessButton();
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
await expect(await processDetailsPage.checkProcessDetailsMessage()).toEqual('No process details found');
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.selectFromProcessDropdown(appB.processName);
startProcessPage.clickStartProcessButton();
expect(processFiltersPage.numberOfProcessRows()).toEqual(1);
processDetailsPage.checkProcessDetailsCard();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.selectFromProcessDropdown(appB.processName);
await startProcessPage.clickStartProcessButton();
await expect(await processFiltersPage.numberOfProcessRows()).toEqual(1);
await processDetailsPage.checkProcessDetailsCard();
});
});

View File

@@ -47,7 +47,7 @@ describe('Form Component', () => {
errorLabel: 'Error Label4'
};
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
@@ -65,43 +65,41 @@ describe('Form Component', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
navigationBarPage.clickFormButton();
done();
await navigationBarPage.navigateToProcessServicesFormPage();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C286505] Should be able to display errors under the Error Log section', () => {
widget.numberWidget().getNumberFieldLabel(fields.numberWidgetId);
widget.numberWidget().setFieldValue(fields.numberWidgetId, message.test);
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
formPage.checkErrorLogMessage(message.errorLogNumber);
it('[C286505] Should be able to display errors under the Error Log section', async () => {
await widget.numberWidget().getNumberFieldLabel(fields.numberWidgetId);
await widget.numberWidget().setFieldValue(fields.numberWidgetId, message.test);
await formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
await formPage.checkErrorLogMessage(message.errorLogNumber);
widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
formPage.saveForm();
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
formPage.checkErrorLogMessage(message.errorLogDate);
await widget.dateWidget().checkLabelIsVisible(fields.dateWidgetId);
await widget.dateWidget().setDateInput(fields.dateWidgetId, message.test);
widget.amountWidget().getAmountFieldLabel(fields.amountWidgetId);
widget.amountWidget().setFieldValue(fields.amountWidgetId, message.test);
formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
formPage.checkErrorLogMessage(message.errorLogAmount);
await formPage.saveForm();
await formPage.checkErrorMessageForWidgetIsDisplayed(message.warningDate);
await formPage.checkErrorLogMessage(message.errorLogDate);
widget.amountWidget().removeFromAmountWidget(fields.amountWidgetId);
formPage.checkErrorMessageIsNotDisplayed(message.errorLogAmount);
await widget.amountWidget().getAmountFieldLabel(fields.amountWidgetId);
await widget.amountWidget().setFieldValue(fields.amountWidgetId, message.test);
await formPage.checkErrorMessageForWidgetIsDisplayed(message.warningNumberAndAmount);
await formPage.checkErrorLogMessage(message.errorLogAmount);
await widget.amountWidget().removeFromAmountWidget(fields.amountWidgetId);
await formPage.checkErrorMessageIsNotDisplayed(message.errorLogAmount);
await widget.dateWidget().clearDateInput(fields.dateWidgetId);
await widget.numberWidget().clearFieldValue(fields.numberWidgetId);
await formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
await formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
await formPage.checkErrorLogMessage(message.errorLabel);
widget.dateWidget().clearDateInput(fields.dateWidgetId);
widget.numberWidget().clearFieldValue(fields.numberWidgetId);
formPage.checkErrorMessageForWidgetIsNotDisplayed(message.warningDate);
formPage.checkErrorMessageIsNotDisplayed(message.errorLogDate);
formPage.checkErrorLogMessage(message.errorLabel);
});
});

View File

@@ -20,7 +20,6 @@ import { ProcessFiltersPage } from '../pages/adf/process-services/processFilters
import { StartProcessPage } from '../pages/adf/process-services/startProcessPage';
import { ProcessDetailsPage } from '../pages/adf/process-services/processDetailsPage';
import { TaskDetailsPage } from '../pages/adf/process-services/taskDetailsPage';
import { ProcessServiceTabBarPage } from '../pages/adf/process-services/processServiceTabBarPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import resources = require('../util/resources');
@@ -29,6 +28,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../actions/APS/apps.actions';
import { UsersActions } from '../actions/users.actions';
import { browser } from 'protractor';
import { ProcessServiceTabBarPage } from '../pages/adf/process-services/processServiceTabBarPage';
describe('Form widgets - People', () => {
@@ -44,7 +44,7 @@ describe('Form widgets - People', () => {
const taskDetails = new TaskDetailsPage();
const processServiceTabBarPage = new ProcessServiceTabBarPage();
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
const appsActions = new AppsActions();
@@ -63,62 +63,53 @@ describe('Form widgets - People', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
beforeEach(() => {
new NavigationBarPage().navigateToProcessServicesPage().goToApp(appModel.name)
.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
beforeEach(async () => {
await (await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModel.name)).clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
widget.peopleWidget().checkPeopleFieldIsDisplayed();
widget.peopleWidget().fillPeopleField(processUserModel.firstName);
widget.peopleWidget().selectUserFromDropdown();
await widget.peopleWidget().checkPeopleFieldIsDisplayed();
await widget.peopleWidget().fillPeopleField(processUserModel.firstName);
await widget.peopleWidget().selectUserFromDropdown();
});
it('[C286577] Should be able to start a process with people widget', async () => {
await startProcess.clickFormStartProcessButton();
await processDetailsPage.clickOnActiveTask();
startProcess.clickFormStartProcessButton();
processDetailsPage.clickOnActiveTask();
browser.controlFlow().execute(async () => {
const taskId = await taskDetails.getId();
const taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId);
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
expect(userEmail).toEqual(processUserModel.email);
});
const taskId = await taskDetails.getId();
const taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId);
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
await expect(userEmail).toEqual(processUserModel.email);
});
it('[C286576] Should be able to see user in completed task', async () => {
await startProcess.enterProcessName(app.processName);
await startProcess.clickFormStartProcessButton();
startProcess.enterProcessName(app.processName);
startProcess.clickFormStartProcessButton();
await processDetailsPage.clickOnActiveTask();
await taskDetails.checkCompleteFormButtonIsDisplayed();
await taskDetails.clickCompleteFormTask();
processDetailsPage.clickOnActiveTask();
taskDetails.checkCompleteFormButtonIsDisplayed();
taskDetails.clickCompleteFormTask();
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList(app.processName);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCompletedFilterButton();
processFiltersPage.selectFromProcessList(app.processName);
await processDetailsPage.clickOnCompletedTask();
processDetailsPage.clickOnCompletedTask();
browser.controlFlow().execute(async () => {
const taskId = await taskDetails.getId();
const taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId);
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
expect(userEmail).toEqual(processUserModel.email);
});
const taskId = await taskDetails.getId();
const taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId);
const userEmail = taskForm['fields'][0].fields['1'][0].value.email;
await expect(userEmail).toEqual(processUserModel.email);
});
});

View File

@@ -45,7 +45,7 @@ describe('Form widgets', () => {
const app = resources.Files.WIDGETS_SMOKE_TEST;
const appFields = app.form_fields;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
const appsActions = new AppsActions();
@@ -64,132 +64,135 @@ describe('Form widgets', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
new NavigationBarPage().navigateToProcessServicesPage().goToApp(appModel.name);
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToApp(appModel.name);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask().addName(newTask).addDescription('Description').addForm(app.formName).clickStartButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(newTask);
await task.addDescription('Description');
await task.addForm(app.formName);
await task.clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(newTask);
taskPage.formFields().checkFormIsDisplayed();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.tasksListPage().checkContentIsDisplayed(newTask);
await taskPage.formFields().checkFormIsDisplayed();
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const response = await taskPage.taskDetails().getId();
const response = await taskPage.taskDetails().getId();
const formDefinition = await alfrescoJsApi.activiti.taskFormsApi.getTaskForm(response);
formInstance.setFields(formDefinition.fields);
formInstance.setAllWidgets(formDefinition.fields);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C272778] Should display text and multi-line in form', () => {
expect(taskPage.formFields().getFieldLabel(appFields.text_id))
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);
expect(taskPage.formFields().getFieldValue(appFields.text_id))
await expect(await taskPage.formFields().getFieldValue(appFields.text_id))
.toEqual(formInstance.getWidgetBy('id', appFields.text_id).value || '');
expect(widget.multilineTextWidget().getFieldValue(appFields.multiline_id))
await expect(await widget.multilineTextWidget().getFieldValue(appFields.multiline_id))
.toEqual(formInstance.getWidgetBy('id', appFields.multiline_id).value || '');
expect(taskPage.formFields().getFieldLabel(appFields.multiline_id))
await 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', () => {
expect(taskPage.formFields().getFieldValue(appFields.number_id))
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 || '');
expect(taskPage.formFields().getFieldLabel(appFields.number_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.number_id))
.toEqual(formInstance.getWidgetBy('id', appFields.number_id).name);
expect(taskPage.formFields().getFieldValue(appFields.amount_id))
await expect(await taskPage.formFields().getFieldValue(appFields.amount_id))
.toEqual(formInstance.getWidgetBy('id', appFields.amount_id).value || '');
expect(taskPage.formFields().getFieldLabel(appFields.amount_id))
await 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', () => {
expect(taskPage.formFields().getFieldLabel(appFields.attachFolder_id))
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);
expect(taskPage.formFields().getFieldLabel(appFields.attachFile_id))
await 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', () => {
expect(taskPage.formFields().getFieldLabel(appFields.date_id))
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);
expect(taskPage.formFields().getFieldValue(appFields.date_id))
await expect(await taskPage.formFields().getFieldValue(appFields.date_id))
.toEqual(formInstance.getWidgetBy('id', appFields.date_id).value || '');
expect(taskPage.formFields().getFieldLabel(appFields.dateTime_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.dateTime_id))
.toContain(formInstance.getWidgetBy('id', appFields.dateTime_id).name);
expect(taskPage.formFields().getFieldValue(appFields.dateTime_id))
await 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', () => {
expect(taskPage.formFields().getFieldValue(appFields.people_id))
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 || '');
expect(taskPage.formFields().getFieldLabel(appFields.people_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.people_id))
.toEqual(formInstance.getWidgetBy('id', appFields.people_id).name);
expect(taskPage.formFields().getFieldValue(appFields.group_id))
await expect(await taskPage.formFields().getFieldValue(appFields.group_id))
.toEqual(formInstance.getWidgetBy('id', appFields.group_id).value || '');
expect(taskPage.formFields().getFieldLabel(appFields.group_id))
await 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', () => {
expect(widget.displayTextWidget().getFieldLabel(appFields.displayText_id))
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);
expect(widget.displayValueWidget().getFieldLabel(appFields.displayValue_id))
await expect(await widget.displayValueWidget().getFieldLabel(appFields.displayValue_id))
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || 'Display value' || '');
expect(widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
await expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
.toEqual(formInstance.getWidgetBy('id', appFields.displayValue_id).value || '');
});
it('[C272784] Should display typeahead and header in form', () => {
expect(widget.headerWidget().getFieldLabel(appFields.header_id))
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);
expect(taskPage.formFields().getFieldValue(appFields.typeAhead_id))
await expect(await taskPage.formFields().getFieldValue(appFields.typeAhead_id))
.toEqual(formInstance.getWidgetBy('id', appFields.typeAhead_id).value || '');
expect(taskPage.formFields().getFieldLabel(appFields.typeAhead_id))
await 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', () => {
it('[C272785] Should display checkbox and radio button in form', async () => {
const radioOption = 1;
expect(taskPage.formFields().getFieldLabel(appFields.checkbox_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.checkbox_id))
.toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name);
expect(taskPage.formFields().getFieldLabel(appFields.radioButtons_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.radioButtons_id))
.toContain(formInstance.getWidgetBy('id', appFields.radioButtons_id).name);
expect(widget.radioWidget().getSpecificOptionLabel(appFields.radioButtons_id, radioOption))
await 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', () => {
it('[C268149] Should display hyperlink, dropdown and dynamic table in form', async () => {
expect(widget.hyperlink().getFieldText(appFields.hyperlink_id))
await expect(await widget.hyperlink().getFieldText(appFields.hyperlink_id))
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).hyperlinkUrl || '');
expect(taskPage.formFields().getFieldLabel(appFields.hyperlink_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.hyperlink_id))
.toEqual(formInstance.getWidgetBy('id', appFields.hyperlink_id).name);
expect(taskPage.formFields().getFieldLabel(appFields.dropdown_id))
await expect(await taskPage.formFields().getFieldLabel(appFields.dropdown_id))
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).name);
expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id))
await expect(widget.dropdown().getSelectedOptionText(appFields.dropdown_id))
.toContain(formInstance.getWidgetBy('id', appFields.dropdown_id).value);
expect(widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id))
await expect(await widget.dynamicTable().getFieldLabel(appFields.dynamicTable_id))
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).name);
expect(widget.dynamicTable().getColumnName(appFields.dynamicTable_id))
await expect(await widget.dynamicTable().getColumnName(appFields.dynamicTable_id))
.toContain(formInstance.getWidgetBy('id', appFields.dynamicTable_id).columnDefinitions[0].name);
});
@@ -202,7 +205,7 @@ describe('Form widgets', () => {
let deployedApp, process;
const appFields = app.form_fields;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -223,36 +226,37 @@ describe('Form widgets', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async() => {
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C260405] Value fields configured with process variables', () => {
taskPage.formFields().checkFormIsDisplayed();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
it('[C260405] Value fields configured with process variables', async () => {
await taskPage.formFields().checkFormIsDisplayed();
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
taskPage.formFields().setValueInInputById('label', 'value 1').completeForm();
await taskPage.formFields().setValueInInputById('label', 'value 1');
await taskPage.formFields().completeForm();
/* cspell:disable-next-line */
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
expect(widget.displayTextWidget().getFieldText(appFields.displayText_id))
await expect(await widget.displayTextWidget().getFieldText(appFields.displayText_id))
.toContain('value 1');
expect(widget.textWidget().getFieldValue(appFields.text_id))
await expect(await widget.textWidget().getFieldValue(appFields.text_id))
.toEqual('value 1');
expect(widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
await expect(await widget.displayValueWidget().getFieldValue(appFields.displayValue_id))
.toEqual('value 1');
});
});

View File

@@ -48,7 +48,7 @@ describe('Process List - Pagination when adding processes', () => {
const apps = new AppsActions();
let resultApp;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -70,9 +70,8 @@ describe('Process List - Pagination when adding processes', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
await new NavigationBarPage().navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
await (await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
done();
});
it('[C261046] Should keep Items per page after adding processes', async () => {
@@ -81,34 +80,32 @@ describe('Process List - Pagination when adding processes', () => {
totalPages = 2;
page = 1;
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + (nrOfProcesses - 5));
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
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 ' + (nrOfProcesses - 5));
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
browser.controlFlow().execute(async () => {
for (i; i < nrOfProcesses; i++) {
await apps.startProcess(this.alfrescoJsApi, resultApp);
}
});
for (i; i < nrOfProcesses; i++) {
await apps.startProcess(this.alfrescoJsApi, resultApp);
}
page++;
paginationPage.clickOnNextPage();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
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-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
});
});

View File

@@ -50,7 +50,7 @@ describe('Items per page set to 15 and adding of tasks', () => {
fifteenValue: 15
};
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -72,34 +72,32 @@ describe('Items per page set to 15 and adding of tasks', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
it('[C260306] Items per page set to 15 and adding of tasks', () => {
new NavigationBarPage().navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + (nrOfTasks - 5));
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
it('[C260306] Items per page set to 15 and adding of tasks', async () => {
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
browser.controlFlow().execute(async () => {
for (i; i < nrOfTasks; i++) {
await apps.startProcess(this.alfrescoJsApi, resultApp);
}
});
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.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);
for (i; i < nrOfTasks; i++) {
await apps.startProcess(this.alfrescoJsApi, resultApp);
}
currentPage++;
paginationPage.clickOnNextPage();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfTasks + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks - itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
await paginationPage.clickOnNextPage();
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);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
});
});

View File

@@ -44,7 +44,7 @@ describe('People component', () => {
const tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter'];
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -75,151 +75,166 @@ describe('People component', () => {
await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: tasks[3] });
await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: tasks[4] });
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
navigationBarPage.navigateToProcessServicesPage();
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
done();
await navigationBarPage.navigateToProcessServicesPage();
await (await processServices.goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
it('[C279989] Should no people be involved when no user is typed', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C279989] Should no people be involved when no user is typed', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.taskDetails().clickInvolvePeopleButton();
taskPage.taskDetails().clickAddInvolvedUserButton();
taskPage.taskDetails().checkNoPeopleIsInvolved();
await taskPage.taskDetails().clickInvolvePeopleButton();
await taskPage.taskDetails().clickAddInvolvedUserButton();
await taskPage.taskDetails().checkNoPeopleIsInvolved();
});
it('[C279990] Should no people be involved when clicking on Cancel button', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C279990] Should no people be involved when clicking on Cancel button', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().clickCancelInvolvePeopleButton();
taskPage.taskDetails().checkNoPeopleIsInvolved();
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().clickCancelInvolvePeopleButton();
await taskPage.taskDetails().checkNoPeopleIsInvolved();
});
it('[C261029] Should People dialog be displayed when clicking on add people button', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C261029] Should People dialog be displayed when clicking on add people button', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.taskDetails().clickInvolvePeopleButton();
expect(taskPage.taskDetails().getInvolvePeopleHeader()).toEqual('Add people and groups');
expect(taskPage.taskDetails().getInvolvePeoplePlaceholder()).toEqual('Search user');
taskPage.taskDetails().checkAddPeopleButtonIsEnabled().checkCancelButtonIsEnabled();
taskPage.taskDetails().clickCancelInvolvePeopleButton();
const taskDetails = await 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');
await taskDetails.checkAddPeopleButtonIsEnabled();
await taskDetails.checkCancelButtonIsEnabled();
await taskDetails.clickCancelInvolvePeopleButton();
});
it('[C279991] Should not be able to involve a user when is the creator of the task', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C279991] Should not be able to involve a user when is the creator of the task', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(processUserModel.firstName + ' ' + processUserModel.lastName)
.noUserIsDisplayedInSearchInvolvePeople(processUserModel.firstName + ' ' + processUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
taskPage.taskDetails().checkNoPeopleIsInvolved();
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(processUserModel.firstName + ' ' + processUserModel.lastName);
await taskDetails.noUserIsDisplayedInSearchInvolvePeople(processUserModel.firstName + ' ' + processUserModel.lastName);
await taskPage.taskDetails().clickAddInvolvedUserButton();
await taskPage.taskDetails().checkNoPeopleIsInvolved();
});
it('[C261030] Should involved user be removed when clicking on remove button', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.tasksListPage().selectRow(tasks[0]);
it('[C261030] Should involved user be removed when clicking on remove button', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.tasksListPage().selectRow(tasks[0]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
taskPage.taskDetails().removeInvolvedUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().checkNoPeopleIsInvolved();
await taskPage.taskDetails().removeInvolvedUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().checkNoPeopleIsInvolved();
});
it('[C280013] Should not be able to complete a task by a involved user', async () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
taskPage.tasksListPage().selectRow(tasks[1]);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
await taskPage.tasksListPage().selectRow(tasks[1]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().clickAddInvolvedUserButton();
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
await loginPage.loginToProcessServicesUsingUserModel(assigneeUserModel);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
taskPage.tasksListPage().selectRow(tasks[1]);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
await taskPage.tasksListPage().selectRow(tasks[1]);
taskPage.completeTaskNoFormNotDisplayed();
await taskPage.completeTaskNoFormNotDisplayed();
});
it('[C261031] Should be able to involve multiple users to a task', () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
taskPage.tasksListPage().selectRow(tasks[2]);
it('[C261031] Should be able to involve multiple users to a task', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
await taskPage.tasksListPage().selectRow(tasks[2]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
const taskDetails = await taskPage.taskDetails();
await taskPage.taskDetails().clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().clickAddInvolvedUserButton();
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
expect(taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(1)');
await expect(await taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(1)');
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName)
.selectUserToInvolve(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName)
.checkUserIsSelected(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
const taskDetails2 = await taskPage.taskDetails();
await taskDetails2.clickInvolvePeopleButton();
await taskDetails2.typeUser(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
await taskDetails2.selectUserToInvolve(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
await taskDetails2.checkUserIsSelected(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName);
expect(taskPage.taskDetails().getInvolvedUserEmail(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName))
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(secondAssigneeUserModel.firstName + ' ' + secondAssigneeUserModel.lastName))
.toEqual(secondAssigneeUserModel.email);
expect(taskPage.taskDetails().getInvolvedPeopleTitle()).toEqual(peopleTitle + '(2)');
await 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 () => {
taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
taskPage.tasksListPage().selectRow(tasks[3]);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
await taskPage.tasksListPage().selectRow(tasks[3]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(tasks[3]);
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
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);
await loginPage.loginToProcessServicesUsingUserModel(assigneeUserModel);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
taskPage.tasksListPage().selectRow(tasks[3]);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
await taskPage.tasksListPage().selectRow(tasks[3]);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
});
});

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, FileBrowserUtil } from '@alfresco/adf-testing';
import { ProcessFiltersPage } from '../pages/adf/process-services/processFiltersPage';
import { ProcessDetailsPage } from '../pages/adf/process-services/processDetailsPage';
import { AttachmentListPage } from '../pages/adf/process-services/attachmentListPage';
@@ -23,9 +23,6 @@ import { ViewerPage } from '../pages/adf/viewerPage';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import resources = require('../util/resources');
import { Util } from '../util/util';
import path = require('path');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UsersActions } from '../actions/users.actions';
@@ -47,7 +44,7 @@ describe('Attachment list action menu for processes', () => {
name: resources.Files.ADF_DOCUMENTS.PNG.file_name
});
const downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name);
const downloadedPngFile = pngFile.name;
let tenantId, appId;
const processName = {
active: 'Active Process',
@@ -57,7 +54,7 @@ describe('Attachment list action menu for processes', () => {
dragDrop: 'Drag and Drop'
};
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -85,107 +82,106 @@ describe('Attachment list action menu for processes', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C260228] Should be able to access options of a file attached to an active process', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(app.title).clickProcessButton();
it('[C260228] Should be able to access options of a file attached to an active process', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton();
processFiltersPage.selectFromProcessList(processName.active);
await processFiltersPage.selectFromProcessList(processName.active);
processDetailsPage.checkProcessTitleIsDisplayed();
await processDetailsPage.checkProcessTitleIsDisplayed();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.viewFile(pngFile.name);
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.viewFile(pngFile.name);
viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.clickCloseButton();
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
await viewerPage.clickCloseButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList(processName.active);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.active);
attachmentListPage.doubleClickFile(pngFile.name);
await attachmentListPage.doubleClickFile(pngFile.name);
viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.clickCloseButton();
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
await viewerPage.clickCloseButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList(processName.active);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.active);
attachmentListPage.downloadFile(pngFile.name);
await attachmentListPage.downloadFile(pngFile.name);
browser.driver.sleep(1000);
await browser.sleep(1000);
expect(Util.fileExists(downloadedPngFile, 30)).toBe(true);
await expect(await FileBrowserUtil.isFileDownloaded(downloadedPngFile)).toBe(true);
attachmentListPage.removeFile(pngFile.name);
attachmentListPage.checkFileIsRemoved(pngFile.name);
await attachmentListPage.removeFile(pngFile.name);
await attachmentListPage.checkFileIsRemoved(pngFile.name);
});
it('[C279886] Should be able to access options of a file attached to a completed process', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(app.title).clickProcessButton();
it('[C279886] Should be able to access options of a file attached to a completed process', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList(processName.completed);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.completed);
processDetailsPage.checkProcessTitleIsDisplayed();
await processDetailsPage.checkProcessTitleIsDisplayed();
attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.clickAttachFileButton(pngFile.location);
processDetailsPage.clickCancelProcessButton();
processFiltersPage.clickCompletedFilterButton();
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
processDetailsPage.checkProcessTitleIsDisplayed();
await processDetailsPage.checkProcessTitleIsDisplayed();
attachmentListPage.checkAttachFileButtonIsNotDisplayed();
attachmentListPage.viewFile(pngFile.name);
await attachmentListPage.checkAttachFileButtonIsNotDisplayed();
await attachmentListPage.viewFile(pngFile.name);
viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.clickCloseButton();
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
await viewerPage.clickCloseButton();
processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.clickCompletedFilterButton();
attachmentListPage.downloadFile(pngFile.name);
await attachmentListPage.downloadFile(pngFile.name);
browser.driver.sleep(1000);
await browser.sleep(1000);
expect(Util.fileExists(downloadedPngFile, 30)).toBe(true);
await expect(await FileBrowserUtil.isFileDownloaded(downloadedPngFile)).toBe(true);
attachmentListPage.removeFile(pngFile.name);
attachmentListPage.checkFileIsRemoved(pngFile.name);
await attachmentListPage.removeFile(pngFile.name);
await attachmentListPage.checkFileIsRemoved(pngFile.name);
});
it('[C277296] Should allow upload file when clicking on \'add\' icon', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
it('[C277296] Should allow upload file when clicking on \'add\' icon', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList(processName.taskApp);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.taskApp);
processDetailsPage.checkProcessTitleIsDisplayed();
await processDetailsPage.checkProcessTitleIsDisplayed();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
});
it('[C260235] Should empty list component be displayed when no file is attached', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
it('[C260235] Should empty list component be displayed when no file is attached', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList(processName.emptyList);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList(processName.emptyList);
attachmentListPage.checkEmptyAttachmentList();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
attachmentListPage.removeFile(pngFile.name);
attachmentListPage.checkFileIsRemoved(pngFile.name);
attachmentListPage.checkEmptyAttachmentList();
await attachmentListPage.checkEmptyAttachmentList();
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.removeFile(pngFile.name);
await attachmentListPage.checkFileIsRemoved(pngFile.name);
await attachmentListPage.checkEmptyAttachmentList();
});
});

View File

@@ -56,7 +56,7 @@ describe('Process Filters Test', () => {
completed: 'Completed'
};
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -75,67 +75,66 @@ describe('Process Filters Test', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
beforeEach(async () => {
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
it('[C260387] Should the running process be displayed when clicking on Running filter', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processListPage.checkProcessListIsDisplayed();
it('[C260387] Should the running process be displayed when clicking on Running filter', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processListPage.checkProcessListIsDisplayed();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName(processTitle.completed);
startProcessPage.selectFromProcessDropdown(app.process_title);
startProcessPage.clickFormStartProcessButton();
await startProcessPage.enterProcessName(processTitle.completed);
await startProcessPage.selectFromProcessDropdown(app.process_title);
await startProcessPage.clickFormStartProcessButton();
processDetailsPage.clickCancelProcessButton();
navigationBarPage.navigateToProcessServicesPage();
await processDetailsPage.clickCancelProcessButton();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.goToApp(app.title);
await processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName(processTitle.running);
startProcessPage.selectFromProcessDropdown(app.process_title);
startProcessPage.clickFormStartProcessButton();
await startProcessPage.enterProcessName(processTitle.running);
await startProcessPage.selectFromProcessDropdown(app.process_title);
await startProcessPage.clickFormStartProcessButton();
processFiltersPage.checkFilterIsHighlighted(processFilter.running);
processFiltersPage.selectFromProcessList(processTitle.running);
await processFiltersPage.checkFilterIsHighlighted(processFilter.running);
await processFiltersPage.selectFromProcessList(processTitle.running);
processDetailsPage.checkProcessDetailsCard();
await processDetailsPage.checkProcessDetailsCard();
});
it('[C280063] Should both the new created process and a completed one to be displayed when clicking on All filter', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processListPage.checkProcessListIsDisplayed();
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 processListPage.checkProcessListIsDisplayed();
processFiltersPage.clickAllFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilter.all);
processFiltersPage.selectFromProcessList(processTitle.running);
processFiltersPage.selectFromProcessList(processTitle.completed);
processDetailsPage.checkProcessDetailsCard();
await processFiltersPage.clickAllFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.all);
await processFiltersPage.selectFromProcessList(processTitle.running);
await processFiltersPage.selectFromProcessList(processTitle.completed);
await processDetailsPage.checkProcessDetailsCard();
});
it('[C280064] Should the completed process be displayed when clicking on Completed filter', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processListPage.checkProcessListIsDisplayed();
it('[C280064] Should the completed process be displayed when clicking on Completed filter', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processListPage.checkProcessListIsDisplayed();
processFiltersPage.clickCompletedFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
processFiltersPage.selectFromProcessList(processTitle.completed);
processDetailsPage.checkProcessDetailsCard();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilter.completed);
await processFiltersPage.selectFromProcessList(processTitle.completed);
await processDetailsPage.checkProcessDetailsCard();
});
it('[C280407] Should be able to access the filters with URL', async () => {
@@ -143,30 +142,27 @@ describe('Process Filters Test', () => {
const defaultFiltersNumber = 3;
let deployedApp, processFilterUrl;
const taskAppFilters = await browser.controlFlow().execute(async() => {
const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions();
const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions();
deployedApp = appDefinitions.data.find((currentApp) => {
deployedApp = appDefinitions.data.find((currentApp) => {
return currentApp.modelId === appModel.id;
});
processFilterUrl = browser.params.testConfig.adf.url + '/activiti/apps/' + deployedApp.id + '/processes/';
return this.alfrescoJsApi.activiti.userFiltersApi.getUserProcessInstanceFilters({appId: deployedApp.id});
return currentApp.modelId === appModel.id;
});
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processListPage.checkProcessListIsDisplayed();
processFilterUrl = browser.params.testConfig.adf.url + '/activiti/apps/' + deployedApp.id + '/processes/';
expect(taskAppFilters.size).toBe(defaultFiltersNumber);
const taskAppFilters = await this.alfrescoJsApi.activiti.userFiltersApi.getUserProcessInstanceFilters({ appId: deployedApp.id });
taskAppFilters.data.forEach((filter) => {
BrowserActions.getUrl(processFilterUrl + filter.id);
processListPage.checkProcessListIsDisplayed();
processFiltersPage.checkFilterIsHighlighted(filter.name);
});
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processListPage.checkProcessListIsDisplayed();
await expect(taskAppFilters.size).toBe(defaultFiltersNumber);
for (const filter of taskAppFilters) {
await BrowserActions.getUrl(processFilterUrl + filter.id);
await processListPage.checkProcessListIsDisplayed();
await processFiltersPage.checkFilterIsHighlighted(filter.name);
}
});
});

View File

@@ -42,7 +42,7 @@ describe('Process Instance Details', () => {
const app = resources.Files.SIMPLE_APP_WITH_USER_FORM;
const PROCESS_DATE_FORMAT = 'mmm d, yyyy';
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -62,30 +62,26 @@ describe('Process Instance Details', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processListPage.checkProcessListIsDisplayed();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processListPage.checkProcessListIsDisplayed();
process = await this.alfrescoJsApi.activiti.processApi.getProcessInstance(processModel.id);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appModel.id);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId);
done();
});
it('[C307031] Should display the created date in the default format', () => {
processDetailsPage.checkDetailsAreDisplayed();
expect(processDetailsPage.getCreated()).toEqual(dateFormat(process.started, PROCESS_DATE_FORMAT));
it('[C307031] Should display the created date in the default format', async () => {
await processDetailsPage.checkDetailsAreDisplayed();
await expect(await processDetailsPage.getCreated()).toEqual(dateFormat(process.started, PROCESS_DATE_FORMAT));
});
});

View File

@@ -51,7 +51,7 @@ describe('Process List Test', () => {
let appWithDateFieldId;
let procWithDate, completedProcWithDate, completedProcWithUserWidget;
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -81,15 +81,14 @@ describe('Process List Test', () => {
const procWithDateTaskId = await apps.getProcessTaskId(this.alfrescoJsApi, completedProcWithDate.id);
const procWithUserWidgetTaskId = await apps.getProcessTaskId(this.alfrescoJsApi, completedProcWithUserWidget.id);
await this.alfrescoJsApi.activiti.taskApi.completeTaskForm(procWithDateTaskId, {values: {label: null }});
await this.alfrescoJsApi.activiti.taskFormsApi.completeTaskForm(procWithUserWidgetTaskId, {values: {label: null }});
await this.alfrescoJsApi.activiti.taskApi.completeTaskForm(procWithDateTaskId.toString(), { values: { label: null } });
await this.alfrescoJsApi.activiti.taskFormsApi.completeTaskForm(procWithUserWidgetTaskId.toString(), { values: { label: null } });
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appDateModel.id);
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appUserWidgetModel.id);
@@ -97,97 +96,95 @@ describe('Process List Test', () => {
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(user.tenantId);
done();
});
beforeEach((done) => {
BrowserActions.getUrl(browser.params.testConfig.adf.url + '/process-list');
done();
beforeEach(async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/process-list');
});
it('[C286638] Should display all process by default', () => {
processListDemoPage.checkAppIdFieldIsDisplayed()
.checkProcessInstanceIdFieldIsDisplayed()
.checkProcessInstanceIdFieldIsDisplayed()
.checkSortFieldIsDisplayed()
.checkStateFieldIsDisplayed();
it('[C286638] Should display all process by default', async () => {
await processListDemoPage.checkAppIdFieldIsDisplayed();
await processListDemoPage.checkProcessInstanceIdFieldIsDisplayed();
await processListDemoPage.checkProcessInstanceIdFieldIsDisplayed();
await processListDemoPage.checkSortFieldIsDisplayed();
await processListDemoPage.checkStateFieldIsDisplayed();
});
it('[C282006] Should be able to filter processes with App ID', () => {
processListDemoPage.addAppId('a');
it('[C282006] Should be able to filter processes with App ID', async () => {
await processListDemoPage.addAppId('a');
processListDemoPage.checkErrorMessageIsDisplayed(errorMessages.appIdNumber);
processListDemoPage.clickResetButton();
await processListDemoPage.checkErrorMessageIsDisplayed(errorMessages.appIdNumber);
await processListDemoPage.clickResetButton();
processListDemoPage.addAppId('12345');
await processListDemoPage.addAppId('12345');
processListDemoPage.checkNoProcessFoundIsDisplayed();
await processListDemoPage.checkNoProcessFoundIsDisplayed();
processListDemoPage.addAppId(appWithDateFieldId);
await processListDemoPage.addAppId(appWithDateFieldId);
processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
});
it('[C282015] Should be able to filter by Process Definition ID', () => {
processListDemoPage.addProcessDefinitionId(procWithDate.processDefinitionId);
it('[C282015] Should be able to filter by Process Definition ID', async () => {
await processListDemoPage.addProcessDefinitionId(procWithDate.processDefinitionId);
processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
});
it('[C282016] Should be able to filter by Process Instance ID', () => {
processListDemoPage.addProcessInstanceId(procWithDate.id);
it('[C282016] Should be able to filter by Process Instance ID', async () => {
await processListDemoPage.addProcessInstanceId(procWithDate.id);
processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithDate);
processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithDate);
await processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
});
it('[C282017] Should be able to filter by Status', () => {
processListDemoPage.selectStateFilter('Active');
it('[C282017] Should be able to filter by Status', async () => {
await processListDemoPage.selectStateFilter('Active');
processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithDate);
processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithDate);
await processListDemoPage.checkProcessIsNotDisplayed(processName.completedProcWithUserWidget);
processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
processListDemoPage.checkProcessIsDisplayed(processName.procWithUserWidget);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithUserWidget);
processListDemoPage.selectStateFilter('Completed');
await processListDemoPage.selectStateFilter('Completed');
processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithUserWidget);
await processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithUserWidget);
processListDemoPage.checkProcessIsNotDisplayed(processName.procWithDate);
processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
await processListDemoPage.checkProcessIsNotDisplayed(processName.procWithDate);
await processListDemoPage.checkProcessIsNotDisplayed(processName.procWithUserWidget);
processListDemoPage.selectStateFilter('All');
await processListDemoPage.selectStateFilter('All');
processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithUserWidget);
processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
processListDemoPage.checkProcessIsDisplayed(processName.procWithUserWidget);
await processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.completedProcWithUserWidget);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithDate);
await processListDemoPage.checkProcessIsDisplayed(processName.procWithUserWidget);
});
it('[C282010] Should be able to sort by creation date', () => {
processListDemoPage.selectSorting('asc');
it('[C282010] Should be able to sort by creation date', async () => {
await processListDemoPage.selectSorting('asc');
processListDemoPage.getDisplayedProcessesNames().then((sortedProcessList) => {
expect(JSON.stringify(processList) === JSON.stringify(sortedProcessList)).toBe(true);
});
const sortedProcessListNamesAsc = await processListDemoPage.getDisplayedProcessesNames();
processListDemoPage.selectSorting('desc');
await expect(JSON.stringify(processList) === JSON.stringify(sortedProcessListNamesAsc)).toBe(true);
processListDemoPage.getDisplayedProcessesNames().then((sortedProcessList) => {
expect(JSON.stringify(processList.reverse()) === JSON.stringify(sortedProcessList)).toBe(true);
});
await processListDemoPage.selectSorting('desc');
const sortedProcessListNamesDesc = await processListDemoPage.getDisplayedProcessesNames();
await expect(JSON.stringify(processList.reverse()) === JSON.stringify(sortedProcessListNamesDesc)).toBe(true);
});
});

View File

@@ -28,7 +28,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { AppsActions } from '../actions/APS/apps.actions';
import { UsersActions } from '../actions/users.actions';
describe('Process List - Pagination', function () {
describe('Process List - Pagination', () => {
const itemsPerPage = {
five: '5',
@@ -57,7 +57,7 @@ describe('Process List - Pagination', function () {
let totalPages;
const processNameBase = 'process';
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -76,21 +76,20 @@ describe('Process List - Pagination', function () {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
describe('Empty processes', function () {
describe('Empty processes', () => {
it('[C280015] Should show empty content message an no pagination when no process are present', function () {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
processFiltersPage.checkNoContentMessage();
paginationPage.checkPaginationIsNotDisplayed();
it('[C280015] Should show empty content message an no pagination when no process are present', async() => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.checkNoContentMessage();
await paginationPage.checkPaginationIsNotDisplayed();
});
});
describe('With processes Pagination', function () {
describe('With processes Pagination', () => {
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -104,304 +103,303 @@ describe('Process List - Pagination', function () {
await apps.startProcess(this.alfrescoJsApi, deployedTestApp, processNameBase + (i < 10 ? `0${i}` : i));
}
done();
});
beforeEach(async (done) => {
await navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
done();
beforeEach(async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
});
it('[C261042] Should display default pagination', function () {
it('[C261042] Should display default pagination', async() => {
page = 1;
totalPages = 1;
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await expect(await paginationPage.getCurrentPage()).toEqual('Page ' + page);
await expect(await paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C261043] Should be possible to Items per page to 15', function () {
it('[C261043] Should be possible to Items per page to 15', async() => {
page = 1;
totalPages = 2;
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
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 1-' + itemsPerPage.fifteenValue * page + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
page++;
paginationPage.clickOnNextPage();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + nrOfProcesses + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
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-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses - itemsPerPage.fifteenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page = 1;
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
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);
});
it('[C261044] Should be possible to Items per page to 10', function () {
it('[C261044] Should be possible to Items per page to 10', async() => {
page = 1;
totalPages = 2;
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
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.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * page + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
page++;
paginationPage.clickOnNextPage();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
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.ten);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page = 1;
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
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.ten);
});
it('[C261047] Should be possible to Items per page to 20', function () {
it('[C261047] Should be possible to Items per page to 20', async() => {
page = 1;
totalPages = 1;
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
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.twenty);
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfProcesses + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(nrOfProcesses);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
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.twenty);
});
it('[C261045] Should be possible to Items per page to 5', function () {
it('[C261045] Should be possible to Items per page to 5', async() => {
let showing;
page = 1;
totalPages = 4;
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.five);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
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.five);
showing = (itemsPerPage.fiveValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
page++;
paginationPage.clickOnNextPage();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
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.five);
showing = (itemsPerPage.fiveValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsEnabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 6-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page++;
paginationPage.clickOnNextPage();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
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.five);
showing = (itemsPerPage.fiveValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsEnabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page++;
paginationPage.clickOnNextPage();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
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.five);
showing = (itemsPerPage.fiveValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 16-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.fiveValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
page = 1;
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
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.five);
});
it('[C261049] Should be possible to open page number dropdown', function () {
it('[C261049] Should be possible to open page number dropdown', async() => {
let showing;
page = 1;
totalPages = 2;
processFiltersPage.clickRunningFilterButton();
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await processFiltersPage.clickRunningFilterButton();
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.ten);
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.ten);
showing = (itemsPerPage.tenValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
paginationPage.clickOnPageDropdown();
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
page = 2;
paginationPage.clickOnPageDropdownOption('2');
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await paginationPage.clickOnPageDropdownOption('2');
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.ten);
showing = (itemsPerPage.tenValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 11-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
paginationPage.clickOnPageDropdown();
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
page = 1;
paginationPage.clickOnPageDropdownOption('1');
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + page);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await paginationPage.clickOnPageDropdownOption('1');
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.ten);
showing = (itemsPerPage.tenValue * page);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
expect(processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await expect(await paginationPage.getPaginationRange()).toEqual('Showing 1-' + showing + ' of ' + nrOfProcesses);
await expect(await processFiltersPage.numberOfProcessRows()).toBe(itemsPerPage.tenValue);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('[C261048] Should be possible to sort processes by name', function () {
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
it('[C261048] Should be possible to sort processes by name', async() => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
processFiltersPage.sortByName('ASC');
processFiltersPage.waitForTableBody();
processFiltersPage.checkProcessesSortedByNameAsc();
await processFiltersPage.sortByName('ASC');
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameAsc();
processFiltersPage.sortByName('DESC');
processFiltersPage.waitForTableBody();
processFiltersPage.checkProcessesSortedByNameDesc();
await processFiltersPage.sortByName('DESC');
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameDesc();
});
it('[C286260] Should keep sorting when changing \'Items per page\'', function () {
processFiltersPage.clickRunningFilterButton();
processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
it('[C286260] Should keep sorting when changing \'Items per page\'', async() => {
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.checkFilterIsHighlighted(processFilterRunning);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
processDetailsPage.checkProcessTitleIsDisplayed();
processFiltersPage.waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await processDetailsPage.checkProcessTitleIsDisplayed();
await processFiltersPage.waitForTableBody();
processFiltersPage.sortByName('ASC');
processFiltersPage.waitForTableBody();
processFiltersPage.checkProcessesSortedByNameAsc();
await processFiltersPage.sortByName('ASC');
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameAsc();
paginationPage.selectItemsPerPage(itemsPerPage.five);
processFiltersPage.waitForTableBody();
processFiltersPage.checkProcessesSortedByNameAsc();
await paginationPage.selectItemsPerPage(itemsPerPage.five);
await processFiltersPage.waitForTableBody();
await processFiltersPage.checkProcessesSortedByNameAsc();
});
});
});

View File

@@ -51,7 +51,7 @@ describe('Task List Pagination - Sorting', () => {
twentyValue: 20
};
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -69,29 +69,28 @@ describe('Task List Pagination - Sorting', () => {
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
for (let i = 0; i < nrOfTasks; i++) {
this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskNames[i]});
await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskNames[i] });
}
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
it('[C260308] Should be possible to sort tasks by name', () => {
new NavigationBarPage().navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage().getDataTable().waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
taskPage.tasksListPage().getDataTable().waitForTableBody();
taskPage.filtersPage().sortByName('ASC');
taskPage.tasksListPage().getDataTable().waitForTableBody();
taskPage.filtersPage().getAllRowsNameColumn().then(function (list) {
expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
it('[C260308] Should be possible to sort tasks by name', async () => {
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await paginationPage.selectItemsPerPage(itemsPerPage.twenty);
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.filtersPage().sortByName('ASC');
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.filtersPage().getAllRowsNameColumn().then(async (list) => {
await expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
});
taskPage.filtersPage().sortByName('DESC');
taskPage.filtersPage().getAllRowsNameColumn().then(function (list) {
await taskPage.filtersPage().sortByName('DESC');
await taskPage.filtersPage().getAllRowsNameColumn().then(async (list) => {
taskNames.reverse();
expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
await expect(JSON.stringify(list) === JSON.stringify(taskNames)).toEqual(true);
});
});

View File

@@ -43,7 +43,7 @@ describe('Start Task - Task App', () => {
const tasks = ['Standalone task', 'Completed standalone task', 'Add a form', 'Remove form'];
const noFormMessage = 'No forms attached';
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -66,69 +66,82 @@ describe('Start Task - Task App', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async (done) => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
beforeEach(async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
done();
});
it('[C260421] Should a standalone task be displayed when creating a new task without form', () => {
it('[C260421] Should a standalone task be displayed when creating a new task without form', async () => {
taskPage.createNewTask().addName(tasks[0]).clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.taskDetails().noFormIsDisplayed();
taskPage.taskDetails().checkCompleteTaskButtonIsDisplayed().checkCompleteTaskButtonIsEnabled();
taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
taskPage.taskDetails().checkAttachFormButtonIsEnabled();
expect(taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
expect(taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
const task = await taskPage.createNewTask();
await task.addName(tasks[0]);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
await taskPage.taskDetails().noFormIsDisplayed();
const taskDetails = await taskPage.taskDetails();
await taskDetails.checkCompleteTaskButtonIsDisplayed();
await taskDetails.checkCompleteTaskButtonIsEnabled();
await taskPage.taskDetails().checkAttachFormButtonIsDisplayed();
await taskPage.taskDetails().checkAttachFormButtonIsEnabled();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
});
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', () => {
taskPage.createNewTask().addName(tasks[1]).clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
taskPage.formFields().noFormIsDisplayed();
it('[C268910] Should a standalone task be displayed in completed tasks when completing it', async () => {
const task = await taskPage.createNewTask();
await task.addName(tasks[1]);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[1]);
await taskPage.formFields().noFormIsDisplayed();
taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(tasks[1]);
expect(taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + tasks[1] + ' completed');
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(tasks[1]);
await expect(await taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + tasks[1] + ' completed');
taskPage.formFields().noFormIsDisplayed();
expect(taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await taskPage.formFields().noFormIsDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
});
it('[C268911] Should allow adding a form to a standalone task when clicking on Add form button', () => {
taskPage.createNewTask().addName(tasks[2]).clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
taskPage.formFields().noFormIsDisplayed();
it('[C268911] Should allow adding a form to a standalone task when clicking on Add form button', async () => {
const task = await taskPage.createNewTask();
await task.addName(tasks[2]);
await task.clickStartButton();
taskPage.formFields().clickOnAttachFormButton().selectForm(app.formName).clickOnAttachFormButton();
expect(taskPage.taskDetails().getFormName()).toEqual(app.formName);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[2]);
await taskPage.formFields().noFormIsDisplayed();
const formFields = await taskPage.formFields();
await formFields.clickOnAttachFormButton();
await formFields.selectForm(app.formName);
await formFields.clickOnAttachFormButton();
await expect(await taskPage.taskDetails().getFormName()).toEqual(app.formName);
});
it('[C268912] Should a standalone task be displayed when removing the form from APS', () => {
taskPage.createNewTask().addName(tasks[3]).addForm(app.formName).clickStartButton();
it('[C268912] Should a standalone task be displayed when removing the form from APS', async () => {
const task = await taskPage.createNewTask();
await task.addName(tasks[3]);
await task.addForm(app.formName);
await task.clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
expect(taskPage.taskDetails().getFormName()).toEqual(app.formName);
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
await expect(await taskPage.taskDetails().getFormName()).toEqual(app.formName);
browser.controlFlow().execute(async () => {
const listOfTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
await this.alfrescoJsApi.activiti.taskApi.removeForm(listOfTasks.data[0].id);
});
const listOfTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
await this.alfrescoJsApi.activiti.taskApi.removeForm(listOfTasks.data[0].id);
browser.refresh();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
taskPage.checkTaskTitle(tasks[3]);
await browser.refresh();
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[3]);
await taskPage.checkTaskTitle(tasks[3]);
taskPage.formFields().noFormIsDisplayed();
expect(taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
expect(taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
await taskPage.formFields().noFormIsDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
});
});

View File

@@ -15,10 +15,9 @@
* limitations under the License.
*/
import { Util } from '../util/util';
import resources = require('../util/resources');
import CONSTANTS = require('../util/constants');
import { LoginPage, StartProcessDialog, Widget } from '@alfresco/adf-testing';
import { LoginPage, StartProcessDialog, Widget, FileBrowserUtil } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { ProcessServicesPage } from '../pages/adf/process-services/processServicesPage';
import { StartProcessPage } from '../pages/adf/process-services/startProcessPage';
@@ -36,7 +35,6 @@ import { FileModel } from '../models/ACS/fileModel';
import dateFormat = require('dateformat');
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import path = require('path');
import { StringUtil } from '@alfresco/adf-testing';
describe('Start Process Component', () => {
@@ -61,14 +59,14 @@ describe('Start Process Component', () => {
const processNameBiggerThen255Characters = StringUtil.generateRandomString(256);
const lengthValidationError = 'Length exceeded, 255 characters max.';
const auditLogFile = path.join('../e2e/download/', 'Audit.pdf');
const auditLogFile = 'Audit.pdf';
const jpgFile = new FileModel({
'location': resources.Files.ADF_DOCUMENTS.JPG.file_location,
'name': resources.Files.ADF_DOCUMENTS.JPG.file_name
});
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
@@ -99,37 +97,29 @@ describe('Start Process Component', () => {
dateFormAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, dateFormApp.file_location);
appId = appCreated.id;
done();
});
afterAll(async (done) => {
afterAll(async () => {
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(simpleAppCreated.id);
await this.alfrescoJsApiUserTwo.activiti.modelsApi.deleteModel(dateFormAppCreated.id);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
describe(' Once logged with user without apps', () => {
beforeEach(async () => {
await loginPage.loginToProcessServicesUsingUserModel(procUserModel);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
it('[C260458] Should NOT be able to start a process without process model', () => {
processServicesPage.goToApp('Task App');
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.checkNoProcessMessage();
it('[C260458] Should NOT be able to start a process without process model', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.checkNoProcessMessage();
});
});
@@ -140,338 +130,339 @@ describe('Start Process Component', () => {
});
beforeEach(async () => {
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
});
it('[C260441] Should display start process form and default name when creating a new process', () => {
processServicesPage.goToApp('Task App');
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
expect(startProcessPage.getDefaultName()).toEqual('My Default Name');
it('[C260441] Should display start process form and default name when creating a new process', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
});
it('[C260445] Should require process definition and be possible to click cancel button', () => {
processServicesPage.goToApp('Task App');
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('');
browser.actions().sendKeys('v\b\b').perform(); // clear doesn't trigger the validator
startProcessPage.checkStartProcessButtonIsDisabled();
startProcessPage.clickCancelProcessButton();
processFiltersPage.checkNoContentMessage();
it('[C260445] Should require process definition and be possible to click cancel button', async () => {
await processServicesPage.goToApp('Task App');
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('');
await browser.actions().sendKeys('v\b\b').perform(); // clear doesn't trigger the validator
await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickCancelProcessButton();
await processFiltersPage.checkNoContentMessage();
});
it('[C260444] Should require process name', () => {
processServicesPage.goToApp(app.title);
it('[C260444] Should require process name', async () => {
await processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
startProcessPage.deleteDefaultName('My Default Name');
startProcessPage.checkStartProcessButtonIsDisabled();
startProcessPage.clickProcessDropdownArrow();
startProcessPage.checkOptionIsDisplayed(processModelWithSe);
startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.deleteDefaultName('My Default Name');
await browser.sleep(1000);
await startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.clickProcessDropdownArrow();
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
});
it('[C260443] Should be possible to start a process without start event', () => {
processServicesPage.goToApp(app.title);
it('[C260443] Should be possible to start a process without start event', async () => {
await processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
expect(startProcessPage.checkSelectProcessPlaceholderIsDisplayed()).toBe('');
await expect(await startProcessPage.checkSelectProcessPlaceholderIsDisplayed()).toBe('');
startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
expect(startProcessPage.getDefaultName()).toEqual('My Default Name');
await expect(await startProcessPage.getDefaultName()).toEqual('My Default Name');
startProcessPage.checkStartProcessButtonIsEnabled();
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C260449] Should be possible to start a process with start event', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Test');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processDetailsPage.checkDetailsAreDisplayed();
browser.controlFlow().execute(async () => {
const processId = await processDetailsPage.getId();
await this.alfrescoJsApi.activiti.processApi.getProcessInstance(processId).then(function (response) {
expect(processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING);
expect(processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE);
expect(processDetailsPage.getProcessCategory()).toEqual(CONSTANTS.PROCESS_CATEGORY);
expect(processDetailsPage.getBusinessKey()).toEqual(CONSTANTS.PROCESS_BUSINESS_KEY);
expect(processDetailsPage.getCreatedBy()).toEqual(`${response.startedBy.firstName} ${response.startedBy.lastName}`);
expect(processDetailsPage.getCreated()).toEqual(dateFormat(CONSTANTS.PROCESS_DATE_FORMAT));
expect(processDetailsPage.getId()).toEqual(response.id);
expect(processDetailsPage.getProcessDescription()).toEqual(CONSTANTS.PROCESS_DESCRIPTION);
expect(processDetailsPage.checkProcessTitleIsDisplayed()).toEqual(response.name);
});
});
it('[C260449] Should be possible to start a process with start event', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Test');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processDetailsPage.checkDetailsAreDisplayed();
const processId = await processDetailsPage.getId();
const response = await this.alfrescoJsApi.activiti.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.getCreated()).toEqual(dateFormat(CONSTANTS.PROCESS_DATE_FORMAT));
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);
});
it('[C286503] Should NOT display any process definition when typing a non-existent one', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.typeProcessDefinition('nonexistent');
startProcessPage.checkNoProcessDefinitionOptionIsDisplayed();
startProcessPage.checkStartProcessButtonIsDisabled();
it('[C286503] Should NOT display any process definition when typing a non-existent one', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('nonexistent');
await startProcessPage.checkNoProcessDefinitionOptionIsDisplayed();
await startProcessPage.checkStartProcessButtonIsDisabled();
});
it('[C286504] Should display proper options when typing a part of existent process definitions', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.typeProcessDefinition('process');
startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
startProcessPage.checkOptionIsDisplayed(processModelWithSe);
startProcessPage.selectOption(processModelWithoutSe);
startProcessPage.checkStartProcessButtonIsEnabled();
it('[C286504] Should display proper options when typing a part of existent process definitions', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C286508] Should display only one option when typing an existent process definition', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.typeProcessDefinition(processModelWithoutSe);
startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
startProcessPage.checkOptionIsNotDisplayed(processModelWithSe);
startProcessPage.selectOption(processModelWithoutSe);
startProcessPage.checkStartProcessButtonIsEnabled();
it('[C286508] Should display only one option when typing an existent process definition', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.checkOptionIsDisplayed(processModelWithoutSe);
await startProcessPage.checkOptionIsNotDisplayed(processModelWithSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C286509] Should select automatically the processDefinition when the app contains only one', () => {
processServicesPage.goToApp(simpleApp.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
expect(startProcessPage.getProcessDefinitionValue()).toBe(simpleApp.title);
startProcessPage.checkStartProcessButtonIsEnabled();
it('[C286509] Should select automatically the processDefinition when the app contains only one', async () => {
await processServicesPage.goToApp(simpleApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(simpleApp.title);
await startProcessPage.checkStartProcessButtonIsEnabled();
});
it('[C286511] Should be able to type the process definition and start a process', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Type');
startProcessPage.typeProcessDefinition(processModelWithoutSe);
startProcessPage.selectOption(processModelWithoutSe);
startProcessPage.checkStartProcessButtonIsEnabled();
expect(startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
startProcessPage.clickStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Type');
it('[C286511] Should be able to type the process definition and start a process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Type');
await startProcessPage.typeProcessDefinition(processModelWithoutSe);
await startProcessPage.selectOption(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Type');
});
it('[C286513] Should be able to use down arrow key when navigating throw suggestions', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.typeProcessDefinition('process');
it('[C286513] Should be able to use down arrow key when navigating throw suggestions', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
startProcessPage.pressDownArrowAndEnter();
expect(startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.pressDownArrowAndEnter();
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
});
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.typeProcessDefinition('process');
startProcessPage.selectOption(processModelWithoutSe);
expect(startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
startProcessPage.clickProcessDropdownArrow();
it('[C286514] Should the process definition input be cleared when clicking on options drop down ', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.typeProcessDefinition('process');
await startProcessPage.selectOption(processModelWithoutSe);
await expect(await startProcessPage.getProcessDefinitionValue()).toBe(processModelWithoutSe);
await startProcessPage.clickProcessDropdownArrow();
expect(startProcessPage.getProcessDefinitionValue()).toBe('');
await expect(await startProcessPage.getProcessDefinitionValue()).toBe('');
});
it('[C260453] Should be possible to add a comment on an active process', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Comment Process');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Comment Process');
processDetailsPage.addComment('comment1');
processDetailsPage.checkCommentIsDisplayed('comment1');
it('[C260453] Should be possible to add a comment on an active process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Comment Process');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process');
await processDetailsPage.addComment('comment1');
await processDetailsPage.checkCommentIsDisplayed('comment1');
});
it('[C260454] Should be possible to download audit log file', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Audit Log');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Audit Log');
processDetailsPage.clickAuditLogButton();
it('[C260454] Should be possible to download audit log file', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Audit Log');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Audit Log');
await processDetailsPage.clickAuditLogButton();
expect(Util.fileExists(auditLogFile, 15)).toBe(true);
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
it('Should be able to attach a file using the button', () => {
processServicesPage.goToApp(app.title);
it('Should be able to attach a file using the button', async () => {
await processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Attach File');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
await startProcessPage.enterProcessName('Attach File');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Attach File');
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Attach File');
attachmentListPage.clickAttachFileButton(jpgFile.location);
attachmentListPage.checkFileIsAttached(jpgFile.name);
await attachmentListPage.clickAttachFileButton(jpgFile.location);
await attachmentListPage.checkFileIsAttached(jpgFile.name);
});
it('[C260451] Should be possible to display process diagram', () => {
processServicesPage.goToApp(app.title);
it('[C260451] Should be possible to display process diagram', async () => {
await processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Show Diagram');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
await startProcessPage.enterProcessName('Show Diagram');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Show Diagram');
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Show Diagram');
processDetailsPage.clickShowDiagram();
await processDetailsPage.clickShowDiagram();
});
it('[C260452] Should redirect user when clicking on active/completed task', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Active Task');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Active Task');
processDetailsPage.clickOnActiveTask();
processDetailsPage.checkActiveTaskTitleIsDisplayed();
it('[C260452] Should redirect user when clicking on active/completed task', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Active Task');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Active Task');
await processDetailsPage.clickOnActiveTask();
await processDetailsPage.checkActiveTaskTitleIsDisplayed();
});
it('[C260457] Should display process in Completed when cancelled', async () => {
await loginPage.loginToProcessServicesUsingUserModel(secondProcUserModel);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Cancel Process');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Cancel Process');
processDetailsPage.clickCancelProcessButton();
processFiltersPage.clickCompletedFilterButton();
processFiltersPage.selectFromProcessList('Cancel Process');
processDetailsPage.checkShowDiagramIsDisabled();
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Cancel Process');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Cancel Process');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Cancel Process');
await processDetailsPage.checkShowDiagramIsDisabled();
});
it('[C260461] Should be possible to add a comment on a completed/canceled process', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('Comment Process 2');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('Comment Process 2');
processDetailsPage.clickCancelProcessButton();
processFiltersPage.clickCompletedFilterButton();
processFiltersPage.selectFromProcessList('Comment Process 2');
processDetailsPage.addComment('goodbye');
processDetailsPage.checkCommentIsDisplayed('goodbye');
it('[C260461] Should be possible to add a comment on a completed/canceled process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('Comment Process 2');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process 2');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('Comment Process 2');
await processDetailsPage.addComment('goodbye');
await processDetailsPage.checkCommentIsDisplayed('goodbye');
});
it('[C260467] Should NOT be possible to attach a file on a completed process', () => {
processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('File');
startProcessPage.selectFromProcessDropdown(processModelWithSe);
startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('File');
processDetailsPage.clickCancelProcessButton();
processFiltersPage.clickCompletedFilterButton();
processFiltersPage.selectFromProcessList('File');
attachmentListPage.checkAttachFileButtonIsNotDisplayed();
it('[C260467] Should NOT be possible to attach a file on a completed process', async () => {
await processServicesPage.goToApp(app.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('File');
await startProcessPage.selectFromProcessDropdown(processModelWithSe);
await startProcessPage.clickFormStartProcessButton();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('File');
await processDetailsPage.clickCancelProcessButton();
await processFiltersPage.clickCompletedFilterButton();
await processFiltersPage.selectFromProcessList('File');
await attachmentListPage.checkAttachFileButtonIsNotDisplayed();
});
it('[C291781] Should be displayed an error message if process name exceed 255 characters', () => {
processServicesPage.goToApp(app.title);
it('[C291781] Should be displayed an error message if process name exceed 255 characters', async () => {
await processServicesPage.goToApp(app.title);
processServiceTabBarPage.clickProcessButton();
await processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName(processName255Characters);
startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
startProcessPage.checkStartProcessButtonIsEnabled();
await startProcessPage.enterProcessName(processName255Characters);
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
await startProcessPage.checkStartProcessButtonIsEnabled();
startProcessPage.enterProcessName(processNameBiggerThen255Characters);
startProcessPage.checkValidationErrorIsDisplayed(lengthValidationError);
startProcessPage.checkStartProcessButtonIsDisabled();
await startProcessPage.enterProcessName(processNameBiggerThen255Characters);
await startProcessPage.checkValidationErrorIsDisplayed(lengthValidationError);
await startProcessPage.checkStartProcessButtonIsDisabled();
});
it('[C261039] Advanced date time widget', () => {
processServicesPage.goToApp(dateFormApp.title);
processServiceTabBarPage.clickProcessButton();
processFiltersPage.clickCreateProcessButton();
processFiltersPage.clickNewProcessDropdown();
startProcessPage.enterProcessName('DateFormProcess');
startProcessPage.formFields().checkWidgetIsVisible('testdate');
widget.dateWidget().setDateInput('testdate', '15-7-2019');
startProcessPage.checkStartFormProcessButtonIsEnabled();
startProcessPage.clickFormStartProcessButton();
it('[C261039] Advanced date time widget', async () => {
await processServicesPage.goToApp(dateFormApp.title);
await processServiceTabBarPage.clickProcessButton();
await processFiltersPage.clickCreateProcessButton();
await processFiltersPage.clickNewProcessDropdown();
await startProcessPage.enterProcessName('DateFormProcess');
await startProcessPage.formFields().checkWidgetIsVisible('testdate');
await widget.dateWidget().setDateInput('testdate', '15-7-2019');
await startProcessPage.checkStartFormProcessButtonIsEnabled();
await startProcessPage.clickFormStartProcessButton();
processFiltersPage.clickRunningFilterButton();
processFiltersPage.selectFromProcessList('DateFormProcess');
processDetailsPage.clickOnStartForm();
startProcessDialog.checkStartProcessDialogIsDisplayed();
expect(startProcessDialog.getTitle()).toBe('Start Form');
expect(widget.dateWidget().getDateInput('testdate')).toBe('15-7-2019');
startProcessDialog.clickCloseButton();
startProcessDialog.checkStartProcessDialogIsNotDisplayed();
await processFiltersPage.clickRunningFilterButton();
await processFiltersPage.selectFromProcessList('DateFormProcess');
await processDetailsPage.clickOnStartForm();
await startProcessDialog.checkStartProcessDialogIsDisplayed();
await expect(await startProcessDialog.getTitle()).toBe('Start Form');
await expect(await (await widget.dateWidget()).getDateInput('testdate')).toBe('15-7-2019');
await startProcessDialog.clickCloseButton();
await startProcessDialog.checkStartProcessDialogIsNotDisplayed();
});
});
});

View File

@@ -57,7 +57,7 @@ describe('Start Task - Custom App', () => {
'name': resources.Files.ADF_DOCUMENTS.PNG.file_name
});
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -80,206 +80,191 @@ describe('Start Task - Custom App', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
it('[C263942] Should be possible to modify a task', () => {
navigationBarPage.navigateToProcessServicesPage()
.goToApp(appModel.name)
.clickTasksButton();
it('[C263942] Should be possible to modify a task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
taskPage
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(tasks[0]);
await task.addForm(app.formName);
await task.clickStartButton();
await taskPage
.tasksListPage()
.checkContentIsDisplayed(tasks[0]);
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
).toEqual(assigneeUserModel.email);
await taskDetails.selectActivityTab();
await taskDetails.addComment(firstComment);
await taskDetails.checkCommentIsDisplayed(firstComment);
const checklistDialog = await taskPage.clickOnAddChecklistButton();
await checklistDialog.addName(firstChecklist);
await checklistDialog.clickCreateChecklistButton();
await taskPage
.checkChecklistIsDisplayed(firstChecklist);
await taskPage
.taskDetails()
.selectDetailsTab();
});
it('[C263947] Should be able to start a task without form', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage
.filtersPage()
.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName(tasks[0])
.addForm(app.formName).clickStartButton()
.then(() => {
taskPage
.tasksListPage()
.checkContentIsDisplayed(tasks[0]);
const task = await taskPage.createNewTask();
taskPage
.taskDetails()
.clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await task.addName(tasks[2]);
await task.clickStartButton();
taskPage
.taskDetails()
.clickAddInvolvedUserButton();
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)).toEqual(assigneeUserModel.email);
taskPage
.taskDetails()
.selectActivityTab()
.addComment(firstComment)
.checkCommentIsDisplayed(firstComment);
taskPage
.clickOnAddChecklistButton()
.addName(firstChecklist)
.clickCreateChecklistButton();
taskPage
.checkChecklistIsDisplayed(firstChecklist);
taskPage
.taskDetails()
.selectDetailsTab();
});
});
it('[C263947] Should be able to start a task without form', () => {
navigationBarPage.navigateToProcessServicesPage()
.goToApp(appModel.name)
.clickTasksButton();
taskPage
.filtersPage()
.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName(tasks[2])
.clickStartButton();
taskPage
await taskPage
.tasksListPage()
.checkContentIsDisplayed(tasks[2]);
taskPage
await taskPage
.formFields()
.noFormIsDisplayed();
expect(taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
});
it('[C263948] Should be possible to cancel a task', () => {
navigationBarPage.navigateToProcessServicesPage()
.goToApp(appModel.name)
.clickTasksButton();
it('[C263948] Should be possible to cancel a task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
taskPage
.filtersPage()
.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName(tasks[3])
.checkStartButtonIsEnabled()
.clickCancelButton();
const task = await taskPage.createNewTask();
await task.addName(tasks[3]);
await task.checkStartButtonIsEnabled();
await task.clickCancelButton();
taskPage.tasksListPage()
.checkContentIsNotDisplayed(tasks[3]);
await taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
expect(taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
await expect(await taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
it('[C263949] Should be possible to save filled form', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(appModel.name).clickTasksButton();
taskPage.filtersPage()
it('[C263949] Should be possible to save filled form', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage()
.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask()
.addForm(app.formName)
.addName(tasks[4])
.clickStartButton();
const task = await taskPage.createNewTask();
taskPage
await task.addForm(app.formName);
await task.addName(tasks[4]);
await task.clickStartButton();
await taskPage
.tasksListPage()
.checkContentIsDisplayed(tasks[4]);
expect(taskPage.formFields()
.setFieldValue(by.id, formTextField, formFieldValue)
.getFieldValue(formTextField)).toEqual(formFieldValue);
await taskPage.formFields()
.setFieldValue(by.id, formTextField, formFieldValue);
taskPage
await taskPage
.formFields()
.refreshForm()
.checkFieldValue(by.id, formTextField, '');
.refreshForm();
taskPage
await taskPage
.formFields().checkFieldValue(by.id, formTextField, '');
await taskPage
.tasksListPage()
.checkContentIsDisplayed(tasks[4]);
taskPage
await taskPage
.formFields()
.setFieldValue(by.id, formTextField, formFieldValue)
.checkFieldValue(by.id, formTextField, formFieldValue);
.setFieldValue(by.id, formTextField, formFieldValue);
taskPage
await taskPage.formFields().checkFieldValue(by.id, formTextField, formFieldValue);
await taskPage
.formFields()
.saveForm()
.checkFieldValue(by.id, formTextField, formFieldValue);
.saveForm();
await taskPage.formFields().checkFieldValue(by.id, formTextField, formFieldValue);
});
it('[C263951] Should be possible to assign a user', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(appModel.name).clickTasksButton();
taskPage
.filtersPage()
.goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
it('[C263951] Should be possible to assign a user', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName(tasks[5])
.addAssignee(assigneeUserModel.firstName)
.clickStartButton();
const task = await taskPage.createNewTask();
await task.addName(tasks[5]);
await task.addAssignee(assigneeUserModel.firstName);
await task.clickStartButton();
taskPage
await taskPage
.tasksListPage()
.checkTaskListIsLoaded();
taskPage
await taskPage
.tasksListPage()
.getDataTable().waitForTableBody();
taskPage
.filtersPage()
await taskPage.filtersPage()
.goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage()
await taskPage.tasksListPage()
.checkContentIsDisplayed(tasks[5]);
taskPage.tasksListPage().selectRow(tasks[5]);
await taskPage.tasksListPage().selectRow(tasks[5]);
taskPage.checkTaskTitle(tasks[5]);
await taskPage.checkTaskTitle(tasks[5]);
expect(taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await expect(await taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
});
it('Attach a file', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(appModel.name).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage
.createNewTask()
.addName(tasks[6])
.clickStartButton();
it('Attach a file', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(tasks[6]);
await task.clickStartButton();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
});
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(appModel.name).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask().addName(showHeaderTask).clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
it('[C263945] Should Information box be hidden when showHeaderContent property is set on false on custom app', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(appModel.name)).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(showHeaderTask);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
processServiceTabBarPage.clickSettingsButton();
taskPage.taskDetails().appSettingsToggles().disableShowHeader();
processServiceTabBarPage.clickTasksButton();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
await processServiceTabBarPage.clickTasksButton();
taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
processServiceTabBarPage.clickSettingsButton();
taskPage.taskDetails().appSettingsToggles().enableShowHeader();
processServiceTabBarPage.clickTasksButton();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
await processServiceTabBarPage.clickTasksButton();
taskPage.taskDetails().taskInfoDrawerIsDisplayed();
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
});
});

View File

@@ -36,6 +36,7 @@ import { UsersActions } from '../actions/users.actions';
import { StringUtil } from '@alfresco/adf-testing';
import fs = require('fs');
import path = require('path');
import { ChecklistDialog } from '../pages/adf/process-services/dialog/createChecklistDialog';
describe('Start Task - Task App', () => {
@@ -60,7 +61,7 @@ describe('Start Task - Task App', () => {
'name': resources.Files.ADF_DOCUMENTS.JPG.file_name
});
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -87,97 +88,125 @@ describe('Start Task - Task App', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async (done) => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
beforeEach(async () => {
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
done();
});
it('[C260383] Should be possible to modify a task', () => {
taskPage.createNewTask().addName(tasks[0])
.addForm(app.formName).clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
taskPage.taskDetails().clickInvolvePeopleButton()
.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName)
.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
taskPage.taskDetails().clickAddInvolvedUserButton();
expect(taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
it('[C260383] Should be possible to modify a task', async () => {
const task = await taskPage.createNewTask();
await task.addName(tasks[0]);
await task.addForm(app.formName);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[0]);
const taskDetails = await taskPage.taskDetails();
await taskDetails.clickInvolvePeopleButton();
await taskDetails.typeUser(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.selectUserToInvolve(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskDetails.checkUserIsSelected(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.taskDetails().clickAddInvolvedUserButton();
await expect(await taskPage.taskDetails().getInvolvedUserEmail(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName))
.toEqual(assigneeUserModel.email);
taskPage.taskDetails().selectActivityTab().addComment(firstComment)
.checkCommentIsDisplayed(firstComment);
taskPage.clickOnAddChecklistButton().addName(firstChecklist).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(firstChecklist);
taskPage.taskDetails().selectDetailsTab();
await taskDetails.selectActivityTab();
await taskDetails.addComment(firstComment);
await taskDetails.checkCommentIsDisplayed(firstComment);
await (await taskPage.clickOnAddChecklistButton()).addName(firstChecklist);
const checklistDialog = new ChecklistDialog();
await checklistDialog.clickCreateChecklistButton();
await taskPage.checkChecklistIsDisplayed(firstChecklist);
await taskPage.taskDetails().selectDetailsTab();
});
it('[C260422] Should be possible to cancel a task', () => {
taskPage.createNewTask().addName(tasks[3])
.checkStartButtonIsEnabled().clickCancelButton();
taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
expect(taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
it('[C260422] Should be possible to cancel a task', async () => {
const task = await taskPage.createNewTask();
await task.addName(tasks[3]);
await task.checkStartButtonIsEnabled();
await task.clickCancelButton();
await taskPage.tasksListPage().checkContentIsNotDisplayed(tasks[3]);
await expect(await taskPage.filtersPage().getActiveFilter()).toEqual(CONSTANTS.TASK_FILTERS.MY_TASKS);
});
it('[C260423] Should be possible to save filled form', () => {
taskPage.createNewTask()
.addForm(app.formName).addName(tasks[4]).clickStartButton();
taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
expect(taskPage.formFields().setFieldValue(by.id, formTextField, formFieldValue)
.getFieldValue(formTextField)).toEqual(formFieldValue);
taskPage.formFields().refreshForm().checkFieldValue(by.id, formTextField, '');
taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
taskPage.formFields().setFieldValue(by.id, formTextField, formFieldValue)
.checkFieldValue(by.id, formTextField, formFieldValue);
taskPage.formFields().saveForm().checkFieldValue(by.id, formTextField, formFieldValue);
it('[C260423] Should be possible to save filled form', async () => {
const task = await taskPage.createNewTask();
await task.addForm(app.formName);
await task.addName(tasks[4]);
await task.clickStartButton();
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
const formFields = await taskPage.formFields();
await formFields.setFieldValue(by.id, formTextField, formFieldValue);
await formFields.refreshForm();
await formFields.checkFieldValue(by.id, formTextField, '');
await taskPage.tasksListPage().checkContentIsDisplayed(tasks[4]);
await formFields.setFieldValue(by.id, formTextField, formFieldValue);
await formFields.checkFieldValue(by.id, formTextField, formFieldValue);
await taskPage.formFields().saveForm();
await formFields.checkFieldValue(by.id, formTextField, formFieldValue);
});
it('[C260425] Should be possible to assign a user', () => {
taskPage.createNewTask()
.addName(tasks[5])
.addAssignee(assigneeUserModel.firstName)
.clickStartButton();
it('[C260425] Should be possible to assign a user', async () => {
const task = await taskPage.createNewTask();
await task.addName(tasks[5]);
await task.addAssignee(assigneeUserModel.firstName);
await task.clickStartButton();
taskPage.tasksListPage().checkTaskListIsLoaded();
taskPage.tasksListPage().getDataTable().waitForTableBody();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(tasks[5]);
taskPage.tasksListPage().selectRow(tasks[5]);
taskPage.checkTaskTitle(tasks[5]);
expect(taskPage.taskDetails().getAssignee()).toEqual(assigneeUserModel.firstName + ' ' + assigneeUserModel.lastName);
await taskPage.tasksListPage().checkTaskListIsLoaded();
await taskPage.tasksListPage().getDataTable().waitForTableBody();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
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);
});
it('Attach a file', () => {
taskPage.createNewTask().addName(tasks[6]).clickStartButton();
attachmentListPage.clickAttachFileButton(jpgFile.location);
attachmentListPage.checkFileIsAttached(jpgFile.name);
it('Attach a file', async () => {
const startTaskDialog = await taskPage.createNewTask();
await startTaskDialog.addName(tasks[6]);
await startTaskDialog.clickStartButton();
await attachmentListPage.clickAttachFileButton(jpgFile.location);
await attachmentListPage.checkFileIsAttached(jpgFile.name);
});
it('[C260420] Should Information box be hidden when showHeaderContent property is set on false', () => {
taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
it('[C260420] Should Information box be hidden when showHeaderContent property is set on false', async () => {
await taskPage.tasksListPage().checkContentIsDisplayed(showHeaderTask);
processServiceTabBarPage.clickSettingsButton();
taskPage.taskDetails().appSettingsToggles().disableShowHeader();
processServiceTabBarPage.clickTasksButton();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().disableShowHeader();
await processServiceTabBarPage.clickTasksButton();
taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
await taskPage.taskDetails().taskInfoDrawerIsNotDisplayed();
processServiceTabBarPage.clickSettingsButton();
taskPage.taskDetails().appSettingsToggles().enableShowHeader();
processServiceTabBarPage.clickTasksButton();
await processServiceTabBarPage.clickSettingsButton();
await taskPage.taskDetails().appSettingsToggles().enableShowHeader();
await processServiceTabBarPage.clickTasksButton();
taskPage.taskDetails().taskInfoDrawerIsDisplayed();
await taskPage.taskDetails().taskInfoDrawerIsDisplayed();
});
it('[C291780] Should be displayed an error message if task name exceed 255 characters', () => {
const startDialog = taskPage.createNewTask().addName(taskName255Characters).checkStartButtonIsEnabled();
startDialog.addName(taskNameBiggerThen255Characters)
.blur(startDialog.name)
.checkValidationErrorIsDisplayed(lengthValidationError)
.checkStartButtonIsDisabled();
it('[C291780] Should be displayed an error message if task name exceed 255 characters', async () => {
const startDialog = await taskPage.createNewTask();
await startDialog.addName(taskName255Characters);
await startDialog.checkStartButtonIsEnabled();
await startDialog.addName(taskNameBiggerThen255Characters);
await startDialog.blur(startDialog.name);
await startDialog.checkValidationErrorIsDisplayed(lengthValidationError);
await startDialog.checkStartButtonIsDisabled();
});

View File

@@ -17,7 +17,7 @@
import { browser } from 'protractor';
import { LoginPage } from '@alfresco/adf-testing';
import { LoginPage, FileBrowserUtil } from '@alfresco/adf-testing';
import { NavigationBarPage } from '../pages/adf/navigationBarPage';
import { TasksPage } from '../pages/adf/process-services/tasksPage';
import { AttachmentListPage } from '../pages/adf/process-services/attachmentListPage';
@@ -26,7 +26,6 @@ import { ViewerPage } from '../pages/adf/viewerPage';
import CONSTANTS = require('../util/constants');
import resources = require('../util/resources');
import { Util } from '../util/util';
import path = require('path');
import fs = require('fs');
@@ -48,7 +47,7 @@ describe('Attachment list action menu for tasks', () => {
location: resources.Files.ADF_DOCUMENTS.PNG.file_location,
name: resources.Files.ADF_DOCUMENTS.PNG.file_name
});
const downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name);
const downloadedPngFile = pngFile.name;
let tenantId, appId, relatedContent, relatedContentId;
const taskName = {
active: 'Active Task',
@@ -57,7 +56,7 @@ describe('Attachment list action menu for tasks', () => {
emptyList: 'Empty List'
};
beforeAll(async(done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -79,126 +78,126 @@ describe('Attachment list action menu for tasks', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
afterAll(async(done) => {
afterAll(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
await this.alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C277311] Should be able to View /Download /Remove from Attachment List on an active task', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(app.title).clickTasksButton();
it('[C277311] Should be able to View /Download /Remove from Attachment List on an active task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask().addName(taskName.active).clickStartButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(taskName.active);
await task.clickStartButton();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.viewFile(pngFile.name);
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.viewFile(pngFile.name);
viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.clickCloseButton();
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
await viewerPage.clickCloseButton();
attachmentListPage.doubleClickFile(pngFile.name);
await attachmentListPage.doubleClickFile(pngFile.name);
viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.clickCloseButton();
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
await viewerPage.clickCloseButton();
attachmentListPage.downloadFile(pngFile.name);
await attachmentListPage.downloadFile(pngFile.name);
browser.driver.sleep(1000);
await browser.sleep(1000);
expect(Util.fileExists(downloadedPngFile, 30)).toBe(true);
await expect(await FileBrowserUtil.isFileDownloaded(downloadedPngFile)).toBe(true);
attachmentListPage.removeFile(pngFile.name);
attachmentListPage.checkFileIsRemoved(pngFile.name);
await attachmentListPage.removeFile(pngFile.name);
await attachmentListPage.checkFileIsRemoved(pngFile.name);
});
it('[C260236] Should be able to View /Download /Remove from Attachment List on a completed task', () => {
navigationBarPage.navigateToProcessServicesPage().goToApp(app.title).clickTasksButton();
it('[C260236] Should be able to View /Download /Remove from Attachment List on a completed task', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask().addName(taskName.completed).clickStartButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(taskName.completed);
await task.clickStartButton();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(taskName.completed);
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(taskName.completed);
attachmentListPage.checkAttachFileButtonIsNotDisplayed();
attachmentListPage.viewFile(pngFile.name);
await attachmentListPage.checkAttachFileButtonIsNotDisplayed();
await attachmentListPage.viewFile(pngFile.name);
viewerPage.checkFileNameIsDisplayed(pngFile.name);
viewerPage.clickCloseButton();
await viewerPage.checkFileNameIsDisplayed(pngFile.name);
await viewerPage.clickCloseButton();
attachmentListPage.downloadFile(pngFile.name);
await attachmentListPage.downloadFile(pngFile.name);
browser.driver.sleep(1000);
await browser.sleep(1000);
expect(Util.fileExists(downloadedPngFile, 30)).toBe(true);
await expect(await FileBrowserUtil.isFileDownloaded(downloadedPngFile)).toBe(true);
attachmentListPage.removeFile(pngFile.name);
attachmentListPage.checkFileIsRemoved(pngFile.name);
await attachmentListPage.removeFile(pngFile.name);
await attachmentListPage.checkFileIsRemoved(pngFile.name);
});
it('[C260225] Should be able to upload a file in the Attachment list on Task App', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
it('[C260225] Should be able to upload a file in the Attachment list on Task App', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToApp(app.title)).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask().addName(taskName.taskApp).clickStartButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(taskName.taskApp);
await task.clickStartButton();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
});
it('[C279884] Should be able to view the empty attachment list for tasks', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
it('[C279884] Should be able to view the empty attachment list for tasks', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask().addName(taskName.emptyList).clickStartButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(taskName.emptyList);
await task.clickStartButton();
attachmentListPage.checkEmptyAttachmentList();
attachmentListPage.clickAttachFileButton(pngFile.location);
attachmentListPage.checkFileIsAttached(pngFile.name);
attachmentListPage.removeFile(pngFile.name);
attachmentListPage.checkFileIsRemoved(pngFile.name);
attachmentListPage.checkEmptyAttachmentList();
await attachmentListPage.checkEmptyAttachmentList();
await attachmentListPage.clickAttachFileButton(pngFile.location);
await attachmentListPage.checkFileIsAttached(pngFile.name);
await attachmentListPage.removeFile(pngFile.name);
await attachmentListPage.checkFileIsRemoved(pngFile.name);
await attachmentListPage.checkEmptyAttachmentList();
});
it('[C260234] Should be able to attache a file on a task on APS and check on ADF', () => {
browser.controlFlow().execute(async() => {
const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: 'SHARE KNOWLEDGE'});
it('[C260234] Should be able to attache a file on a task on APS and check on ADF', async () => {
const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: 'SHARE KNOWLEDGE' });
const newTaskId = newTask.id;
const filePath = path.join(browser.params.testConfig.main.rootPath + pngFile.location);
const file = fs.createReadStream(filePath);
const newTaskId = newTask.id;
relatedContent = await this.alfrescoJsApi.activiti.contentApi.createRelatedContentOnTask(newTaskId, file, { 'isRelatedContent': true });
relatedContentId = relatedContent.id;
const filePath = path.join(browser.params.testConfig.main.rootPath + pngFile.location);
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
const file = fs.createReadStream(filePath);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().selectRow('SHARE KNOWLEDGE');
relatedContent = await this.alfrescoJsApi.activiti.contentApi.createRelatedContentOnTask(newTaskId, file, {'isRelatedContent': true});
relatedContentId = relatedContent.id;
});
await attachmentListPage.checkFileIsAttached(pngFile.name);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
await this.alfrescoJsApi.activiti.contentApi.deleteContent(relatedContentId);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().selectRow('SHARE KNOWLEDGE');
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
attachmentListPage.checkFileIsAttached(pngFile.name);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().selectRow('SHARE KNOWLEDGE');
browser.controlFlow().execute(async() => {
await this.alfrescoJsApi.activiti.contentApi.deleteContent(relatedContentId);
});
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().selectRow('SHARE KNOWLEDGE');
attachmentListPage.checkEmptyAttachmentList();
await attachmentListPage.checkEmptyAttachmentList();
});
});

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { LoginPage, BrowserActions } from '@alfresco/adf-testing';
import { LoginPage, BrowserActions, FileBrowserUtil } from '@alfresco/adf-testing';
import { TasksPage } from '../pages/adf/process-services/tasksPage';
import { ProcessServicesPage } from '../pages/adf/process-services/processServicesPage';
@@ -30,9 +30,6 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { UsersActions } from '../actions/users.actions';
import { AppsActions } from '../actions/APS/apps.actions';
import path = require('path');
import { Util } from '../util/util';
describe('Task Audit', () => {
const loginPage = new LoginPage();
@@ -43,10 +40,9 @@ describe('Task Audit', () => {
const taskTaskApp = 'Audit task task app';
const taskCustomApp = 'Audit task custom app';
const taskCompleteCustomApp = 'Audit completed task custom app';
const auditLogFile = path.join('./e2e/download/', 'Audit.pdf');
let appModel;
const auditLogFile = 'Audit.pdf';
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
const apps = new AppsActions();
@@ -63,70 +59,75 @@ describe('Task Audit', () => {
await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password);
this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskTaskApp});
this.alfrescoJsApi.activiti.taskApi.createNewTask({ name: taskTaskApp });
appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
done();
});
it('[C260386] Should Audit file be downloaded when clicking on Task Audit log icon on a standalone running task', () => {
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(taskTaskApp);
it('[C260386] Should Audit file be downloaded when clicking on Task Audit log icon on a standalone running task', async () => {
await (await processServices.goToTaskApp()).clickTasksButton();
taskPage.taskDetails().clickAuditLogButton();
expect(Util.fileExists(auditLogFile, 10)).toBe(true);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskTaskApp);
await taskPage.taskDetails().clickAuditLogButton();
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
it('[C260389] Should Audit file be downloaded when clicking on Task Audit log icon on a standalone completed task', () => {
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(taskTaskApp);
it('[C260389] Should Audit file be downloaded when clicking on Task Audit log icon on a standalone completed task', async () => {
await (await processServices.goToTaskApp()).clickTasksButton();
taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(taskTaskApp);
expect(taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + taskTaskApp + ' completed');
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskTaskApp);
taskPage.taskDetails().clickAuditLogButton();
expect(Util.fileExists(auditLogFile, 20)).toBe(true);
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');
await taskPage.taskDetails().clickAuditLogButton();
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
it('[C263944] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone completed task', () => {
processServices.goToTaskApp().clickTasksButton();
it('[C263944] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone completed task', async () => {
await (await processServices.goToTaskApp()).clickTasksButton();
taskPage.createNewTask().addName(taskCompleteCustomApp).clickStartButton();
const task = await taskPage.createNewTask();
await task.addName(taskCompleteCustomApp);
await task.clickStartButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(taskCompleteCustomApp);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskCompleteCustomApp);
taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(taskCompleteCustomApp);
expect(taskPage.formFields().getCompletedTaskNoFormMessage()).toEqual('Task ' + taskCompleteCustomApp + ' completed');
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');
taskPage.taskDetails().clickAuditLogButton();
expect(Util.fileExists(auditLogFile, 20)).toBe(true);
await taskPage.taskDetails().clickAuditLogButton();
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
it('[C263943] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone running task', () => {
processServices.goToApp(appModel.name).clickTasksButton();
it('[C263943] Should Audit file be downloaded when clicking on Task Audit log icon on a custom app standalone running task', async () => {
await (await processServices.goToTaskApp()).clickTasksButton();
taskPage.createNewTask().addName(taskCustomApp).clickStartButton();
const task = await taskPage.createNewTask();
await task.addName(taskCustomApp);
await task.clickStartButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(taskCustomApp);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskCustomApp);
taskPage.taskDetails().clickAuditLogButton();
expect(Util.fileExists(auditLogFile, 10)).toBe(true);
await taskPage.taskDetails().clickAuditLogButton();
await expect(await FileBrowserUtil.isFileDownloaded(auditLogFile)).toBe(true);
});
});

View File

@@ -38,7 +38,7 @@ describe('Task Details - Form', () => {
const filtersPage = new FiltersPage();
let task, otherTask, user, newForm, attachedForm, otherAttachedForm;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
const attachedFormModel = {
'name': StringUtil.generateRandomString(),
@@ -53,7 +53,12 @@ describe('Task Details - Form', () => {
'modelType': 2,
'stencilSet': 0
};
const newFormModel = { 'name': StringUtil.generateRandomString(), 'description': '', 'modelType': 2, 'stencilSet': 0 };
const newFormModel = {
'name': StringUtil.generateRandomString(),
'description': '',
'modelType': 2,
'stencilSet': 0
};
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
@@ -80,10 +85,9 @@ describe('Task Details - Form', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
const taskModel = new StandaloneTask();
const emptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(taskModel);
@@ -92,64 +96,63 @@ describe('Task Details - Form', () => {
task = await this.alfrescoJsApi.activiti.taskApi.getTask(emptyTask.id);
new NavigationBarPage().navigateToProcessServicesPage().goToTaskApp();
tasksListPage.checkTaskListIsLoaded();
filtersPage.goToFilter('Involved Tasks');
tasksListPage.checkTaskListIsLoaded();
await (await new NavigationBarPage().navigateToProcessServicesPage()).goToTaskApp();
await tasksListPage.checkTaskListIsLoaded();
await filtersPage.goToFilter('Involved Tasks');
await tasksListPage.checkTaskListIsLoaded();
done();
});
it('[C280018] Should be able to change the form in a task', () => {
tasksListPage.selectRow(task.name);
taskDetailsPage.clickForm();
it('[C280018] Should be able to change the form in a task', async () => {
await tasksListPage.selectRow(task.name);
await taskDetailsPage.clickForm();
taskDetailsPage.checkAttachFormDropdownIsDisplayed();
taskDetailsPage.checkAttachFormButtonIsDisabled();
await taskDetailsPage.checkAttachFormDropdownIsDisplayed();
await taskDetailsPage.checkAttachFormButtonIsDisabled();
taskDetailsPage.clickAttachFormDropdown();
await taskDetailsPage.clickAttachFormDropdown();
taskDetailsPage.selectAttachFormOption(newForm.name);
taskDetailsPage.checkSelectedForm(newForm.name);
taskDetailsPage.checkAttachFormButtonIsEnabled();
await taskDetailsPage.selectAttachFormOption(newForm.name);
await taskDetailsPage.checkSelectedForm(newForm.name);
await taskDetailsPage.checkAttachFormButtonIsEnabled();
taskDetailsPage.checkCancelAttachFormIsDisplayed();
taskDetailsPage.clickCancelAttachForm();
await taskDetailsPage.checkCancelAttachFormIsDisplayed();
await taskDetailsPage.clickCancelAttachForm();
taskDetailsPage.checkFormIsAttached(attachedForm.name);
await taskDetailsPage.checkFormIsAttached(attachedForm.name);
taskDetailsPage.clickForm();
await taskDetailsPage.clickForm();
taskDetailsPage.checkAttachFormDropdownIsDisplayed();
taskDetailsPage.clickAttachFormDropdown();
await taskDetailsPage.checkAttachFormDropdownIsDisplayed();
await taskDetailsPage.clickAttachFormDropdown();
taskDetailsPage.selectAttachFormOption(newForm.name);
await taskDetailsPage.selectAttachFormOption(newForm.name);
taskDetailsPage.checkAttachFormButtonIsDisplayed();
taskDetailsPage.clickAttachFormButton();
await taskDetailsPage.checkAttachFormButtonIsDisplayed();
await taskDetailsPage.clickAttachFormButton();
taskDetailsPage.checkFormIsAttached(newForm.name);
await taskDetailsPage.checkFormIsAttached(newForm.name);
});
it('[C280019] Should be able to remove the form form a task', () => {
tasksListPage.selectRow(task.name);
taskDetailsPage.clickForm();
it('[C280019] Should be able to remove the form form a task', async () => {
await tasksListPage.selectRow(task.name);
await taskDetailsPage.clickForm();
taskDetailsPage.checkRemoveAttachFormIsDisplayed();
taskDetailsPage.clickRemoveAttachForm();
await taskDetailsPage.checkRemoveAttachFormIsDisplayed();
await taskDetailsPage.clickRemoveAttachForm();
taskDetailsPage.checkFormIsAttached('No form');
await taskDetailsPage.checkFormIsAttached('No form');
expect(taskDetailsPage.getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskDetailsPage.getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
});
it('[C280557] Should display task details when selecting another task while the Attach Form dialog is displayed', () => {
tasksListPage.selectRow(task.name);
taskDetailsPage.clickForm();
it('[C280557] Should display task details when selecting another task while the Attach Form dialog is displayed', async () => {
await tasksListPage.selectRow(task.name);
await taskDetailsPage.clickForm();
taskDetailsPage.checkRemoveAttachFormIsDisplayed();
await taskDetailsPage.checkRemoveAttachFormIsDisplayed();
tasksListPage.selectRow(otherTask.name);
taskDetailsPage.checkFormIsAttached(otherAttachedForm.name);
await tasksListPage.selectRow(otherTask.name);
await taskDetailsPage.checkFormIsAttached(otherAttachedForm.name);
});
});

View File

@@ -41,7 +41,7 @@ describe('Task Details - No form', () => {
const apps = new AppsActions();
let importedApp;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
this.alfrescoJsApi = new AlfrescoApi({
@@ -63,20 +63,20 @@ describe('Task Details - No form', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
it('[C289311] Should attach form and complete buttons to be displayed when no form is attached', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
it('[C289311] Should attach form and complete buttons to be displayed when no form is attached', async () => {
await (await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp()).clickTasksButton();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(app.taskName);
taskPage.tasksListPage().selectRow(app.taskName);
taskPage.taskDetails().noFormIsDisplayed();
taskPage.taskDetails().checkCompleteTaskButtonIsDisplayed().checkCompleteTaskButtonIsEnabled();
taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed();
expect(taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
expect(taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
await taskPage.tasksListPage().checkContentIsDisplayed(app.taskName);
await taskPage.tasksListPage().selectRow(app.taskName);
await taskPage.taskDetails().noFormIsDisplayed();
await taskPage.taskDetails().checkCompleteTaskButtonIsDisplayed();
await taskPage.taskDetails().checkCompleteTaskButtonIsEnabled();
await taskPage.taskDetails().checkAttachFormButtonIsNotDisplayed();
await expect(await taskPage.taskDetails().getFormName()).toEqual(CONSTANTS.TASK_DETAILS.NO_FORM);
await expect(await taskPage.formFields().getNoFormMessage()).toEqual(noFormMessage);
});

View File

@@ -45,7 +45,7 @@ describe('Task Details component', () => {
const loginPage = new LoginPage();
const taskPage = new TasksPage();
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
apps = new AppsActions();
@@ -66,272 +66,255 @@ describe('Task Details component', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
await BrowserActions.getUrl(browser.params.testConfig.adf.url + '/activiti');
done();
});
it('[C260506] Should display task details for standalone task - Task App', async () => {
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask()
.addName(tasks[1])
.addDescription('Description')
.addForm(app.formName)
.clickStartButton();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
await (await processServices.goToTaskApp()).clickTasksButton();
const allTasks = await browser.controlFlow().execute(async () => {
return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
});
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(tasks[1]);
await task.addDescription('Description');
await task.addForm(app.formName);
await task.clickStartButton();
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(taskModel.getDescription());
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(taskPage.taskDetails().getDuration()).toEqual('');
expect(taskPage.taskDetails().getEndDate()).toEqual('');
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
const taskForm = await browser.controlFlow().execute(async () => {
return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
});
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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);
const taskForm = await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
formModel = new FormModel(taskForm);
expect(taskPage.taskDetails().getFormName()).toEqual(formModel.getName());
await expect(await taskPage.taskDetails().getFormName()).toEqual(formModel.getName());
});
it('[C263946] Should display task details for standalone task - Custom App', async () => {
processServices.goToApp(appModel.name).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.createNewTask()
.addName(tasks[1])
.addDescription('Description')
.addForm(app.formName)
.clickStartButton();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
await (await processServices.goToTaskApp()).clickTasksButton();
const allTasks = await browser.controlFlow().execute(async () => {
return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
});
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const task = await taskPage.createNewTask();
await task.addName(tasks[1]);
await task.addDescription('Description');
await task.addForm(app.formName);
await task.clickStartButton();
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(taskModel.getDescription());
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(taskModel.getCategory());
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(taskPage.taskDetails().getDuration()).toEqual('' );
expect(taskPage.taskDetails().getEndDate()).toEqual('');
expect(taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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());
const taskForm = await browser.controlFlow().execute(async () => {
return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
});
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);
const taskForm = await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
formModel = new FormModel(taskForm);
expect(taskPage.taskDetails().getFormName()).toEqual(formModel.getName());
await expect(await taskPage.taskDetails().getFormName()).toEqual(formModel.getName());
});
it('[C286706] Should display task details for task - Task App', async () => {
browser.controlFlow().execute(async () => {
await apps.startProcess(this.alfrescoJsApi, appModel);
});
await apps.startProcess(this.alfrescoJsApi, appModel);
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await (await processServices.goToTaskApp()).clickTasksButton();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const allTasks = await browser.controlFlow().execute(async () => {
return await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({sort: 'created-desc'}));
});
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[0].name);
expect(taskPage.taskDetails().getDuration()).toEqual('' );
expect(taskPage.taskDetails().getEndDate()).toEqual('');
expect(taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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[0].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);
const taskForm = await browser.controlFlow().execute(async () => {
return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
});
const taskForm = await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
formModel = new FormModel(taskForm);
expect(taskPage.taskDetails().getFormName())
await expect(await taskPage.taskDetails().getFormName())
.toEqual(formModel.getName() === null ? CONSTANTS.TASK_DETAILS.NO_FORM : formModel.getName());
});
it('[C286705] Should display task details for task - Custom App', async () => {
browser.controlFlow().execute(async () => {
await apps.startProcess(this.alfrescoJsApi, appModel);
});
await apps.startProcess(this.alfrescoJsApi, appModel);
processServices.goToApp(appModel.name).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await (await processServices.goToTaskApp()).clickTasksButton();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const allTasks = await browser.controlFlow().execute(async () => {
return await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({sort: 'created-desc'}));
});
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(appModel.definition.models[0].name);
expect(taskPage.taskDetails().getDuration()).toEqual('' );
expect(taskPage.taskDetails().getEndDate()).toEqual('');
expect(taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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[0].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);
const taskForm = await browser.controlFlow().execute(async () => {
return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
});
const taskForm = await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id);
formModel = new FormModel(taskForm);
expect(taskPage.taskDetails().getFormName())
await expect(await taskPage.taskDetails().getFormName())
.toEqual(formModel.getName() === null ? CONSTANTS.TASK_DETAILS.NO_FORM : formModel.getName());
});
it('[C286708] Should display task details for subtask - Task App', async() => {
it('[C286708] Should display task details for subtask - Task App', async () => {
const taskName = 'TaskAppSubtask';
const checklistName = 'TaskAppChecklist';
browser.controlFlow().execute(async () => {
await this.alfrescoJsApi.activiti.taskApi.createNewTask({'name': taskName});
});
await this.alfrescoJsApi.activiti.taskApi.createNewTask({ 'name': taskName });
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(taskName);
taskPage.tasksListPage().selectRow(taskName);
await (await processServices.goToTaskApp()).clickTasksButton();
taskPage.clickOnAddChecklistButton().addName(checklistName).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(checklistName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.tasksListPage().checkContentIsDisplayed(taskName);
await taskPage.tasksListPage().selectRow(taskName);
taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
taskPage.tasksListPage().selectRow(checklistName);
const dialog = await taskPage.clickOnAddChecklistButton();
await dialog.addName(checklistName);
await dialog.clickCreateChecklistButton();
const allTasks = await browser.controlFlow().execute(async () => {
return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
});
await taskPage.checkChecklistIsDisplayed(checklistName);
await taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
await taskPage.tasksListPage().selectRow(checklistName);
const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(taskPage.taskDetails().getDuration()).toEqual('');
expect(taskPage.taskDetails().getEndDate()).toEqual('');
expect(taskPage.taskDetails().getParentTaskId()).toEqual(taskModel.getParentTaskId());
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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);
});
it('[C286707] Should display task details for subtask - Custom App', async() => {
it('[C286707] Should display task details for subtask - Custom App', async () => {
const checklistName = 'CustomAppChecklist';
browser.controlFlow().execute(async () => {
await apps.startProcess(this.alfrescoJsApi, appModel);
});
await apps.startProcess(this.alfrescoJsApi, appModel);
processServices.goToApp(appModel.name).clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await (await processServices.goToTaskApp()).clickTasksButton();
expect(taskPage.taskDetails().getTitle()).toEqual('Activities');
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.clickOnAddChecklistButton().addName(checklistName).clickCreateChecklistButton();
taskPage.checkChecklistIsDisplayed(checklistName);
await expect(await taskPage.taskDetails().getTitle()).toEqual('Activities');
taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
taskPage.tasksListPage().selectRow(checklistName);
const dialog = await taskPage.clickOnAddChecklistButton();
await dialog.addName(checklistName);
await dialog.clickCreateChecklistButton();
const allTasks = await browser.controlFlow().execute(async () => {
return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
});
await taskPage.checkChecklistIsDisplayed(checklistName);
await taskPage.tasksListPage().checkContentIsDisplayed(checklistName);
await taskPage.tasksListPage().selectRow(checklistName);
const allTasks = await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' }));
const taskModel = new TaskModel(allTasks.data[0]);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(taskModel.getCategory());
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(taskPage.taskDetails().getDuration()).toEqual('');
expect(taskPage.taskDetails().getEndDate()).toEqual('');
expect(taskPage.taskDetails().getParentTaskId()).toEqual(taskModel.getParentTaskId());
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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);
});
it('[C286709] Should display task details for completed task - Task App', async() => {
it('[C286709] Should display task details for completed task - Task App', async () => {
const taskName = 'TaskAppCompleted';
const taskId = await browser.controlFlow().execute(async () => {
return this.alfrescoJsApi.activiti.taskApi.createNewTask({'name': taskName});
});
const taskId = await this.alfrescoJsApi.activiti.taskApi.createNewTask({ 'name': taskName });
processServices.goToTaskApp().clickTasksButton();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.tasksListPage().checkContentIsDisplayed(taskName).selectRow('Name', taskName);
await (await processServices.goToTaskApp()).clickTasksButton();
taskPage.completeTaskNoForm();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
taskPage.tasksListPage().selectRow(taskName);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
const getTaskResponse = await browser.controlFlow().execute(async () => {
return this.alfrescoJsApi.activiti.taskApi.getTask(taskId.id);
});
await taskPage.tasksListPage().checkContentIsDisplayed(taskName);
await taskPage.tasksListPage().selectRow(taskName);
await taskPage.completeTaskNoForm();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS);
await taskPage.tasksListPage().selectRow(taskName);
const getTaskResponse = await this.alfrescoJsApi.activiti.taskApi.getTask(taskId.id);
const taskModel = new TaskModel(getTaskResponse);
taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATE_FORMAT));
expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId());
expect(taskPage.taskDetails().getDescription()).toEqual(CONSTANTS.TASK_DETAILS.NO_DESCRIPTION);
expect(taskPage.taskDetails().getAssignee()).toEqual(taskModel.getAssignee().getEntireName());
expect(taskPage.taskDetails().getCategory()).toEqual(CONSTANTS.TASK_DETAILS.NO_CATEGORY);
expect(taskPage.taskDetails().getDueDate()).toEqual(CONSTANTS.TASK_DETAILS.NO_DATE);
expect(taskPage.taskDetails().getParentName()).toEqual(CONSTANTS.TASK_DETAILS.NO_PARENT);
expect(taskPage.taskDetails().getDuration()).toEqual(taskPage.taskDetails().getDuration());
expect(taskPage.taskDetails().getEndDate()).toEqual(taskPage.taskDetails().getEndDate());
expect(taskPage.taskDetails().getParentTaskId()).toEqual('');
expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.COMPLETED);
await taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName());
await expect(await taskPage.taskDetails().getCreated()).toEqual(dateFormat(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);
});
});

View File

@@ -47,17 +47,16 @@ describe('Task', () => {
const app = resources.Files.APP_WITH_DATE_FIELD_FORM;
let appId, tenantId;
beforeAll(async (done) => {
beforeAll(async () => {
this.alfrescoJsApi = new AlfrescoApi({
provider: 'BPM',
hostBpm: browser.params.testConfig.adf_aps.host
});
done();
});
beforeEach(async (done) => {
beforeEach(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -76,15 +75,14 @@ describe('Task', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
navigationBarPage.navigateToProcessServicesPage();
await navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(app.title);
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
done();
});
afterEach(async (done) => {
afterEach(async () => {
await this.alfrescoJsApi.activiti.modelsApi.deleteModel(appId);
@@ -92,109 +90,127 @@ describe('Task', () => {
await this.alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(tenantId);
done();
});
it('[C279967] Should display default filters when an app is deployed', () => {
taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
it('[C279967] Should display default filters when an app is deployed', async () => {
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
});
it('[C260330] Should display Task Filter List when app is in Task Tab', () => {
tasksPage.createNewTask().addName('Test').clickStartButton();
taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
tasksListPage.checkContentIsDisplayed('Test');
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
expect(taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
it('[C260330] Should display Task Filter List when app is in Task Tab', async () => {
const task = await tasksPage.createNewTask();
await task.addName('Test');
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();
taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
tasksListPage.checkContentIsNotDisplayed('Test');
expect(taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
await taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
tasksListPage.checkContentIsDisplayed('Test');
expect(taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
tasksListPage.checkContentIsNotDisplayed('Test');
expect(taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
await taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
await tasksListPage.checkContentIsNotDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsEmpty()).toBeDefined();
});
it('[C260348] Should display task in Complete Tasks List when task is completed', () => {
expect(taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed()).toBeDefined();
expect(taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed()).toBeDefined();
expect(taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed()).toBeDefined();
expect(taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed).toBeDefined();
it('[C260348] Should display task in Complete Tasks List when task is completed', async () => {
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
expect(taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed()).toBeDefined();
expect(taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed()).toBeDefined();
expect(taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed).toBeDefined();
expect(taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed).toBeDefined();
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.queuedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.involvedTasksFilter().checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.completedTasksFilter().checkTaskFilterIsDisplayed();
tasksPage.createNewTask().addName('Test').clickStartButton();
taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
tasksListPage.checkContentIsDisplayed('Test');
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('My Tasks');
expect(taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
const task = await tasksPage.createNewTask();
await task.addName('Test');
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();
taskFiltersDemoPage.queuedTasksFilter().clickTaskFilter();
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('Queued Tasks');
expect(tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
expect(taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
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');
taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
tasksListPage.checkContentIsDisplayed('Test');
expect(taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await expect(await taskFiltersDemoPage.checkActiveFilterActive()).toBe('Involved Tasks');
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.checkTaskDetailsDisplayed()).toBeDefined();
taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
expect(taskFiltersDemoPage.checkActiveFilterActive()).toBe('Completed Tasks');
expect(tasksListPage.getNoTasksFoundMessage()).toBe('No Tasks Found');
expect(taskDetailsPage.getEmptyTaskDetailsMessage()).toBe('No task details found');
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');
});
it('[C260349] Should sort task by name when Name sorting is clicked', () => {
tasksPage.createNewTask().addName('Test1').clickStartButton();
taskDetailsPage.clickCompleteTask();
tasksPage.createNewTask().addName('Test2').clickStartButton();
taskDetailsPage.clickCompleteTask();
tasksPage.createNewTask().addName('Test3').clickStartButton();
it('[C260349] Should sort task by name when Name sorting is clicked', async () => {
const task = await tasksPage.createNewTask();
await task.addName('Test1');
await task.clickStartButton();
tasksPage.createNewTask().addName('Test4').clickStartButton();
tasksListPage.checkContentIsDisplayed('Test4');
tasksListPage.checkRowIsSelected('Test4');
tasksListPage.checkContentIsDisplayed('Test3');
taskDetailsPage.checkTaskDetailsDisplayed();
await taskDetailsPage.clickCompleteTask();
tasksPage.clickSortByNameAsc();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
tasksPage.clickSortByNameDesc();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe('Test4');
const task2 = await tasksPage.createNewTask();
await task2.addName('Test2');
await task2.clickStartButton();
taskFiltersDemoPage.completedTasksFilter().clickTaskFilter();
tasksListPage.checkContentIsDisplayed('Test1');
tasksListPage.checkContentIsDisplayed('Test2');
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe('Test2');
await taskDetailsPage.clickCompleteTask();
tasksPage.clickSortByNameAsc();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
const task3 = await tasksPage.createNewTask();
await task3.addName('Test3');
await task3.clickStartButton();
taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
tasksListPage.checkContentIsDisplayed('Test3');
tasksListPage.checkContentIsDisplayed('Test4');
const task4 = await tasksPage.createNewTask();
await task4.addName('Test4');
await task4.clickStartButton();
await tasksListPage.checkContentIsDisplayed('Test4');
await tasksListPage.checkRowIsSelected('Test4');
await tasksListPage.checkContentIsDisplayed('Test3');
await taskDetailsPage.checkTaskDetailsDisplayed();
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test3');
await tasksPage.clickSortByNameDesc();
await 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');
await tasksPage.clickSortByNameAsc();
await expect(await tasksListPage.getDataTable().contentInPosition(1)).toBe('Test1');
await taskFiltersDemoPage.involvedTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test3');
await tasksListPage.checkContentIsDisplayed('Test4');
});
it('[C277264] Should display task filter results when task filter is selected', () => {
tasksPage.createNewTask().addName('Test').clickStartButton();
it('[C277264] Should display task filter results when task filter is selected', async () => {
const task = await tasksPage.createNewTask();
await task.addName('Test');
await task.clickStartButton();
taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
tasksListPage.checkContentIsDisplayed('Test');
expect(taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
await taskFiltersDemoPage.myTasksFilter().clickTaskFilter();
await tasksListPage.checkContentIsDisplayed('Test');
await expect(await taskDetailsPage.getTaskDetailsTitle()).toBe('Test');
});
});
@@ -215,7 +231,7 @@ describe('Task', () => {
const app = resources.Files.APP_WITH_PROCESSES;
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -240,186 +256,64 @@ describe('Task', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
done();
});
beforeEach(async () => {
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(app.title);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
});
it('[C260350] Should display a new filter when a filter is added', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
it('[C260350] Should display a new filter when a filter is added', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
return result;
});
taskFilterId = result.id;
browser.refresh();
await browser.refresh();
taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
await taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
browser.controlFlow().execute(() => {
const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId);
return result;
});
await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId);
});
it('[C286447] Should display the task filter icon when a custom filter is added', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter with icon';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-cloud';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
it('[C286447] Should display the task filter icon when a custom filter is added', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter with icon';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-cloud';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
return result;
});
taskFilterId = result.id;
browser.refresh();
processServiceTabBarPage.clickSettingsButton();
browser.sleep(500);
appSettingsToggles.enableTaskFiltersIcon();
processServiceTabBarPage.clickTasksButton();
await browser.refresh();
await processServiceTabBarPage.clickSettingsButton();
await browser.sleep(500);
await appSettingsToggles.enableTaskFiltersIcon();
await processServiceTabBarPage.clickTasksButton();
taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed();
expect(taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud');
await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').checkTaskFilterIsDisplayed();
await expect(await taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud');
browser.controlFlow().execute(() => {
const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId);
return result;
});
await this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId);
});
it('[C286449] Should display task filter icons only when showIcon property is set on true', () => {
taskFiltersDemoPage.myTasksFilter().checkTaskFilterHasNoIcon();
it('[C286449] Should display task filter icons only when showIcon property is set on true', async () => {
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterHasNoIcon();
processServiceTabBarPage.clickSettingsButton();
appSettingsToggles.enableTaskFiltersIcon();
processServiceTabBarPage.clickTasksButton();
await processServiceTabBarPage.clickSettingsButton();
await appSettingsToggles.enableTaskFiltersIcon();
await processServiceTabBarPage.clickTasksButton();
taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
expect(taskFiltersDemoPage.myTasksFilter().getTaskFilterIcon()).toEqual('inbox');
});
it('[C260353] Should display changes on a filter when this filter is edited', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
return result;
});
browser.refresh();
taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
browser.controlFlow().execute(() => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Task Filter Edited';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter);
return result;
});
browser.refresh();
taskFiltersDemoPage.customTaskFilter('Task Filter Edited').checkTaskFilterIsDisplayed();
browser.controlFlow().execute(() => {
const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId);
return result;
});
});
it('[C286448] Should display changes on a task filter when this filter icon is edited', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Task Filter Edited icon';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
return result;
});
browser.refresh();
taskFiltersDemoPage.customTaskFilter('Task Filter Edited icon').checkTaskFilterIsDisplayed();
browser.controlFlow().execute(() => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Task Filter Edited icon';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-cloud';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter);
return result;
});
browser.refresh();
processServiceTabBarPage.clickSettingsButton();
browser.sleep(500);
appSettingsToggles.enableTaskFiltersIcon();
processServiceTabBarPage.clickTasksButton();
taskFiltersDemoPage.customTaskFilter('Task Filter Edited icon').checkTaskFilterIsDisplayed();
expect(taskFiltersDemoPage.customTaskFilter('Task Filter Edited icon').getTaskFilterIcon()).toEqual('cloud');
});
it('[C260354] Should not display task filter when this filter is deleted', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'New Task Filter';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = <any> { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
taskFilterId = result.id;
return result;
});
browser.refresh();
taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed();
browser.controlFlow().execute(() => {
const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId);
return result;
});
browser.refresh();
taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterNotDisplayed();
await taskFiltersDemoPage.myTasksFilter().checkTaskFilterIsDisplayed();
await expect(await taskFiltersDemoPage.myTasksFilter().getTaskFilterIcon()).toEqual('inbox');
});
});

View File

@@ -53,7 +53,7 @@ describe('Task Filters Sorting', () => {
{ name: 'Task 5', dueDate: '02/01/2019' },
{ name: 'Task 6', dueDate: '03/01/2019' }];
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -78,202 +78,190 @@ describe('Task Filters Sorting', () => {
await loginPage.loginToProcessServicesUsingUserModel(user);
navigationBarPage.navigateToProcessServicesPage();
processServicesPage.checkApsContainer();
processServicesPage.goToApp(app.title);
await navigationBarPage.navigateToProcessServicesPage();
await processServicesPage.checkApsContainer();
await processServicesPage.goToApp(app.title);
tasksPage.createNewTask().addName(tasks[0].name).addDueDate(tasks[0].dueDate).clickStartButton();
taskDetailsPage.clickCompleteTask();
const task = await tasksPage.createNewTask();
await task.addName(tasks[0].name);
await task.addDueDate(tasks[0].dueDate);
await task.clickStartButton();
tasksPage.createNewTask().addName(tasks[1].name).addDueDate(tasks[1].dueDate).clickStartButton();
taskDetailsPage.clickCompleteTask();
await taskDetailsPage.clickCompleteTask();
tasksPage.createNewTask().addName(tasks[2].name).addDueDate(tasks[2].dueDate).clickStartButton();
taskDetailsPage.clickCompleteTask();
const task2 = await tasksPage.createNewTask();
tasksPage.createNewTask().addName(tasks[3].name).addDueDate(tasks[3].dueDate).clickStartButton();
tasksPage.createNewTask().addName(tasks[4].name).addDueDate(tasks[4].dueDate).clickStartButton();
tasksPage.createNewTask().addName(tasks[5].name).addDueDate(tasks[5].dueDate).clickStartButton();
await task2.addName(tasks[1].name);
await task2.addDueDate(tasks[1].dueDate);
await task2.clickStartButton();
await taskDetailsPage.clickCompleteTask();
done();
const task3 = await tasksPage.createNewTask();
await task3.addName(tasks[2].name);
await task3.addDueDate(tasks[2].dueDate);
await task3.clickStartButton();
await taskDetailsPage.clickCompleteTask();
const task4 = await tasksPage.createNewTask();
await task4.addName(tasks[3].name);
await task4.addDueDate(tasks[3].dueDate);
await task4.clickStartButton();
const task5 = await tasksPage.createNewTask();
await task5.addName(tasks[4].name);
await task5.addDueDate(tasks[4].dueDate);
await task5.clickStartButton();
const task6 = await tasksPage.createNewTask();
await task6.addName(tasks[5].name);
await task6.addDueDate(tasks[5].dueDate);
await task6.clickStartButton();
});
it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest first';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest first';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Newest first').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Newest first').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
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);
});
it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest last';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-asc', state: 'completed', assignment: 'involved' };
it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest last';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-asc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Newest last').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Newest last').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[2].name);
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);
});
it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due first';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-desc', state: 'completed', assignment: 'involved' };
it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due first';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-desc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Due first').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Due first').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[2].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[0].name);
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);
});
it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due last';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-asc', state: 'completed', assignment: 'involved' };
it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due last';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-asc', state: 'completed', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Due last').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Due last').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[0].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[1].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[2].name);
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);
});
it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest first Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'open', assignment: 'involved' };
it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest first Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-desc', state: 'open', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Newest first Open').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Newest first Open').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[3].name);
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);
});
it('[C277259] Should display tasks under new filter from oldest to newest when they are open', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest last Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-asc', state: 'open', assignment: 'involved' };
it('[C277259] Should display tasks under new filter from oldest to newest when they are open', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Newest last Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'created-asc', state: 'open', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Newest last Open').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Newest last Open').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
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);
});
it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due first Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-desc', state: 'open', assignment: 'involved' };
it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due first Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-desc', state: 'open', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Due first Open').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Due first Open').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[5].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[3].name);
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);
});
it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', () => {
browser.controlFlow().execute(async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due last Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-asc', state: 'open', assignment: 'involved' };
it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', async () => {
const newFilter: any = new UserProcessInstanceFilterRepresentation();
newFilter.name = 'Due last Open';
newFilter.appId = appId;
newFilter.icon = 'glyphicon-filter';
newFilter.filter = { sort: 'due-asc', state: 'open', assignment: 'involved' };
const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter);
return result;
});
await browser.refresh();
browser.refresh();
await taskFiltersDemoPage.customTaskFilter('Due last Open').clickTaskFilter();
taskFiltersDemoPage.customTaskFilter('Due last Open').clickTaskFilter();
expect(tasksListPage.getDataTable().contentInPosition(1)).toBe(tasks[3].name);
expect(tasksListPage.getDataTable().contentInPosition(2)).toBe(tasks[4].name);
expect(tasksListPage.getDataTable().contentInPosition(3)).toBe(tasks[5].name);
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);
});
});

View File

@@ -54,7 +54,7 @@ describe('Task List Pagination', () => {
default: '20'
};
beforeAll(async (done) => {
beforeAll(async () => {
const apps = new AppsActions();
const users = new UsersActions();
@@ -78,131 +78,130 @@ describe('Task List Pagination', () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
it('[C260301] Should display default pagination', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.default);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(nrOfTasks);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsDisabled();
paginationPage.selectItemsPerPage(itemsPerPage.twenty);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.twenty);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + nrOfTasks + ' of ' + nrOfTasks);
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);
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);
});
it('[C260304] Should be possible to set Items per page to 5', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
paginationPage.selectItemsPerPage(itemsPerPage.five);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fiveValue + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
paginationPage.clickOnNextPage();
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);
await paginationPage.clickOnNextPage();
currentPage++;
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 6-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
paginationPage.clickOnNextPage();
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);
await paginationPage.clickOnNextPage();
currentPage++;
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
paginationPage.clickOnNextPage();
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);
await paginationPage.clickOnNextPage();
currentPage++;
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.fiveValue * currentPage + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
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);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.five);
});
it('[C260303] Should be possible to set Items per page to 10', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
paginationPage.selectItemsPerPage(itemsPerPage.ten);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
paginationPage.clickOnNextPage();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
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);
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);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
});
it('[C260302] Should be possible to set Items per page to 15', () => {
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
paginationPage.selectItemsPerPage(itemsPerPage.fifteen);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.fifteenValue + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fifteenValue);
paginationPage.clickOnNextPage();
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
expect(paginationPage.getPaginationRange()).toEqual('Showing 16-' + itemsPerPage.twentyValue + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.fiveValue);
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);
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);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
await expect(await paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.fifteen);
});
it('[C261006] Should be possible to navigate to a page with page number dropdown', () => {
it('[C261006] Should be possible to navigate to a page with page number dropdown', async () => {
currentPage = 1;
totalPages = 2;
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
taskPage.tasksListPage().getDataTable().waitForTableBody();
paginationPage.selectItemsPerPage(itemsPerPage.ten);
taskPage.tasksListPage().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.INV_TASKS);
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);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
paginationPage.clickOnPageDropdown();
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
currentPage = 2;
paginationPage.clickOnPageDropdownOption('2');
taskPage.tasksListPage().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 11-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsDisabled();
paginationPage.checkPreviousPageButtonIsEnabled();
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);
await paginationPage.checkNextPageButtonIsDisabled();
await paginationPage.checkPreviousPageButtonIsEnabled();
paginationPage.clickOnPageDropdown();
expect(paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
await paginationPage.clickOnPageDropdown();
await expect(await paginationPage.getPageDropdownOptions()).toEqual(['1', '2']);
currentPage = 1;
paginationPage.clickOnPageDropdownOption('1');
taskPage.tasksListPage().getDataTable().waitForTableBody();
expect(paginationPage.getCurrentPage()).toEqual('Page ' + currentPage);
expect(paginationPage.getTotalPages()).toEqual('of ' + totalPages);
expect(paginationPage.getCurrentItemsPerPage()).toEqual(itemsPerPage.ten);
expect(paginationPage.getPaginationRange()).toEqual('Showing 1-' + itemsPerPage.tenValue * currentPage + ' of ' + nrOfTasks);
expect(taskPage.tasksListPage().getDataTable().numberOfRows()).toBe(itemsPerPage.tenValue);
paginationPage.checkNextPageButtonIsEnabled();
paginationPage.checkPreviousPageButtonIsDisabled();
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);
await paginationPage.checkNextPageButtonIsEnabled();
await paginationPage.checkPreviousPageButtonIsDisabled();
});
it('Pagination in an empty task list', async () => {
await loginPage.loginToProcessServicesUsingUserModel(processUserModelEmpty);
navigationBarPage.navigateToProcessServicesPage().goToTaskApp();
paginationPage.checkPaginationIsNotDisplayed();
await (await navigationBarPage.navigateToProcessServicesPage()).goToTaskApp();
await paginationPage.checkPaginationIsNotDisplayed();
});
});

View File

@@ -38,7 +38,7 @@ describe('Amount Widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.AMOUNT;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -59,44 +59,44 @@ describe('Amount Widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
beforeEach(async() => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.amount_input_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.amount_input_id);
it('[C274703] Should be possible to set general, advance and visibility properties for Amount Widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.amount_input_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.amount_input_id);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
expect(widget.amountWidget().getAmountFieldLabel(app.FIELD.amount_input_id)).toContain('Amount');
expect(widget.amountWidget().getPlaceholder(app.FIELD.amount_input_id)).toContain('Type amount');
expect(widget.amountWidget().getAmountFieldCurrency(app.FIELD.amount_input_id)).toBe('$');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
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');
await expect(await widget.amountWidget().getAmountFieldCurrency(app.FIELD.amount_input_id)).toBe('$');
widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4);
expect(widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be less than 5');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101);
expect(widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be greater than 100');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 6);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 6);
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
});

View File

@@ -35,7 +35,7 @@ describe('Attach Folder widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -56,28 +56,28 @@ describe('Attach Folder widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.upload_button_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.upload_button_id);
it('[C276745] Should be possible to set visibility properties for Attach Folder Widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.upload_button_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.upload_button_id);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
});
});

View File

@@ -36,7 +36,7 @@ describe('Checkbox Widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.CHECKBOX;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,34 +57,34 @@ describe('Checkbox Widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C268554] Should be able to set general settings for Checkbox widget ', () => {
taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, 2);
expect(widget.checkboxWidget().getCheckboxLabel()).toContain(app.FIELD.checkbox_label);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_input_id);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_input_id);
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C272812] Should be able to set visibility settings for Checkbox widget', () => {
widget.checkboxWidget().isCheckboxHidden(app.FIELD.checkbox_field_id);
taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, 2);
widget.checkboxWidget().isCheckboxDisplayed(app.FIELD.checkbox_field_id);
it('[C272812] Should be able to set visibility settings for Checkbox widget', async () => {
await widget.checkboxWidget().isCheckboxHidden(app.FIELD.checkbox_field_id);
await taskPage.formFields().setValueInInputById(app.FIELD.number_input_id, 2);
await widget.checkboxWidget().isCheckboxDisplayed(app.FIELD.checkbox_field_id);
});
});

View File

@@ -36,7 +36,7 @@ describe('Date and time widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.DATETIME;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,48 +57,54 @@ describe('Date and time widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C268818] Should be able to set general settings for Date Time widget', () => {
expect(widget.dateTimeWidget().getDateTimeLabel(app.FIELD.date_time_input)).toContain('Date');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
it('[C268818] Should be able to set general settings for Date Time widget', async () => {
await expect(await widget.dateTimeWidget().getDateTimeLabel(app.FIELD.date_time_input)).toContain('Date');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_input);
widget.dateTimeWidget().selectDay('10');
widget.dateTimeWidget().selectHour('8');
widget.dateTimeWidget().selectMinute('30');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_input);
await widget.dateTimeWidget().selectDay('10');
await widget.dateTimeWidget().selectHour('8');
await widget.dateTimeWidget().selectMinute('30');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
expect(widget.dateTimeWidget().getPlaceholder(app.FIELD.date_time_between_input)).toBe('Choose anything...');
await expect(await widget.dateTimeWidget().getPlaceholder(app.FIELD.date_time_between_input)).toBe('Choose anything...');
});
it('[C268819] Should be able to set advanced settings for Date Time widget ', () => {
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
widget.dateTimeWidget().closeDataTimeWidget();
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-17 07:30 PM');
taskPage.formFields().saveForm();
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be less than');
it('[C268819] Should be able to set advanced settings for Date Time widget ', async () => {
await widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
await widget.dateTimeWidget().closeDataTimeWidget();
widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
widget.dateTimeWidget().closeDataTimeWidget();
widget.dateTimeWidget().removeFromDatetimeWidget(app.FIELD.date_time_between_input);
widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-19 07:30 PM');
taskPage.formFields().saveForm();
expect(widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be greater than');
await widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-17 07:30 PM');
await taskPage.formFields().saveForm();
await expect(await widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be less than');
await widget.dateTimeWidget().openDatepicker(app.FIELD.date_time_between_input);
await widget.dateTimeWidget().closeDataTimeWidget();
await widget.dateTimeWidget().removeFromDatetimeWidget(app.FIELD.date_time_between_input);
await browser.refresh();
await widget.dateTimeWidget().setDateTimeInput(app.FIELD.date_time_between_input, '20-03-19 07:30 PM');
await widget.dateTimeWidget().closeDataTimeWidget();
await taskPage.formFields().saveForm();
await expect(await widget.dateTimeWidget().getErrorMessage(app.FIELD.date_time_between_input)).toContain('Can\'t be greater than');
});
});

View File

@@ -36,7 +36,7 @@ describe('Date widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.DATE;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,38 +57,38 @@ describe('Date widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C268814] Should be able to set general settings for Date widget', () => {
expect(widget.dateWidget().getDateLabel(app.FIELD.date_input)).toContain('Date');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.dateWidget().setDateInput(app.FIELD.date_input, '20-10-2018');
taskPage.formFields().saveForm();
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
it('[C268814] Should be able to set general settings for Date widget', async () => {
await expect(await widget.dateWidget().getDateLabel(app.FIELD.date_input)).toContain('Date');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.dateWidget().setDateInput(app.FIELD.date_input, '20-10-2018');
await taskPage.formFields().saveForm();
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C277234] Should be able to set advanced settings for Date widget ', () => {
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2017');
taskPage.formFields().saveForm();
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be less than 1-10-2018');
widget.dateWidget().clearDateInput(app.FIELD.date_between_input);
widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2019');
taskPage.formFields().saveForm();
expect(widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be greater than 31-10-2018');
it('[C277234] Should be able to set advanced settings for Date widget ', async () => {
await widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2017');
await taskPage.formFields().saveForm();
await expect(await widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be less than 1-10-2018');
await widget.dateWidget().clearDateInput(app.FIELD.date_between_input);
await widget.dateWidget().setDateInput(app.FIELD.date_between_input, '20-10-2019');
await taskPage.formFields().saveForm();
await expect(await widget.dateWidget().getErrorMessage(app.FIELD.date_between_input)).toBe('Can\'t be greater than 31-10-2018');
});
});

View File

@@ -36,7 +36,7 @@ describe('Document Template widget', () => {
const app = resources.Files.FILE_FORM_ADF;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,25 +57,25 @@ describe('Document Template widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C260406] should check that the template contains assigned file ', () => {
expect(widget.containerWidget().getFieldText(app.form_fields.container_id))
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);
});
});

View File

@@ -36,7 +36,7 @@ describe('Dropdown widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.DROPDOWN;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,42 +57,41 @@ describe('Dropdown widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C269051] Should be possible to set general and options properties for Dropdown widget ', () => {
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
it('[C269051] Should be possible to set general and options properties for Dropdown widget ', async () => {
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.dropdown().selectOption('Happy');
expect(widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Happy');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.dropdown().selectOption('Happy');
await expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Happy');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
widget.dropdown().selectOption('Choose one');
expect(widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Choose one');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.dropdown().selectOption('Choose one');
await expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Choose one');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.dropdown().selectOption('Sad');
expect(widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Sad');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.dropdown().selectOption('Sad');
await expect(await widget.dropdown().getSelectedOptionText(app.FIELD.general_dropdown)).toContain('Sad');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C269052] Should be possible to set visibility properties for Dropdown widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.dropdown_visible);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.dropdown_visible);
it('[C269052] Should be possible to set visibility properties for Dropdown widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.dropdown_visible);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.dropdown_visible);
});
});

View File

@@ -38,7 +38,7 @@ describe('Dynamic Table widget ', () => {
describe('with Date Time Widget App', () => {
const app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -59,39 +59,39 @@ describe('Dynamic Table widget ', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C276729] Should be possible to set visibility properties for Dynamic Table', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.dynamic_table_age_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.dynamic_table_age_id);
it('[C276729] Should be possible to set visibility properties for Dynamic Table', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.dynamic_table_age_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.dynamic_table_age_id);
});
it('[C279349] Should be able to have a Date Time widget in a Dynamic Table widget', () => {
widget.dynamicTable().clickAddButton();
widget.dateTimeWidget().openDatepicker(app.FIELD.dateTime_input_id);
widget.dateTimeWidget().selectDay('10');
widget.dateTimeWidget().selectHour('8');
widget.dateTimeWidget().selectMinute('30');
widget.dateTimeWidget().clearDateTimeInput(app.FIELD.dateTime_input_id);
it('[C279349] Should be able to have a Date Time widget in a Dynamic Table widget', async () => {
await widget.dynamicTable().clickAddButton();
await widget.dateTimeWidget().openDatepicker(app.FIELD.dateTime_input_id);
await widget.dateTimeWidget().selectDay('10');
await widget.dateTimeWidget().selectHour('8');
await widget.dateTimeWidget().selectMinute('30');
await widget.dateTimeWidget().clearDateTimeInput(app.FIELD.dateTime_input_id);
widget.dynamicTable().clickSaveButton();
widget.dynamicTable().getTableRow(0);
await widget.dynamicTable().clickSaveButton();
await widget.dynamicTable().getTableRow(0);
});
});
@@ -99,7 +99,7 @@ describe('Dynamic Table widget ', () => {
const app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE_USERS;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -120,45 +120,45 @@ describe('Dynamic Table widget ', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(() => {
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await BrowserActions.getUrl(urlToNavigateTo);
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C260407] Should be able to add/delete/update row in Dynamic Table widget', () => {
it('[C260407] Should be able to add/delete/update row in Dynamic Table widget', async () => {
widget.dynamicTable().clickAddRow();
widget.dynamicTable().setDatatableInput('User1');
widget.dynamicTable().clickSaveButton();
expect(widget.dynamicTable().getTableRowText(0)).toEqual('User1');
await widget.dynamicTable().clickAddRow();
await widget.dynamicTable().setDatatableInput('User1');
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User1');
widget.dynamicTable().clickTableRow(0);
widget.dynamicTable().clickEditButton();
widget.dynamicTable().setDatatableInput('User2');
widget.dynamicTable().clickCancelButton();
expect(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');
widget.dynamicTable().clickEditButton();
widget.dynamicTable().setDatatableInput('User2');
widget.dynamicTable().clickSaveButton();
expect(widget.dynamicTable().getTableRowText(0)).toEqual('User2');
await widget.dynamicTable().clickEditButton();
await widget.dynamicTable().setDatatableInput('User2');
await widget.dynamicTable().clickSaveButton();
await expect(await widget.dynamicTable().getTableRowText(0)).toEqual('User2');
widget.dynamicTable().clickAddRow();
widget.dynamicTable().setDatatableInput('User3');
widget.dynamicTable().clickCancelButton();
widget.dynamicTable().checkTableRowIsNotVisible(1);
await widget.dynamicTable().clickAddRow();
await widget.dynamicTable().setDatatableInput('User3');
await widget.dynamicTable().clickCancelButton();
await widget.dynamicTable().checkTableRowIsNotVisible(1);
});
});

View File

@@ -24,7 +24,7 @@ import CONSTANTS = require('../../util/constants');
import { browser } from 'protractor';
import resources = require('../../util/resources');
describe('Header widget', () => {
describe('Header widget', async () => {
const loginPage = new LoginPage();
let processUserModel;
@@ -36,7 +36,7 @@ describe('Header widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.HEADER;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,29 +57,29 @@ describe('Header widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C276737] Should be able to set general and visibility properties for Header widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.header_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.header_id);
it('[C276737] Should be able to set general and visibility properties for Header widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.header_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.header_id);
expect(widget.headerWidget().getFieldLabel(app.FIELD.header_id)).toBe('Header');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await expect(await widget.headerWidget().getFieldLabel(app.FIELD.header_id)).toBe('Header');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
});

View File

@@ -36,7 +36,7 @@ describe('Hyperlink widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.HYPERLINK;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,29 +57,29 @@ describe('Hyperlink widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C276728] Should be able to set visibility properties for Hyperlink widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.hyperlink_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.hyperlink_id);
it('[C276728] Should be able to set visibility properties for Hyperlink widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.hyperlink_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.hyperlink_id);
expect(widget.hyperlink().getFieldLabel(app.FIELD.hyperlink_id)).toBe('Hyperlink');
expect(widget.hyperlink().getFieldText(app.FIELD.hyperlink_id)).toBe('https://www.google.com/');
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/');
});
});

View File

@@ -36,7 +36,7 @@ describe('Multi-line Widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,53 +57,53 @@ describe('Multi-line Widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C268182] Should be able to set general properties for Multi-line Text Widget', () => {
const label = widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple);
expect(label).toBe('multiSimple*');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
const placeHolder = widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple);
expect(placeHolder).toBe('Type something...');
widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
const placeHolder = await widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple);
await expect(placeHolder).toBe('Type something...');
await widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C268184] Should be able to set advanced properties for Multi-line Text Widget', async () => {
widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'A');
expect(widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toBe('Enter at least 4 characters');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAAAAAAAAA');
expect(widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toBe('Enter no more than 10 characters');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAA');
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().isCompleteFormButtonDisabled()).toBeTruthy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAA');
widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, '3');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
expect(widget.multilineTextWidget().getErrorMessage(app.FIELD.multiRegexp)).toBe('Enter a different value');
widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, 'TE');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
await widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, '3');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await 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().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C268232] Should be able to set visibility properties for Multi-line Text Widget', async () => {
widget.textWidget().isWidgetNotVisible(app.FIELD.multiVisible);
widget.textWidget().setValue(app.FIELD.showMultiHidden, '1');
widget.textWidget().isWidgetVisible(app.FIELD.multiVisible);
await widget.textWidget().isWidgetNotVisible(app.FIELD.multiVisible);
await widget.textWidget().setValue(app.FIELD.showMultiHidden, '1');
await widget.textWidget().isWidgetVisible(app.FIELD.multiVisible);
});
});

View File

@@ -37,7 +37,7 @@ describe('Number widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.NUMBER;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -58,50 +58,50 @@ describe('Number widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async() => {
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C269111] Should be able to set general properties for Number Widget', () => {
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
expect(widget.numberWidget().getNumberFieldLabel(app.FIELD.number_general)).toContain('Number General');
expect(widget.numberWidget().getPlaceholder(app.FIELD.number_general)).toContain('Type a number');
it('[C269111] Should be able to set general properties for Number Widget', async () => {
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
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');
widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C274702] Should be able to set advanced and visibility properties for Number Widget', () => {
widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
it('[C274702] Should be able to set advanced and visibility properties for Number Widget', async () => {
await widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
taskPage.formFields().checkWidgetIsHidden(app.FIELD.number_visible);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible);
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.number_visible);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.number_visible);
widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2);
expect(widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be less than 3');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.numberWidget().clearFieldValue(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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101);
expect(widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be greater than 100');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
widget.numberWidget().setFieldValue(app.FIELD.number_visible, 4);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 4);
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
});

View File

@@ -36,7 +36,7 @@ describe('People widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.ADD_PEOPLE;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,44 +57,44 @@ describe('People widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async() => {
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C260435] Should select user from People Widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.widget_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id);
it('[C260435] Should select user from People Widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.widget_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id);
const admin = processUserModel.firstName + ' ' + processUserModel.lastName;
widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0));
widget.peopleWidget().checkDropDownListIsDisplayed();
widget.peopleWidget().checkUserIsListed(admin);
widget.peopleWidget().selectUserFromDropDown(admin);
await widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0));
await widget.peopleWidget().checkDropDownListIsDisplayed();
await widget.peopleWidget().checkUserIsListed(admin);
await widget.peopleWidget().selectUserFromDropDown(admin);
});
it('[C274707] Should be possible to set visibility properties for People Widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.widget_id);
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id);
it('[C274707] Should be possible to set visibility properties for People Widget', async () => {
await taskPage.formFields().checkWidgetIsHidden(app.FIELD.widget_id);
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id);
const admin = processUserModel.firstName + ' ' + processUserModel.lastName;
widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0));
widget.peopleWidget().checkDropDownListIsDisplayed();
widget.peopleWidget().checkUserIsListed(admin);
widget.peopleWidget().selectUserFromDropDown(admin);
await widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0));
await widget.peopleWidget().checkDropDownListIsDisplayed();
await widget.peopleWidget().checkUserIsListed(admin);
await widget.peopleWidget().selectUserFromDropDown(admin);
});
});

View File

@@ -36,7 +36,7 @@ describe('Radio Buttons Widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -59,35 +59,34 @@ describe('Radio Buttons Widget', () => {
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C277316] Should display empty radio buttons when no preselection is configured', () => {
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
widget.radioWidget().isSelectionClean(app.FIELD.radio_buttons_id);
it('[C277316] Should display empty radio buttons when no preselection is configured', async () => {
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await widget.radioWidget().isSelectionClean(app.FIELD.radio_buttons_id);
});
it('[C274704] Should be able to set visibility properties for Radio Button widget', () => {
taskPage.formFields().checkWidgetIsHidden(app.FIELD.radio_buttons_id);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
expect(widget.radioWidget().getRadioWidgetLabel(app.FIELD.radio_buttons_id)).toContain('Radio posts');
widget.radioWidget().selectOption(app.FIELD.radio_buttons_id, 1);
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
await 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().isCompleteFormButtonDisabled()).toBeFalsy();
});
});

View File

@@ -36,7 +36,7 @@ describe('Text widget', () => {
const app = resources.Files.WIDGET_CHECK_APP.TEXT;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -57,64 +57,64 @@ describe('Text widget', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C268157] Should be able to set general properties for Text widget', async () => {
const label = widget.textWidget().getFieldLabel(app.FIELD.simpleText);
expect(label).toBe('textSimple*');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
const placeHolder = widget.textWidget().getFieldPlaceHolder(app.FIELD.simpleText);
expect(placeHolder).toBe('Type something...');
widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
const label = await widget.textWidget().getFieldLabel(app.FIELD.simpleText);
await expect(label).toBe('textSimple*');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
const placeHolder = await widget.textWidget().getFieldPlaceHolder(app.FIELD.simpleText);
await expect(placeHolder).toBe('Type something...');
await widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C268170] Min-max length properties', async () => {
widget.textWidget().setValue(app.FIELD.textMinMax, 'A');
expect(widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toBe('Enter at least 4 characters');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
widget.textWidget().setValue(app.FIELD.textMinMax, 'AAAAAAAAAAA');
expect(widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toBe('Enter no more than 10 characters');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
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().isCompleteFormButtonDisabled()).toBeTruthy();
await widget.textWidget().setValue(app.FIELD.textMinMax, 'AAAAAAAAAAA');
await expect(await widget.textWidget().getErrorMessage(app.FIELD.textMinMax)).toContain('Enter no more than 10 characters');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
});
it('[C268171] Input mask reversed checkbox properties', async () => {
widget.textWidget().setValue(app.FIELD.textMask, '18951523');
expect(widget.textWidget().getFieldValue(app.FIELD.textMask)).toBe('1895-1523');
await widget.textWidget().setValue(app.FIELD.textMask, '18951523');
await expect(await widget.textWidget().getFieldValue(app.FIELD.textMask)).toBe('1895-1523');
});
it('[C268171] Input mask reversed checkbox properties', async () => {
widget.textWidget().setValue(app.FIELD.textMaskReversed, '1234567899');
expect(widget.textWidget().getFieldValue(app.FIELD.textMaskReversed)).toBe('3456-7899');
await widget.textWidget().setValue(app.FIELD.textMaskReversed, '1234567899');
await 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 () => {
widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
widget.textWidget().setValue(app.FIELD.textRegexp, 'T');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
expect(widget.textWidget().getErrorMessage(app.FIELD.textRegexp)).toBe('Enter a different value');
widget.textWidget().setValue(app.FIELD.textRegexp, 'TE');
expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await widget.textWidget().setValue(app.FIELD.simpleText, 'TEST');
await widget.textWidget().setValue(app.FIELD.textRegexp, 'T');
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await 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().isCompleteFormButtonDisabled()).toBeFalsy();
});
it('[C274712] Should be able to set visibility properties for Text widget ', async () => {
widget.textWidget().isWidgetNotVisible(app.FIELD.textHidden);
widget.textWidget().setValue(app.FIELD.showHiddenText, '1');
widget.textWidget().isWidgetVisible(app.FIELD.textHidden);
await widget.textWidget().isWidgetNotVisible(app.FIELD.textHidden);
await widget.textWidget().setValue(app.FIELD.showHiddenText, '1');
await widget.textWidget().isWidgetVisible(app.FIELD.textHidden);
});
});

View File

@@ -59,7 +59,7 @@ describe('Process-Services - Visibility conditions', () => {
const app = resources.Files.WIDGET_CHECK_APP.VISIBILITY;
let deployedApp, process;
beforeAll(async (done) => {
beforeAll(async () => {
const users = new UsersActions();
alfrescoJsApi = new AlfrescoApi({
@@ -80,73 +80,69 @@ describe('Process-Services - Visibility conditions', () => {
});
process = await appsActions.startProcess(alfrescoJsApi, appModel, app.processName);
await loginPage.loginToProcessServicesUsingUserModel(processUserModel);
done();
});
beforeEach(async () => {
const urlToNavigateTo = `${browser.params.testConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`;
await BrowserActions.getUrl(urlToNavigateTo);
taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
taskPage.formFields().checkFormIsDisplayed();
await taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS);
await taskPage.formFields().checkFormIsDisplayed();
});
afterAll(async (done) => {
afterAll(async () => {
await alfrescoJsApi.activiti.processApi.deleteProcessInstance(process.id);
await alfrescoJsApi.login(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
await alfrescoJsApi.activiti.adminTenantsApi.deleteTenant(processUserModel.tenantId);
done();
});
it('[C309647] Should be able to see Checkbox widget when visibility condition refers to another field with specific value', () => {
expect(widget.textWidget().isWidgetVisible(widgets.textOneId)).toBe(true);
expect(widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldValue)).toBe(true);
widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldValue)).toBe(true);
it('[C309647] Should be able to see Checkbox widget when visibility condition refers to another field with specific value', async () => {
await widget.textWidget().isWidgetVisible(widgets.textOneId);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldValue);
await widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldValue);
});
it('[C309648] Should be able to see Checkbox widget when visibility condition refers to a form variable and a field', () => {
it('[C309648] Should be able to see Checkbox widget when visibility condition refers to a form variable and a field', async () => {
widget.textWidget().isWidgetVisible(widgets.textOneId);
expect(widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableField)).toBe(true);
await widget.textWidget().isWidgetVisible(widgets.textOneId);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableField);
widget.textWidget().setValue(widgets.textOneId, value.showVariableFieldCheckbox);
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableField)).toBe(true);
await widget.textWidget().setValue(widgets.textOneId, value.showVariableFieldCheckbox);
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableField);
widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
expect(widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableField)).toBe(true);
await widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxVariableField);
});
it('[C309649] Should be able to see Checkbox widget when visibility condition refers to a field and a form variable', () => {
it('[C309649] Should be able to see Checkbox widget when visibility condition refers to a field and a form variable', async () => {
widget.textWidget().isWidgetVisible(widgets.textOneId);
expect(widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldVariable)).toBe(true);
await widget.textWidget().isWidgetVisible(widgets.textOneId);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldVariable);
widget.textWidget().setValue(widgets.textOneId, value.displayFieldVariableCheckbox);
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldVariable)).toBe(true);
await widget.textWidget().setValue(widgets.textOneId, value.displayFieldVariableCheckbox);
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldVariable);
widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldVariable);
await widget.textWidget().setValue(widgets.textOneId, value.notDisplayCheckbox);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldVariable);
});
it('[C311425] Should be able to see Checkbox widget when visibility condition refers to a field and another field', () => {
it('[C311425] Should be able to see Checkbox widget when visibility condition refers to a field and another field', async () => {
widget.textWidget().isWidgetVisible(widgets.textOneId);
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldField)).toBe(true);
widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
await widget.textWidget().isWidgetVisible(widgets.textOneId);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldField);
await widget.textWidget().setValue(widgets.textOneId, value.displayCheckbox);
expect(widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldField)).toBe(true);
await widget.checkboxWidget().isCheckboxHidden(checkbox.checkboxFieldField);
widget.textWidget().setValue(widgets.textTwoId, value.displayCheckbox);
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldField)).toBe(true);
await widget.textWidget().setValue(widgets.textTwoId, value.displayCheckbox);
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxFieldField);
});
it('[C311424] Should be able to see Checkbox widget when visibility condition refers to a variable with specific value', () => {
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableValue)).toBe(true);
it('[C311424] Should be able to see Checkbox widget when visibility condition refers to a variable with specific value', async () => {
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableValue);
});
it('[C311426] Should be able to see Checkbox widget when visibility condition refers to form variable and another form variable', () => {
expect(widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableVariable)).toBe(true);
it('[C311426] Should be able to see Checkbox widget when visibility condition refers to form variable and another form variable', async () => {
await widget.checkboxWidget().isCheckboxDisplayed(checkbox.checkboxVariableVariable);
});
});