mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +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:
@@ -68,28 +68,28 @@ describe('Multi-line Widget', () => {
|
||||
it('[C268182] Should be able to set general properties for Multi-line Text Widget', async () => {
|
||||
const label = await widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple);
|
||||
await expect(label).toBe('multiSimple*');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
const placeHolder = await widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple);
|
||||
await expect(placeHolder).toBe('Type something...');
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C268184] Should be able to set advanced properties for Multi-line Text Widget', async () => {
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'A');
|
||||
await expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toContain('Enter at least 4 characters');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAAAAAAAAA');
|
||||
await expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiMinMax)).toContain('Enter no more than 10 characters');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiMinMax, 'AAAA');
|
||||
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST');
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, '3');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await expect(await widget.multilineTextWidget().getErrorMessage(app.FIELD.multiRegexp)).toContain('Enter a different value');
|
||||
await widget.multilineTextWidget().setValue(app.FIELD.multiRegexp, 'TE');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
});
|
||||
|
||||
it('[C268232] Should be able to set visibility properties for Multi-line Text Widget', async () => {
|
||||
|
Reference in New Issue
Block a user