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:
@@ -72,22 +72,22 @@ describe('Amount Widget', () => {
|
||||
await widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id);
|
||||
await taskPage.formFields().checkWidgetIsVisible(app.FIELD.amount_input_id);
|
||||
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await expect(await widget.amountWidget().getAmountFieldLabel(app.FIELD.amount_input_id)).toContain('Amount');
|
||||
await expect(await widget.amountWidget().getPlaceholder(app.FIELD.amount_input_id)).toContain('Type amount');
|
||||
await expect(await widget.amountWidget().getAmountFieldCurrency(app.FIELD.amount_input_id)).toBe('$');
|
||||
|
||||
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 4);
|
||||
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be less than 5');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
|
||||
|
||||
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 101);
|
||||
await expect(await widget.amountWidget().getErrorMessage(app.FIELD.amount_input_id)).toBe('Can\'t be greater than 100');
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(false);
|
||||
await widget.amountWidget().clearFieldValue(app.FIELD.amount_input_id);
|
||||
|
||||
await widget.amountWidget().setFieldValue(app.FIELD.amount_input_id, 6);
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
|
||||
await expect(await taskPage.formFields().isCompleteFormButtonEnabled()).toEqual(true);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user