diff --git a/lib/testing/src/lib/core/utils/string.util.ts b/lib/testing/src/lib/core/utils/string.util.ts index 8316e55c6c..aa39a5d49b 100644 --- a/lib/testing/src/lib/core/utils/string.util.ts +++ b/lib/testing/src/lib/core/utils/string.util.ts @@ -107,4 +107,18 @@ export class StringUtil { return fileNames; } + /** + * Generates a random name for a process + */ + static generateProcessName(): string { + return 'process_' + StringUtil.generateRandomString(5); + } + + /** + * Generates a random name for a task + */ + static generateUserTaskName(): string { + return 'userTask_' + StringUtil.generateRandomString(5); + } + } 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 2800ee04b2..2ee7e2be19 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 @@ -80,6 +80,11 @@ export class TaskFormCloudComponent { await browser.sleep(500); } + async checkAndClickCompleteButton(): Promise { + await this.isCompleteButtonEnabled(); + await this.clickCompleteButton(); + } + async checkFormOutcomeButtonIsDisplayedByName(name: string): Promise { await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`button[id="adf-form-${name}"]`))); } @@ -150,9 +155,16 @@ export class TaskFormCloudComponent { return this.completeButton; } - async waitTillTaskFormDisplayed() { + async waitTillTaskFormDisplayed(): Promise { await this.checkFormIsDisplayed(); await this.formFields().checkFormIsDisplayed(); } + async checkFormAndCompleteTask(): Promise { + await this.waitTillTaskFormDisplayed(); + await this.checkCompleteButtonIsDisplayed(); + await this.isCompleteButtonEnabled(); + await this.clickCompleteButton(); + } + } 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 0ca9e6c00b..277a51bded 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 @@ -117,6 +117,11 @@ export class TaskListCloudComponentPage { await BrowserVisibility.waitUntilElementIsVisible(this.taskList); } + async checkTaskListAndContentAreLoaded(): Promise { + await this.checkTaskListIsLoaded(); + await this.getDataTable().waitTillContentLoaded(); + } + async getNoTasksFoundMessage(): Promise { return BrowserActions.getText(this.noTasksFound); } diff --git a/lib/testing/src/lib/process-services-cloud/resources/resources.json b/lib/testing/src/lib/process-services-cloud/resources/resources.json index c1266d6c61..2cc58ee842 100644 --- a/lib/testing/src/lib/process-services-cloud/resources/resources.json +++ b/lib/testing/src/lib/process-services-cloud/resources/resources.json @@ -215,10 +215,18 @@ "name": "requirednumbervisibility" }, "mealform": { - "name": "mealform" + "name": "mealform", + "widgets": { + "inputMeal": "meal" + } }, "resultcollectionform": { - "name": "resultcollectionform" + "name": "resultcollectionform", + "widgets": { + "resultCollection1": "result1", + "resultCollection2": "result2", + "resultCollection3": "result3" + } }, "uploadSingleMultiple": { "name": "upload-single-multiple",