Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACA-3731] E2E test to validate Save, Save as and Delete buttons availability on custom filters #5929

Merged
merged 2 commits into from
Jul 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 32 additions & 10 deletions e2e/process-services-cloud/edit-task-filters-component.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,27 @@ describe('Edit task filters cloud', () => {
await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter();
});

it('[C291795] New filter is added when clicking Save As button', async () => {
await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks');
it('[C586756] Delete, Save and Save as actions should be displayed and enabled when clicking on custom filter header', async () => {
await createNewCustomFilter('New');

await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new');
await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter();
await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('custom-new');
await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('New');
const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent();
await editTaskFilterCloudComponent.openFilter();
await editTaskFilterCloudComponent.setSortFilterDropDown('Id');

await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks');
await editTaskFilterCloudComponent.setSortFilterDropDown('Priority');

await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton();
await editTaskFilterCloudComponent.checkSaveButtonIsDisplayed();
await editTaskFilterCloudComponent.checkSaveAsButtonIsDisplayed();
await editTaskFilterCloudComponent.checkDeleteButtonIsDisplayed();

const editTaskFilterDialog = tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog();
await editTaskFilterDialog.setFilterName('New');
await editTaskFilterDialog.clickOnSaveButton();
await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkSaveButtonIsEnabled()).toEqual(true);
await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkSaveAsButtonIsEnabled()).toEqual(true);
await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkDeleteButtonIsEnabled()).toEqual(true);
});

it('[C291795] New filter is added when clicking Save As button', async () => {
await createNewCustomFilter('New');
await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('New');
await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter();
await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().checkSaveButtonIsEnabled()).toEqual(false);
Expand Down Expand Up @@ -284,4 +290,20 @@ describe('Edit task filters cloud', () => {
await expect(await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().getFilterName()).toEqual('My Tasks');
await tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog().clickOnCancelButton();
});

async function createNewCustomFilter(name: string): Promise<void> {
await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks');

const editTaskFilterCloudComponent = tasksCloudDemoPage.editTaskFilterCloudComponent();
await editTaskFilterCloudComponent.openFilter();
await editTaskFilterCloudComponent.setSortFilterDropDown('Id');

await tasksCloudDemoPage.taskFilterCloudComponent.clickTaskFilter('my-tasks');

await tasksCloudDemoPage.editTaskFilterCloudComponent().clickSaveAsButton();

const editTaskFilterDialog = tasksCloudDemoPage.editTaskFilterCloudComponent().editTaskFilterDialog();
await editTaskFilterDialog.setFilterName(name);
await editTaskFilterDialog.clickOnSaveButton();
}
});