From a13196a83696c92a6b04eeb73713ac9a9be97f76 Mon Sep 17 00:00:00 2001 From: Suzana Dirla Date: Wed, 3 Jul 2019 11:48:14 +0300 Subject: [PATCH] [ADF-4715][ADF-4717] fix process-filter-results random failing tests (#4888) * [ADF-4715] a process never has CREATED status * [ADF-4717] clean up in afterAll * check mediumDate format * check mediumDate format * show more log data * Revert "show more log data" This reverts commit a19c629 --- .../metadata/metadata-smoke-tests.e2e.ts | 2 +- e2e/process-services-cloud/process-filter-results.e2e.ts | 9 +++++++-- e2e/process-services/process-instance-details.e2e.ts | 2 +- e2e/process-services/task-details.e2e.ts | 2 +- e2e/util/constants.js | 2 +- .../components/edit-process-filter-cloud.component.ts | 1 - .../actions/process-instances.service.ts | 8 ++++---- 7 files changed, 15 insertions(+), 11 deletions(-) diff --git a/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts b/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts index 1ff6ca98d5..45bf0b26b4 100644 --- a/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts +++ b/e2e/content-services/metadata/metadata-smoke-tests.e2e.ts @@ -33,7 +33,7 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage'; describe('Metadata component', () => { const METADATA = { - DATA_FORMAT: 'mmm dd, yyyy', + DATA_FORMAT: 'mmm d, yyyy', TITLE: 'Details', COMMENTS_TAB: 'COMMENTS', PROPERTY_TAB: 'PROPERTIES', diff --git a/e2e/process-services-cloud/process-filter-results.e2e.ts b/e2e/process-services-cloud/process-filter-results.e2e.ts index b42cf96cec..f900df48ba 100644 --- a/e2e/process-services-cloud/process-filter-results.e2e.ts +++ b/e2e/process-services-cloud/process-filter-results.e2e.ts @@ -78,7 +78,6 @@ describe('Process filters cloud', () => { processDefinitionService = new ProcessDefinitionsService(apiService); simpleAppProcessDefinition = await processDefinitionService.getProcessDefinitionByName('simpleProcess', simpleApp); processInstancesService = new ProcessInstancesService(apiService); - await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp); differentAppUserProcessInstance = await processInstancesService.createProcessInstance(simpleAppProcessDefinition.entry.key, simpleApp, { 'name': StringUtil.generateRandomString(), 'businessKey': StringUtil.generateRandomString() @@ -87,7 +86,6 @@ describe('Process filters cloud', () => { await apiService.login(testUser.email, testUser.password); processDefinition = await processDefinitionService.getProcessDefinitionByName('candidateGroupProcess', candidateBaseApp); anotherProcessDefinition = await processDefinitionService.getProcessDefinitionByName('anotherCandidateGroupProcess', candidateBaseApp); - await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp); runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, { 'name': StringUtil.generateRandomString(), @@ -127,6 +125,13 @@ describe('Process filters cloud', () => { }); afterAll(async (done) => { + await processInstancesService.deleteProcessInstance(runningProcessInstance.entry.id, candidateBaseApp); + await processInstancesService.deleteProcessInstance(anotherProcessInstance.entry.id, candidateBaseApp); + await processInstancesService.deleteProcessInstance(suspendProcessInstance.entry.id, candidateBaseApp); + + await apiService.login(anotherUser.email, anotherUser.password); + await processInstancesService.deleteProcessInstance(differentAppUserProcessInstance.entry.id, simpleApp); + await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); await identityService.deleteIdentityUser(testUser.idIdentityService); await identityService.deleteIdentityUser(anotherUser.idIdentityService); diff --git a/e2e/process-services/process-instance-details.e2e.ts b/e2e/process-services/process-instance-details.e2e.ts index 6b1be30596..3e6b453d4f 100644 --- a/e2e/process-services/process-instance-details.e2e.ts +++ b/e2e/process-services/process-instance-details.e2e.ts @@ -40,7 +40,7 @@ describe('Process Instance Details', () => { let appModel, process, user; const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - const PROCESS_DATE_FORMAT = 'mmm dd, yyyy'; + const PROCESS_DATE_FORMAT = 'mmm d, yyyy'; beforeAll(async (done) => { const apps = new AppsActions(); diff --git a/e2e/process-services/task-details.e2e.ts b/e2e/process-services/task-details.e2e.ts index 94cda8723b..a6f43bbb12 100644 --- a/e2e/process-services/task-details.e2e.ts +++ b/e2e/process-services/task-details.e2e.ts @@ -38,7 +38,7 @@ describe('Task Details component', () => { let processUserModel, appModel; const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; - const TASK_DATE_FORMAT = 'mmm dd, yyyy'; + const TASK_DATE_FORMAT = 'mmm d, yyyy'; let formModel; let apps; diff --git a/e2e/util/constants.js b/e2e/util/constants.js index 649a3b2e2d..c5182a8f72 100644 --- a/e2e/util/constants.js +++ b/e2e/util/constants.js @@ -118,7 +118,7 @@ exports.PROCESS_BUSINESS_KEY = "None"; exports.PROCESS_DESCRIPTION = "No description"; -exports.PROCESS_DATE_FORMAT = "mmm dd, yyyy"; +exports.PROCESS_DATE_FORMAT = "mmm d, yyyy"; exports.PROCESS_DETAILS = { NO_PARENT: "None", diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts index 60a652d011..d873ecaa80 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts @@ -90,7 +90,6 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges { status = [ { label: 'ALL', value: '' }, - { label: 'CREATED', value: 'CREATED' }, { label: 'RUNNING', value: 'RUNNING' }, { label: 'SUSPENDED', value: 'SUSPENDED' }, { label: 'CANCELLED', value: 'CANCELLED' }, diff --git a/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts b/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts index e476bbe7ad..c4a7075450 100644 --- a/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts +++ b/lib/testing/src/lib/process-services-cloud/actions/process-instances.service.ts @@ -40,7 +40,7 @@ export class ProcessInstancesService { } catch (error) { // tslint:disable-next-line:no-console - console.log('create process-instances Service not working'); + console.log('create process-instances Service not working', error.message); } } @@ -56,7 +56,7 @@ export class ProcessInstancesService { } catch (error) { // tslint:disable-next-line:no-console - console.log('suspend process-instances Service not working'); + console.log('suspend process-instances Service not working', error.message); } } @@ -71,7 +71,7 @@ export class ProcessInstancesService { } catch (error) { // tslint:disable-next-line:no-console - console.log('delete process-instances Service not working'); + console.log('delete process-instances Service not working', error.message); } } @@ -87,7 +87,7 @@ export class ProcessInstancesService { } catch (error) { // tslint:disable-next-line:no-console - console.log('complete process-instances Service not working'); + console.log('complete process-instances Service not working', error.message); } } }