From 4d0c98d753200445321241c127d775c29c780152 Mon Sep 17 00:00:00 2001 From: Geeta Mandakini Ayyalasomayajula <45559635+gmandakini@users.noreply.github.com> Date: Tue, 2 Jul 2019 22:00:14 +0100 Subject: [PATCH] [ADF-4697] attach content to processcloudtaskform using upload widget (#4882) * automated upload local and content file from task from upload widget. * automated upload local and content file from task from upload widget. * reverting the git ignore change * updated the app with the new process definition using the form with upload widgets * Save error screenshot * creating the processes through api call rather than through ui. and added -log to watch the travis build on process-cloud * creating the processes through api call rather than through ui. and added -log to watch the travis build on process-cloud * removed the wait till clickable, as not relevant here. * Update process-services-cloud-e2e.sh --- .../breadcrumb/breadCrumbDropdownPage.ts | 5 + .../start-task-form-cloud.e2e.ts | 303 +++++++++++++++++- e2e/resources/activiti7/candidatebaseapp.zip | Bin 5976 -> 9206 bytes .../content-node-selector-dialog.page.ts | 8 + .../core/pages/data-table-component.page.ts | 13 + .../form/widgets/attachFileWidgetCloud.ts | 94 ++++++ .../src/lib/core/pages/form/widgets/widget.ts | 5 + .../src/lib/core/pages/settings.page.ts | 17 + .../pages/task-form-cloud-component.page.ts | 5 + .../pages/task-list-cloud-component.page.ts | 4 + 10 files changed, 444 insertions(+), 10 deletions(-) create mode 100644 lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts diff --git a/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts b/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts index 0504bed96e..caa2995796 100644 --- a/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts +++ b/e2e/pages/adf/content-services/breadcrumb/breadCrumbDropdownPage.ts @@ -23,6 +23,7 @@ export class BreadCrumbDropdownPage { breadCrumb = element(by.css(`adf-dropdown-breadcrumb[data-automation-id='content-node-selector-content-breadcrumb']`)); parentFolder = this.breadCrumb.element(by.css(`button[data-automation-id='dropdown-breadcrumb-trigger']`)); breadCrumbDropdown = element(by.css(`div[class*='mat-select-panel']`)); + currentFolder = this.breadCrumb.element(by.css(`div span[data-automation-id="current-folder"]`)); choosePath(pathName) { const path = this.breadCrumbDropdown.element(by.cssContainingText(`mat-option[data-automation-class='dropdown-breadcrumb-path-option'] span[class='mat-option-text']`, @@ -38,4 +39,8 @@ export class BreadCrumbDropdownPage { checkBreadCrumbDropdownIsDisplayed() { BrowserVisibility.waitUntilElementIsVisible(this.breadCrumbDropdown); } + + getTextOfCurrentFolder() { + return BrowserActions.getText(this.currentFolder); + } } diff --git a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts index 0eb5ac0d17..e846fe22f5 100644 --- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts @@ -28,12 +28,25 @@ import { SettingsPage, GroupIdentityService, TaskFormCloudComponent, - Widget, LocalStorageUtil, StartProcessCloudPage, TaskHeaderCloudPage, ProcessHeaderCloudPage, TasksService + Widget, + LocalStorageUtil, + StartProcessCloudPage, + TaskHeaderCloudPage, + ProcessHeaderCloudPage, + TasksService, + UploadActions, + ContentNodeSelectorDialogPage, + ProcessInstancesService, + ProcessDefinitionsService } from '@alfresco/adf-testing'; import resources = require('../util/resources'); import { StartProcessCloudConfiguration } from './config/start-process-cloud.config'; import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/processCloudDemoPage'; import { ProcessDetailsCloudDemoPage } from '../pages/adf/demo-shell/process-services-cloud/processDetailsCloudDemoPage'; +import { FileModel } from '../models/ACS/fileModel'; +import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; +import { AcsUserModel } from '../models/ACS/acsUserModel'; +import { BreadCrumbDropdownPage } from '../pages/adf/content-services/breadcrumb/breadCrumbDropdownPage'; describe('Start Task Form', () => { @@ -43,6 +56,8 @@ describe('Start Task Form', () => { const appListCloudComponent = new AppListCloudPage(); const tasksCloudDemoPage = new TasksCloudDemoPage(); const startTask = new StartTasksCloudPage(); + const contentNodeSelectorDialogPage = new ContentNodeSelectorDialogPage(); + const breadCrumbDropdownPage = new BreadCrumbDropdownPage(); const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage(); const settingsPage = new SettingsPage(); const widget = new Widget(); @@ -54,18 +69,39 @@ describe('Start Task Form', () => { browser.params.config.oauth2.clientId, browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers ); + this.alfrescoJsApi = new AlfrescoApi({ + provider: 'ECM', + hostEcm: browser.params.config.bpmHost + }); + const uploadActions = new UploadActions(this.alfrescoJsApi); + const startProcessCloudConfiguration = new StartProcessCloudConfiguration(); const startProcessCloudConfig = startProcessCloudConfiguration.getConfiguration(); const standaloneTaskName = StringUtil.generateRandomString(5); const startEventFormProcess = StringUtil.generateRandomString(5); - let testUser, groupInfo, processId, taskId; + let testUser, acsUser, groupInfo; + let processDefinitionService: ProcessDefinitionsService; + let processInstancesService: ProcessInstancesService; + let processDefinition, uploadLocalFileProcess, uploadContentFileProcess, uploadDefaultFileProcess, cancelUploadFileProcess, completeUploadFileProcess; const candidateBaseApp = resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.name; + const pdfFile = new FileModel({'name': resources.Files.ADF_DOCUMENTS.PDF.file_name}); + const pdfFileModel = new FileModel({ + 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, + 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location + }); + const testFileModel = new FileModel({ + 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, + 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location + }); let identityService: IdentityService; let groupIdentityService: GroupIdentityService; + const folderName = StringUtil.generateRandomString(5); + let uploadedFolder; beforeAll(async (done) => { + await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); identityService = new IdentityService(apiService); @@ -73,12 +109,58 @@ describe('Start Task Form', () => { testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.APS_USER]); groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr'); await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id); - await apiService.login(testUser.email, testUser.password); - await settingsPage.setProviderBpmSso( + await apiService.login(testUser.email, testUser.password); + processDefinitionService = new ProcessDefinitionsService(apiService); + processInstancesService = new ProcessInstancesService(apiService); + processDefinition = await processDefinitionService.getProcessDefinitionByName('uploadFileProcess', candidateBaseApp); + await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp); + + uploadLocalFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, { + 'name': StringUtil.generateRandomString(), + 'businessKey': StringUtil.generateRandomString() + }); + + uploadContentFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, { + 'name': StringUtil.generateRandomString(), + 'businessKey': StringUtil.generateRandomString() + }); + + uploadDefaultFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, { + 'name': StringUtil.generateRandomString(), + 'businessKey': StringUtil.generateRandomString() + }); + + cancelUploadFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, { + 'name': StringUtil.generateRandomString(), + 'businessKey': StringUtil.generateRandomString() + }); + + completeUploadFileProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp, { + 'name': StringUtil.generateRandomString(), + 'businessKey': StringUtil.generateRandomString() + }); + + acsUser = await new AcsUserModel({ + email: testUser.email, + password: testUser.password, + id: testUser.username, + firstName: testUser.firstName, + lastName: testUser.lastName + }); + await this.alfrescoJsApi.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); + await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser); + await this.alfrescoJsApi.login(acsUser.id, acsUser.password); + uploadedFolder = await uploadActions.createFolder(folderName, '-my-'); + await uploadActions.uploadFile(testFileModel.location, testFileModel.name, uploadedFolder.entry.id); + await uploadActions.uploadFile(pdfFileModel.location, pdfFileModel.name, uploadedFolder.entry.id); + + await settingsPage.setProviderEcmBpmSso( + browser.params.config.bpmHost, browser.params.config.bpmHost, browser.params.config.oauth2.host, - browser.params.config.identityHost); + browser.params.config.identityHost, + 'alfresco'); loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password); await LocalStorageUtil.setConfigField('adf-cloud-start-process', JSON.stringify(startProcessCloudConfig)); done(); @@ -86,11 +168,12 @@ describe('Start Task Form', () => { afterAll(async (done) => { try { + await this.alfrescoJsApi.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); + await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id); await apiService.login(testUser.email, testUser.password); const tasksService = new TasksService(apiService); - const taskID = await tasksService.getTaskId(standaloneTaskName, candidateBaseApp); - await tasksService.deleteTask(taskID, candidateBaseApp); - await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password); + const standAloneTaskId = await tasksService.getTaskId(standaloneTaskName, candidateBaseApp); + await tasksService.deleteTask(standAloneTaskId, candidateBaseApp); await identityService.deleteIdentityUser(testUser.idIdentityService); } catch (error) { } @@ -154,6 +237,7 @@ describe('Start Task Form', () => { startProcessPage.selectFromProcessDropdown('processwithstarteventform'); startProcessPage.formFields().checkFormIsDisplayed(); }); + it('[C311277] Should be able to start a process with a start event form - default values', async () => { expect(widget.textWidget().getFieldValue('FirstName')).toBe('sample name'); @@ -191,10 +275,10 @@ describe('Start Task Form', () => { processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', startEventFormProcess); processDetailsCloudDemoPage.checkTaskIsDisplayed('StartEventFormTask'); - processId = await processHeaderCloud.getId(); + const processId = await processHeaderCloud.getId(); processDetailsCloudDemoPage.selectProcessTaskByName('StartEventFormTask'); taskFormCloudComponent.clickClaimButton(); - taskId = await taskHeaderCloudPage.getId(); + const taskId = await taskHeaderCloudPage.getId(); taskFormCloudComponent.checkCompleteButtonIsDisplayed().clickCompleteButton(); expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks'); tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); @@ -208,4 +292,203 @@ describe('Start Task Form', () => { }); }); + + describe('Attach content to process-cloud task form using upload widget', async () => { + + beforeEach(async (done) => { + navigationBarPage.navigateToProcessServicesCloudPage(); + appListCloudComponent.checkApsContainer(); + appListCloudComponent.checkAppIsDisplayed(candidateBaseApp); + appListCloudComponent.goToApp(candidateBaseApp); + processCloudDemoPage.clickOnProcessFilters(); + processCloudDemoPage.runningProcessesFilter().clickProcessFilter(); + processCloudDemoPage.processListCloudComponent().checkProcessListIsLoaded(); + done(); + }); + + it('[C310358] Should be able to attach a file to a form from local', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadLocalFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadLocalFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + taskFormCloudComponent.clickClaimButton(); + + const localFileWidget = widget.attachFileWidgetCloud('Attachlocalfile'); + browser.sleep(5000); + localFileWidget.attachLocalFile(pdfFile.location); + localFileWidget.checkFileIsAttached(pdfFile.name); + localFileWidget.removeFile(pdfFile.name); + localFileWidget.checkFileIsNotAttached(pdfFile.name); + }); + + it('[C311285] Should be able to attach a file to a form from acs repository', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + taskFormCloudComponent.clickClaimButton(); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name); + + contentNodeSelectorDialogPage.clickMoveCopyButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.removeFile(testFileModel.name); + contentFileWidget.checkFileIsNotAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsDisplayed('Attachsinglecontentfile'); + }); + + it('[C311287] Content node selector default location when attaching a file to a form from acs repository', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadDefaultFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadDefaultFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + taskFormCloudComponent.clickClaimButton(); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + expect(breadCrumbDropdownPage.getTextOfCurrentFolder()).toBe(testUser.username); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowContentIsDisplayed(folderName); + expect(contentNodeSelectorDialogPage.checkCancelButtonIsEnabled()).toBe(true); + expect(contentNodeSelectorDialogPage.checkCopyMoveButtonIsEnabled()).toBe(false); + + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(folderName); + expect(contentNodeSelectorDialogPage.checkCancelButtonIsEnabled()).toBe(true); + expect(contentNodeSelectorDialogPage.checkCopyMoveButtonIsEnabled()).toBe(false); + contentNodeSelectorDialogPage.clickCancelButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + }); + + it('[C311288] No file should be attached when canceling the content node selector', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(cancelUploadFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', cancelUploadFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + taskFormCloudComponent.clickClaimButton(); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowContentIsDisplayed(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name); + + contentNodeSelectorDialogPage.clickCancelButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + contentFileWidget.checkFileIsNotAttached(testFileModel.name); + }); + + it('[C311289] Should be able to attach single file', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name); + + contentNodeSelectorDialogPage.clickMoveCopyButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile'); + }); + + it('[C311292] Attached file is not displayed anymore after release if the form is not saved', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name); + + contentNodeSelectorDialogPage.clickMoveCopyButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile'); + taskFormCloudComponent.clickReleaseButton(); + taskFormCloudComponent.clickClaimButton(); + contentFileWidget.checkFileIsNotAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsDisplayed('Attachsinglecontentfile'); + }); + + it('[C311293] Attached file is displayed after release if the form was saved', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(uploadContentFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', uploadContentFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name); + contentNodeSelectorDialogPage.clickMoveCopyButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile'); + taskFormCloudComponent.clickSaveButton(); + taskFormCloudComponent.clickReleaseButton(); + taskFormCloudComponent.clickClaimButton(); + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile'); + }); + + it('[C311295] Attached file is displayed after complete', async () => { + processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedByName(completeUploadFileProcess.entry.name); + processCloudDemoPage.processListCloudComponent().getDataTable().selectRow('Name', completeUploadFileProcess.entry.name); + processDetailsCloudDemoPage.checkTaskIsDisplayed('UploadFileTask'); + processDetailsCloudDemoPage.selectProcessTaskByName('UploadFileTask'); + taskFormCloudComponent.clickClaimButton(); + + const contentFileWidget = widget.attachFileWidgetCloud('Attachsinglecontentfile'); + contentFileWidget.clickAttachContentFile('Attachsinglecontentfile'); + contentNodeSelectorDialogPage.checkDialogIsDisplayed(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().doubleClickRowByContent(folderName); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().waitTillContentLoaded(); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().clickRowByContent(testFileModel.name); + contentNodeSelectorDialogPage.contentListPage().dataTablePage().checkRowByContentIsSelected(testFileModel.name); + contentNodeSelectorDialogPage.clickMoveCopyButton(); + contentNodeSelectorDialogPage.checkDialogIsNotDisplayed(); + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile'); + const taskId = await taskHeaderCloudPage.getId(); + taskFormCloudComponent.checkCompleteButtonIsDisplayed().clickCompleteButton(); + expect(tasksCloudDemoPage.getActiveFilterName()).toBe('My Tasks'); + tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedById(taskId); + + tasksCloudDemoPage.completedTasksFilter().clickTaskFilter(); + tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedById(taskId); + tasksCloudDemoPage.taskListCloudComponent().selectRowByTaskId(taskId); + contentFileWidget.checkFileIsAttached(testFileModel.name); + contentFileWidget.checkUploadContentButtonIsNotDisplayed('Attachsinglecontentfile'); + }); + }); }); diff --git a/e2e/resources/activiti7/candidatebaseapp.zip b/e2e/resources/activiti7/candidatebaseapp.zip index 318d6be329b32b7d54aca0a95481ffc5cee71713..5df5689ba428776b1047e36b78c0eb31b04c2557 100644 GIT binary patch literal 9206 zcmb7}1yodP*T?CS?(PynN;-#l14&0q}w5+q)|#hx{>Y%LAr!*(EDD| z^dHBNK+R8Gr7o~*_)n_jEX>rcZb{+Yr!szDS>%;XlF>m1${@b&H-QUypw{ zvo0$Ne>GLNC9PbtsU&ozZe%qDVY5_L>*ld{{Y`fx+ez$zRtOvoDrHx8nFpQwjVUq2P&y zLVz?p7Zg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eQW?=^QIj7yWie7 z>C)-ZGp;bu*6-2j)YTH!($f~!*Ao_iVb2QbhzMbNdI_~HgoX(I9OUfeHPs63nKi*b z4I7Yv0r2fyXz%a&Gw^evZ)5*ZzcVF*>3qA?K?97xTkMD4-pl=^{@c<2*No_JAqNdA z-f!KNN0Gq-j8IO-!1I#$Mt{W?!zS>q&YmV?nf*w;NP$; VOoxaVzX;jhLzoBvV4}mn`yWi6VHyAc diff --git a/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts b/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts index 132e75be19..e4a80e3b95 100644 --- a/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts +++ b/lib/testing/src/lib/content-services/dialog/content-node-selector-dialog.page.ts @@ -65,6 +65,14 @@ export class ContentNodeSelectorDialogPage { return BrowserActions.click(this.cancelButton); } + checkCancelButtonIsEnabled() { + return this.cancelButton.isEnabled(); + } + + checkCopyMoveButtonIsEnabled() { + return this.moveCopyButton.isEnabled(); + } + checkMoveCopyButtonIsDisplayed() { BrowserVisibility.waitUntilElementIsVisible(this.moveCopyButton); } diff --git a/lib/testing/src/lib/core/pages/data-table-component.page.ts b/lib/testing/src/lib/core/pages/data-table-component.page.ts index f3a4487f13..fb974a02ec 100644 --- a/lib/testing/src/lib/core/pages/data-table-component.page.ts +++ b/lib/testing/src/lib/core/pages/data-table-component.page.ts @@ -329,6 +329,19 @@ export class DataTableComponentPage { BrowserActions.click(resultElement); } + checkRowContentIsDisplayed(content) { + const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${content}']`)).first(); + BrowserVisibility.waitUntilElementIsVisible(resultElement); + return this; + } + + doubleClickRowByContent(name) { + const resultElement = this.rootElement.all(by.css(`div[data-automation-id='${name}']`)).first(); + BrowserActions.click(resultElement); + browser.actions().sendKeys(protractor.Key.ENTER).perform(); + return this; + } + getCopyContentTooltip() { return BrowserActions.getText(this.copyColumnTooltip); } diff --git a/lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts b/lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts new file mode 100644 index 0000000000..1cbbb2385a --- /dev/null +++ b/lib/testing/src/lib/core/pages/form/widgets/attachFileWidgetCloud.ts @@ -0,0 +1,94 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { FormFields } from '../formFields'; +import { BrowserVisibility, BrowserActions } from '../../../utils/public-api'; +import * as remote from 'selenium-webdriver/remote'; +import { element, by, browser, ElementFinder } from 'protractor'; + +export class AttachFileWidgetCloud { + + widget: ElementFinder; + constructor(fieldId: string) { + this.widget = this.formFields.getWidget(fieldId); + } + + formFields = new FormFields(); + contentButton = element(by.css('button[id="attach-Alfresco Content"]')); + filesListLocator = by.css('div[id="adf-attach-widget-readonly-list"]'); + + attachLocalFile(fileLocation: string) { + browser.setFileDetector(new remote.FileDetector()); + const uploadButton = this.widget.element(by.css(`a input`)); + BrowserVisibility.waitUntilElementIsVisible(uploadButton); + uploadButton.sendKeys(browser.params.rootPath + '/e2e' + fileLocation); + BrowserVisibility.waitUntilElementIsVisible(uploadButton); + return this; + } + + clickAttachContentFile(fileId: string) { + const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`)); + BrowserActions.click(uploadButton); + BrowserActions.click(this.contentButton); + + } + + checkUploadContentButtonIsDisplayed(fileId: string) { + const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`)); + BrowserVisibility.waitUntilElementIsVisible(uploadButton); + return this; + } + + checkUploadContentButtonIsNotDisplayed(fileId: string) { + const uploadButton = this.widget.element(by.css(`button[id=${fileId}]`)); + BrowserVisibility.waitUntilElementIsNotVisible(uploadButton); + return this; + } + + checkFileIsAttached(name) { + const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); + BrowserVisibility.waitUntilElementIsVisible(fileAttached); + return this; + } + + checkFileIsNotAttached(name) { + const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); + BrowserVisibility.waitUntilElementIsNotVisible(fileAttached); + return this; + } + + async getFileId(name: string) { + const fileAttached = this.widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); + BrowserVisibility.waitUntilElementIsVisible(fileAttached); + const fileId = await fileAttached.getAttribute('id'); + return fileId; + } + + async removeFile(fileName: string) { + const fileId = await this.getFileId(fileName); + const deleteButton = this.widget.element(by.css(`button[id='${fileId}-remove']`)); + BrowserActions.click(deleteButton); + return this; + } + + viewFile(name) { + const fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); + BrowserActions.click(fileView); + browser.actions().doubleClick(fileView).perform(); + return this; + } +} diff --git a/lib/testing/src/lib/core/pages/form/widgets/widget.ts b/lib/testing/src/lib/core/pages/form/widgets/widget.ts index 8b4acb880a..38c151f3a1 100644 --- a/lib/testing/src/lib/core/pages/form/widgets/widget.ts +++ b/lib/testing/src/lib/core/pages/form/widgets/widget.ts @@ -33,6 +33,7 @@ import { AmountWidget } from './amountWidget'; import { ContainerWidget } from './containerWidget'; import { PeopleWidget } from './peopleWidget'; import { DocumentWidget } from './documentWidget'; +import { AttachFileWidgetCloud } from './attachFileWidgetCloud'; export class Widget { @@ -52,6 +53,10 @@ export class Widget { return new AttachFileWidget(); } + attachFileWidgetCloud(fieldId: string) { + return new AttachFileWidgetCloud(fieldId); + } + displayValueWidget() { return new DisplayValueWidget(); } diff --git a/lib/testing/src/lib/core/pages/settings.page.ts b/lib/testing/src/lib/core/pages/settings.page.ts index 3451afb103..685cd545d7 100644 --- a/lib/testing/src/lib/core/pages/settings.page.ts +++ b/lib/testing/src/lib/core/pages/settings.page.ts @@ -169,6 +169,23 @@ export class SettingsPage { await browser.sleep(1000); } + async setProviderEcmBpmSso(contentServicesURL: string, processServiceURL, authHost, identityHost, clientId: string, silentLogin = true, implicitFlow = true) { + await this.goToSettingsPage(); + this.setProvider(this.ecmAndBpm.option, this.ecmAndBpm.text); + BrowserVisibility.waitUntilElementIsVisible(this.bpmText); + BrowserVisibility.waitUntilElementIsVisible(this.ecmText); + this.clickSsoRadioButton(); + this.setClientId(clientId); + this.setContentServicesURL(contentServicesURL); + this.setProcessServicesURL(processServiceURL); + this.setAuthHost(authHost); + this.setIdentityHost(identityHost); + this.setSilentLogin(silentLogin); + this.setImplicitFlow(implicitFlow); + await this.clickApply(); + await browser.sleep(1000); + } + async setLogoutUrl(logoutUrl) { BrowserVisibility.waitUntilElementIsPresent(this.logoutUrlText); this.logoutUrlText.clear(); diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts index 90fe1c809a..9b468c2e6a 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/task-form-cloud-component.page.ts @@ -54,6 +54,11 @@ export class TaskFormCloudComponent { return this; } + clickReleaseButton() { + BrowserActions.click(this.releaseButton); + return this; + } + formFields() { return new FormFields(); } diff --git a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts index 8fae156284..13b92a2a88 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/task-list-cloud-component.page.ts @@ -79,6 +79,10 @@ export class TaskListCloudComponentPage { return this.dataTable.selectRow(column.name, taskName); } + selectRowByTaskId(taskId: string) { + return this.dataTable.selectRow(column.id, taskId); + } + getRow(taskName) { return this.dataTable.getCellElementByValue(column.name, taskName); }