[AAE-4824] Add more widgets to resources and cloud related methods (#6865)

* Add more widgets to resources

* move methods for random process & task name to ADF

* Add some task related methods

* Add checkTaskListAndContentAreLoaded method
This commit is contained in:
Iulia Burcă
2021-03-30 09:31:59 +03:00
committed by GitHub
parent 1957a8e5ca
commit ab4ab2fbbe
4 changed files with 42 additions and 3 deletions

View File

@@ -107,4 +107,18 @@ export class StringUtil {
return fileNames; 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);
}
} }

View File

@@ -80,6 +80,11 @@ export class TaskFormCloudComponent {
await browser.sleep(500); await browser.sleep(500);
} }
async checkAndClickCompleteButton(): Promise<void> {
await this.isCompleteButtonEnabled();
await this.clickCompleteButton();
}
async checkFormOutcomeButtonIsDisplayedByName(name: string): Promise<void> { async checkFormOutcomeButtonIsDisplayedByName(name: string): Promise<void> {
await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`button[id="adf-form-${name}"]`))); await BrowserVisibility.waitUntilElementIsVisible(element(by.css(`button[id="adf-form-${name}"]`)));
} }
@@ -150,9 +155,16 @@ export class TaskFormCloudComponent {
return this.completeButton; return this.completeButton;
} }
async waitTillTaskFormDisplayed() { async waitTillTaskFormDisplayed(): Promise<void> {
await this.checkFormIsDisplayed(); await this.checkFormIsDisplayed();
await this.formFields().checkFormIsDisplayed(); await this.formFields().checkFormIsDisplayed();
} }
async checkFormAndCompleteTask(): Promise<void> {
await this.waitTillTaskFormDisplayed();
await this.checkCompleteButtonIsDisplayed();
await this.isCompleteButtonEnabled();
await this.clickCompleteButton();
}
} }

View File

@@ -117,6 +117,11 @@ export class TaskListCloudComponentPage {
await BrowserVisibility.waitUntilElementIsVisible(this.taskList); await BrowserVisibility.waitUntilElementIsVisible(this.taskList);
} }
async checkTaskListAndContentAreLoaded(): Promise<void> {
await this.checkTaskListIsLoaded();
await this.getDataTable().waitTillContentLoaded();
}
async getNoTasksFoundMessage(): Promise<string> { async getNoTasksFoundMessage(): Promise<string> {
return BrowserActions.getText(this.noTasksFound); return BrowserActions.getText(this.noTasksFound);
} }

View File

@@ -215,10 +215,18 @@
"name": "requirednumbervisibility" "name": "requirednumbervisibility"
}, },
"mealform": { "mealform": {
"name": "mealform" "name": "mealform",
"widgets": {
"inputMeal": "meal"
}
}, },
"resultcollectionform": { "resultcollectionform": {
"name": "resultcollectionform" "name": "resultcollectionform",
"widgets": {
"resultCollection1": "result1",
"resultCollection2": "result2",
"resultCollection3": "result3"
}
}, },
"uploadSingleMultiple": { "uploadSingleMultiple": {
"name": "upload-single-multiple", "name": "upload-single-multiple",