mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[C310199][C310142]- empty form , required data and invalid form data validations (#4900)
* C310199, C310142, empty form validations, Form validations with required field and invalid data.Added a new form to candidatebaseapp, 'FormToTestValidations' * using BrowserActions
This commit is contained in:
committed by
Eugenio Romano
parent
939277366f
commit
cae73e3c02
@@ -43,6 +43,25 @@ export class TasksService {
|
||||
}
|
||||
}
|
||||
|
||||
async createStandaloneTaskWithForm(taskName, appName, formKey, options?) {
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks';
|
||||
const method = 'POST';
|
||||
|
||||
const queryParams = {}, postBody = {
|
||||
'name': taskName,
|
||||
'payloadType': 'CreateTaskPayload',
|
||||
'formKey': formKey,
|
||||
...options
|
||||
};
|
||||
|
||||
return await this.api.performBpmOperation(path, method, queryParams, postBody);
|
||||
} catch (error) {
|
||||
// tslint:disable-next-line:no-console
|
||||
console.log('Create FormTask - Service error, Response: ', JSON.parse(JSON.stringify(error)));
|
||||
}
|
||||
}
|
||||
|
||||
async completeTask(taskId, appName) {
|
||||
try {
|
||||
const path = '/' + appName + '/rb/v1/tasks/' + taskId + '/complete';
|
||||
|
@@ -28,6 +28,10 @@ export class TaskFormCloudComponent {
|
||||
saveButton = element(by.css('button[id="adf-form-save"]'));
|
||||
claimButton = element(by.css('button[adf-cloud-claim-task]'));
|
||||
form = element(by.css('adf-cloud-form'));
|
||||
formTitle = element(by.css(`span.adf-form-title`));
|
||||
emptyContentIcon = element(by.css(`div.adf-empty-content mat-icon.adf-empty-content__icon`));
|
||||
emptyContentTitle = element(by.css(`div.adf-empty-content div.adf-empty-content__title`));
|
||||
emptyContentSubtitle = element(by.css(`div.adf-empty-content div.adf-empty-content__subtitle`));
|
||||
|
||||
checkCompleteButtonIsDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
|
||||
@@ -68,6 +72,16 @@ export class TaskFormCloudComponent {
|
||||
return this;
|
||||
}
|
||||
|
||||
getFormTitle() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.formTitle);
|
||||
return this.formTitle.getText();
|
||||
}
|
||||
|
||||
checkFormIsNotDisplayed() {
|
||||
BrowserVisibility.waitUntilElementIsNotVisible(this.form);
|
||||
return this;
|
||||
}
|
||||
|
||||
getReleaseButtonText() {
|
||||
return BrowserActions.getText(this.releaseButton);
|
||||
}
|
||||
@@ -82,4 +96,23 @@ export class TaskFormCloudComponent {
|
||||
this.saveButton.click();
|
||||
return this;
|
||||
}
|
||||
|
||||
checkFormContentIsEmpty() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.emptyContentIcon);
|
||||
return this;
|
||||
}
|
||||
|
||||
getEmptyFormContentTitle() {
|
||||
return BrowserActions.getText(this.emptyContentTitle);
|
||||
}
|
||||
|
||||
getEmptyFormContentSubtitle() {
|
||||
return BrowserActions.getText(this.emptyContentSubtitle);
|
||||
}
|
||||
|
||||
getCompleteButton() {
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.completeButton);
|
||||
return this.completeButton;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user