[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:
Iulia Burcă
2020-06-16 14:51:34 +03:00
committed by GitHub
parent 0349280d42
commit 3651cc0235
22 changed files with 121 additions and 91 deletions

View File

@@ -87,14 +87,14 @@ describe('Task cloud visibility', async () => {
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number1');
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '5');
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number2');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '123');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
});
@@ -116,18 +116,18 @@ describe('Task cloud visibility', async () => {
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number1');
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '5');
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Number2');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '123');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Number2');
await taskFormCloudComponent.formFields().setFieldValue(by.id, 'Number1', '4');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await taskFormCloudComponent.clickCompleteButton();
});
@@ -148,12 +148,12 @@ describe('Task cloud visibility', async () => {
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Checkbox2');
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Checkbox3');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await taskFormCloudComponent.formFields().clickField(by.id, 'Checkbox1');
await taskFormCloudComponent.formFields().clickField(by.id, 'Checkbox2');
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Checkbox3');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await taskFormCloudComponent.clickCompleteButton();
});
@@ -170,12 +170,12 @@ describe('Task cloud visibility', async () => {
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Checkbox2');
await taskFormCloudComponent.formFields().checkWidgetIsHidden('Checkbox3');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeTruthy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(false);
await taskFormCloudComponent.formFields().clickField(by.id, 'Checkbox1');
await taskFormCloudComponent.formFields().clickField(by.id, 'Checkbox2');
await taskFormCloudComponent.formFields().checkWidgetIsVisible('Checkbox3');
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonDisabled()).toBeFalsy();
await expect(await taskFormCloudComponent.formFields().isCompleteFormButtonEnabled()).toEqual(true);
await taskFormCloudComponent.clickCompleteButton();
});