diff --git a/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts b/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts index 81e38f8a1b..b75b13af3f 100644 --- a/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts +++ b/e2e/process-services-cloud/process-task-attach-content-file-cloud.e2e.ts @@ -70,26 +70,26 @@ describe('Process Task - Attach content file', () => { 'location': browser.params.resources.Files.ADF_DOCUMENTS.PDF_B.file_path }; - beforeAll(async () => { + beforeAll(async (done) => { await apiService.login(browser.params.testConfig.hrUser.email, browser.params.testConfig.hrUser.password); + const processDefinition = await processDefinitionService.getProcessDefinitionByName(processDefinitionName, simpleApp); processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp, { name: 'upload process' }); await apiService.getInstance().login(browser.params.testConfig.hrUser.email, browser.params.testConfig.hrUser.password); uploadedFolder = await uploadActions.createFolder(folderName, '-my-'); await uploadActions.uploadFile(pdfFileOne.location, pdfFileOne.name, uploadedFolder.entry.id); await uploadActions.uploadFile(pdfFileTwo.location, pdfFileTwo.name, uploadedFolder.entry.id); + + await loginSSOPage.login(browser.params.testConfig.hrUser.email, browser.params.testConfig.hrUser.password); + await navigationBarPage.navigateToProcessServicesCloudPage(); + await appListCloudComponent.checkApsContainer(); + done(); }); afterAll(async () => { await uploadActions.deleteFileOrFolder(uploadedFolder.entry.id); }); - beforeEach(async () => { - await loginSSOPage.login(browser.params.testConfig.hrUser.email, browser.params.testConfig.hrUser.password); - await navigationBarPage.navigateToProcessServicesCloudPage(); - await appListCloudComponent.checkApsContainer(); - }); - it('[C311290] Should be able to attach multiple files when widget allows multiple files to be attached from content', async () => { await appListCloudComponent.checkAppIsDisplayed(simpleApp); await appListCloudComponent.goToApp(simpleApp); 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 433cf28f3a..2f314eb2d0 100644 --- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts @@ -304,8 +304,8 @@ describe('Start Task Form', () => { await taskFormCloudComponent.clickClaimButton(); const localFileWidget = await widget.attachFileWidgetCloud('Attachlocalfile'); - await browser.sleep(5000); - await localFileWidget.attachLocalFile(pdfFile.location); + await localFileWidget.clickAttachContentFile('Attachlocalfile'); + await contentNodeSelectorDialogPage.attachFileFromLocal(pdfFile.name, pdfFile.location); await localFileWidget.checkFileIsAttached(pdfFile.name); await localFileWidget.removeFile(pdfFile.name); await localFileWidget.checkFileIsNotAttached(pdfFile.name); diff --git a/e2e/protractor.excludes.json b/e2e/protractor.excludes.json index f832f46b39..6661891991 100644 --- a/e2e/protractor.excludes.json +++ b/e2e/protractor.excludes.json @@ -4,8 +4,6 @@ "C362240": "Include once ADF starts using ACS 7 , https://issues.alfresco.com/jira/browse/ADF-5182", "C362241": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182", "C362242": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182", - "C362265": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182", - "C310358": "Include once process storage services removed, https://issues.alfresco.com/jira/browse/AAE-3177", - "C311290": "Include once process storage services removed, https://issues.alfresco.com/jira/browse/AAE-3177" + "C362265": "Include once ADF starts using ACS 7, https://issues.alfresco.com/jira/browse/ADF-5182" } 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 8f223a227f..73bac4f655 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 @@ -15,7 +15,8 @@ * limitations under the License. */ -import { by, element } from 'protractor'; +import { by, element, browser } from 'protractor'; +import * as remote from 'selenium-webdriver/remote'; import { DocumentListPage } from '../pages/document-list.page'; import { BrowserVisibility } from '../../core/utils/browser-visibility'; import { BrowserActions } from '../../core/utils/browser-actions'; @@ -129,6 +130,23 @@ export class ContentNodeSelectorDialogPage { await this.clickMoveCopyButton(); } + async attachFileFromLocal(fileName: string, fileLocation: string): Promise { + await this.checkDialogIsDisplayed(); + + await browser.setFileDetector(new remote.FileDetector()); + const uploadButton = element(by.css('adf-upload-button input')); + await BrowserVisibility.waitUntilElementIsPresent(uploadButton); + await uploadButton.sendKeys(fileLocation); + + await this.dataTable.waitForTableBody(); + await this.dataTable.waitTillContentLoaded(); + await this.dataTable.checkRowContentIsDisplayed(fileName); + + await this.clickContentNodeSelectorResult(fileName); + await this.checkCopyMoveButtonIsEnabled(); + await this.clickMoveCopyButton(); + } + async searchAndSelectResult(searchText: string, name: string) { await this.typeIntoNodeSelectorSearchField(searchText); try { diff --git a/lib/testing/src/lib/core/pages/info-drawer.page.ts b/lib/testing/src/lib/core/pages/info-drawer.page.ts index ca0664355e..cc738c691f 100644 --- a/lib/testing/src/lib/core/pages/info-drawer.page.ts +++ b/lib/testing/src/lib/core/pages/info-drawer.page.ts @@ -65,7 +65,7 @@ export class InfoDrawerPage { } } - async getNoOfTabs(): Promise { + async getNoOfTabs(): Promise { return this.tabsPage.getNoOfTabs(); } diff --git a/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts b/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts index a96baafef1..de2565ee8f 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/form/widget/attach-file-widget-cloud.page.ts @@ -38,6 +38,7 @@ export class AttachFileWidgetCloudPage { const uploadButton = element(by.css('adf-upload-button input')); await BrowserVisibility.waitUntilElementIsPresent(uploadButton); await uploadButton.sendKeys(fileLocation); + await BrowserActions.click(uploadButton); await BrowserVisibility.waitUntilElementIsPresent(uploadButton); }