From 05ce5297040df00e375e6969b3947aab92f0d91a Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Wed, 9 Oct 2019 13:57:03 +0100 Subject: [PATCH] [AAE-550] Fix PS cloud test (#5139) * fix PS cloud test * fix spell * separate e2e ps form ps-cloud --- cspell.json | 4 +++- .../process-services/processCloudDemoPage.ts | 2 +- .../demo-shell/process-services/tasksCloudDemoPage.ts | 9 ++++----- .../start-task-form-cloud.e2e.ts | 8 ++++---- e2e/process-services-cloud/task-list-selection.e2e.ts | 11 +---------- e2e/util/resources.js | 4 ++++ scripts/travis/e2e/process-services-cloud-e2e.sh | 2 +- scripts/travis/e2e/process-services-e2e.sh | 2 +- 8 files changed, 19 insertions(+), 23 deletions(-) diff --git a/cspell.json b/cspell.json index 0d062bca4a..205a5645a9 100644 --- a/cspell.json +++ b/cspell.json @@ -129,7 +129,9 @@ "processwithvariables", "dropdownrestprocess", "devops", - "mouseenter" + "mouseenter", + "starteventform", + "formtotestvalidations" ], "dictionaries": [ "html", diff --git a/e2e/pages/adf/demo-shell/process-services/processCloudDemoPage.ts b/e2e/pages/adf/demo-shell/process-services/processCloudDemoPage.ts index ee905ada6e..9d9c8e667b 100644 --- a/e2e/pages/adf/demo-shell/process-services/processCloudDemoPage.ts +++ b/e2e/pages/adf/demo-shell/process-services/processCloudDemoPage.ts @@ -97,7 +97,7 @@ export class ProcessCloudDemoPage { async checkActionExecuted(processInstanceId: string, action: string): Promise { await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Action Menu:'))); await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Context Menu:'))); - await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'ProcessInstanceId: ' + processInstanceId))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Process Instance ID: ' + processInstanceId))); await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Action Type: ' + action))); } } diff --git a/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts b/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts index e3dd36c012..5e5841296f 100644 --- a/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts +++ b/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts @@ -45,8 +45,8 @@ export class TasksCloudDemoPage { contextMenuToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="contextmenu"]')); multiSelectionToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="multiSelection"]')); testingModeToggle: ElementFinder = element(by.css('mat-slide-toggle[data-automation-id="testingMode"]')); - selectedRows: ElementFinder = element(by.xpath("//div[text()=' Selected rows: ']")); - noOfSelectedRows: ElementArrayFinder = element.all(by.xpath("//div[text()=' Selected rows: ']//li")); + selectedRows: ElementFinder = element(by.xpath("//div[text()=' Selected Rows: ']")); + noOfSelectedRows: ElementArrayFinder = element.all(by.xpath("//div[text()=' Selected Rows: ']//li")); addActionTitle: ElementFinder = element(by.cssContainingText('.mat-card-title', 'Add Action')); keyInputField: ElementFinder = element(by.css('input[placeholder="Key"]')); titleInputField: ElementFinder = element(by.css('input[placeholder="Title"]')); @@ -150,7 +150,7 @@ export class TasksCloudDemoPage { async getSelectedTaskRowText(rowNo: string): Promise { await this.checkSelectedRowsIsDisplayed(); - const row: ElementFinder = element(by.xpath(`//div[text()=' Selected rows: ']//li[${rowNo}]`)); + const row: ElementFinder = element(by.xpath(`//div[text()=' Selected Rows: ']//li[${rowNo}]`)); return await BrowserActions.getText(row); } @@ -180,8 +180,7 @@ export class TasksCloudDemoPage { async checkActionExecuted(taskId: string, action: string): Promise { await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Action Menu:'))); await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Context Menu:'))); - await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Task Id: ' + taskId))); + await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Task ID: ' + taskId))); await BrowserVisibility.waitUntilElementIsVisible(element(by.cssContainingText(`span`, 'Action Type: ' + action))); } - } 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 7ba6e5d2b6..2d942140da 100644 --- a/e2e/process-services-cloud/start-task-form-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-form-cloud.e2e.ts @@ -192,7 +192,7 @@ describe('Start Task Form', () => { await tasksCloudDemoPage.openNewTaskForm(); await startTask.checkFormIsDisplayed(); await startTask.addName(standaloneTaskName); - await startTask.selectFormDefinition('StartEventForm'); + await startTask.selectFormDefinition(resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.forms.starteventform); await startTask.clickStartButton(); await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(standaloneTaskName); await tasksCloudDemoPage.taskListCloudComponent().selectRow(standaloneTaskName); @@ -224,9 +224,9 @@ describe('Start Task Form', () => { it('[C311428] Should display the Standalone forms based on the flag set', async () => { await tasksCloudDemoPage.openNewTaskForm(); await startTask.checkFormIsDisplayed(); - await startTask.checkFormDefinitionIsNotDisplayed('UploadFileForm'); - await startTask.checkFormDefinitionIsDisplayed('StartEventForm'); - await startTask.checkFormDefinitionIsDisplayed('FormToTestValidations'); + await startTask.checkFormDefinitionIsNotDisplayed('uploadfileform'); + await startTask.checkFormDefinitionIsDisplayed(resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.forms.starteventform); + await startTask.checkFormDefinitionIsDisplayed(resources.ACTIVITI7_APPS.CANDIDATE_BASE_APP.forms.formtotestvalidations); }); }); diff --git a/e2e/process-services-cloud/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list-selection.e2e.ts index d4c99cd00e..d1cd72e9d4 100644 --- a/e2e/process-services-cloud/task-list-selection.e2e.ts +++ b/e2e/process-services-cloud/task-list-selection.e2e.ts @@ -91,7 +91,6 @@ describe('Task list cloud - selection', () => { it('[C291914] Should not be able to select any row when selection mode is set to None', async () => { await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.selectSelectionMode('None'); - await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); @@ -104,7 +103,6 @@ describe('Task list cloud - selection', () => { it('[C291918] Should be able to select only one row when selection mode is set to Single', async () => { await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.selectSelectionMode('Single'); - await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); @@ -122,8 +120,7 @@ describe('Task list cloud - selection', () => { it('[C291919] Should be able to select only one row when selection mode is set to Multiple', async () => { await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.selectSelectionMode('Multiple'); - await tasksCloudDemoPage.clickSettingsButton(); + await tasksCloudDemoPage.enableMultiSelection(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); await tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); @@ -140,8 +137,6 @@ describe('Task list cloud - selection', () => { }); it('[C291916] Should be able to select multiple row when multiselect is true', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); @@ -163,8 +158,6 @@ describe('Task list cloud - selection', () => { }); it('[C291915] Should be possible select all the rows when multiselect is true', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.disableDisplayTaskDetails(); await tasksCloudDemoPage.clickAppButton(); @@ -178,8 +171,6 @@ describe('Task list cloud - selection', () => { }); it('[C297472] Should be able to see selected tasks with Multiselection and Testing switched on', async () => { - await tasksCloudDemoPage.clickSettingsButton(); - await tasksCloudDemoPage.enableMultiSelection(); await tasksCloudDemoPage.clickSettingsButton(); await tasksCloudDemoPage.enableTestingMode(); await tasksCloudDemoPage.clickAppButton(); diff --git a/e2e/util/resources.js b/e2e/util/resources.js index efde1cb99e..19bbb20a1f 100644 --- a/e2e/util/resources.js +++ b/e2e/util/resources.js @@ -531,6 +531,10 @@ exports.ACTIVITI7_APPS = { candidateGroupProcess: "candidategroupprocess", anotherCandidateGroupProcess: "anothercandidategroup", uploadFileProcess: "uploadfileprocess" + }, + forms: { + starteventform: "starteventform", + formtotestvalidations: "formtotestvalidations" } }, SIMPLE_APP: { diff --git a/scripts/travis/e2e/process-services-cloud-e2e.sh b/scripts/travis/e2e/process-services-cloud-e2e.sh index d0aa41dfee..edf58ffddd 100755 --- a/scripts/travis/e2e/process-services-cloud-e2e.sh +++ b/scripts/travis/e2e/process-services-cloud-e2e.sh @@ -22,7 +22,7 @@ then else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]]; then HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)" - LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)" + LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV/" | paste -sd , -)" node ./scripts/check-env/check-activiti-env.js --host "$E2E_HOST_BPM" --oauth "$E2E_HOST_SSO" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" --client 'activiti' || exit 1 if [[ $LIST_SPECS != "" ]]; then diff --git a/scripts/travis/e2e/process-services-e2e.sh b/scripts/travis/e2e/process-services-e2e.sh index 64f0a84486..2c1f9b9f64 100755 --- a/scripts/travis/e2e/process-services-e2e.sh +++ b/scripts/travis/e2e/process-services-e2e.sh @@ -20,7 +20,7 @@ then else if [[ $AFFECTED_E2E = "e2e/$CONTEXT_ENV" ]]; then HEAD_SHA_BRANCH="$(git merge-base origin/$TRAVIS_BRANCH HEAD)" - LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV" | paste -sd , -)" + LIST_SPECS="$(git diff --name-only $HEAD_SHA_BRANCH HEAD | grep "^e2e/$CONTEXT_ENV/" | paste -sd , -)" if [[ $LIST_SPECS != "" ]]; then echo "Run $CONTEXT_ENV e2e based on the sha $HEAD_SHA_BRANCH with the specs: "$LIST_SPECS