mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3329] Refactor isCompleteFormButtonDisabled method (#5765)
* Refactor isCompleteFormButtonDisabled method - Change the isCompleteFormButtonDisabled() method structure as per the Code Style E2E 03-01 - Replace the isCompleteFormButtonDisabled() with isCompleteFormButtonEnabled() in the tests - Add lists with the default tasks and process filters name in order to use a variable instead of a string (ADW eg. in the breadcrumb checks) * Add visibility wait in isCompleteFormButtonEnabled method * Refactor isProcessListDisplayed method - Change the isProcessListDisplayed() method structure as per the Code Style E2E 03-01 - Replace the checkProcessListIsDisplayed() with isProcessListDisplayed() in the tests * Fix isCompleteFormButtonEnabled and isCancelButtonEnabled methods * Fix isCompleteFormButtonEnabled method * Create separate method to check for Complete button visibility * fix tslint
This commit is contained in:
@@ -67,12 +67,12 @@ describe('Number widget', () => {
|
||||
});
|
||||
|
||||
it('[C269111] Should be able to set general properties for Number Widget', async () => {
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await expect(await widget.numberWidget().getNumberFieldLabel(app.FIELD.number_general)).toContain('Number General');
|
||||
await expect(await widget.numberWidget().getPlaceholder(app.FIELD.number_general)).toContain('Type a number');
|
||||
|
||||
await widget.numberWidget().setFieldValue(app.FIELD.number_general, 2);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C274702] Should be able to set advanced and visibility properties for Number Widget', async () => {
|
||||
@@ -84,15 +84,15 @@ describe('Number widget', () => {
|
||||
|
||||
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 2);
|
||||
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be less than 3');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
|
||||
|
||||
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 101);
|
||||
await expect(await widget.numberWidget().getErrorMessage(app.FIELD.number_visible)).toBe('Can\'t be greater than 100');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.numberWidget().clearFieldValue(app.FIELD.number_visible);
|
||||
|
||||
await widget.numberWidget().setFieldValue(app.FIELD.number_visible, 4);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user