From 29abd0e22c1d06884e96ea9eecdf5a94cd160f36 Mon Sep 17 00:00:00 2001 From: jdosti Date: Thu, 26 Jul 2018 10:30:16 +0100 Subject: [PATCH] [ADF-3321] Create an automated test for the Share knowledge functionality (#3623) --- .../task_attachmentList_actionMenu.e2e.ts | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/e2e/process-services/task_attachmentList_actionMenu.e2e.ts b/e2e/process-services/task_attachmentList_actionMenu.e2e.ts index 3201f0f82c..dc804bb2e3 100644 --- a/e2e/process-services/task_attachmentList_actionMenu.e2e.ts +++ b/e2e/process-services/task_attachmentList_actionMenu.e2e.ts @@ -48,7 +48,7 @@ describe('Attachment list action menu for tasks', () => { name: resources.Files.ADF_DOCUMENTS.PNG.file_name }); let downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name); - let tenantId, appId; + let tenantId, appId, relatedContent, relatedContentId; let taskName = { active: 'Active Task', completed: 'Completed Task', @@ -175,4 +175,36 @@ describe('Attachment list action menu for tasks', () => { attachmentListPage.checkEmptyAttachmentList(); }); + it('[C260234] Should be able to attache a file on a task on APS and check on ADF', () => { + browser.controlFlow().execute(async() => { + let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: "SHARE KNOWLEDGE"}); + + let newTaskId = newTask.id; + + let filePath = path.join(TestConfig.main.rootPath + pngFile.location); + + let file = fs.createReadStream(filePath); + + relatedContent = await this.alfrescoJsApi.activiti.contentApi.createRelatedContentOnTask(newTaskId, file, {'isRelatedContent': true}); + relatedContentId = relatedContent.id; + }); + + processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton(); + + taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); + taskPage.usingTasksListPage().selectTaskFromTasksList('SHARE KNOWLEDGE'); + + attachmentListPage.checkFileIsAttached(pngFile.name); + + browser.controlFlow().execute(async() => { + await this.alfrescoJsApi.activiti.contentApi.deleteContent(relatedContentId); + }); + + processServicesPage.goToProcessServices().goToTaskApp().clickTasksButton(); + + taskPage.usingFiltersPage().goToFilter(CONSTANTS.TASKFILTERS.MY_TASKS); + taskPage.usingTasksListPage().selectTaskFromTasksList('SHARE KNOWLEDGE'); + + attachmentListPage.checkEmptyAttachmentList(); + }); });