Skip to content

Commit

Permalink
ADF and JS-API version update (#3371)
Browse files Browse the repository at this point in the history
* ADF and JS-API version update

* Update Creator and Modifier E2Es

* ACS-5632 Fixed rest e2e

* ACS-5632 Added missing spaces

---------

Co-authored-by: Aleksander Sklorz <[email protected]>
  • Loading branch information
MichalKinas and AleksanderSklorz authored Jul 28, 2023
1 parent 174d7b6 commit 26cd95c
Show file tree
Hide file tree
Showing 8 changed files with 224 additions and 180 deletions.
2 changes: 0 additions & 2 deletions e2e/protractor/protractor.excludes.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
"C279221": "will be fixed after protractor to playwright migration, see https://alfresco.atlassian.net/browse/ACS-5007",
"C325006": "will be fixed after protractor to playwright migration, see https://alfresco.atlassiana.net/browse/ACS-5007",
"C213097": "https://alfresco.atlassian.net/browse/ACS-5479",
"C280051": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5632",
"C308042": "temp, will be fixed in https://alfresco.atlassian.net/browse/ACS-5632",

"C268958" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5604",
"C268959" : "test migrated to playwright https://alfresco.atlassian.net/browse/ACS-5604",
Expand Down
194 changes: 80 additions & 114 deletions e2e/protractor/suites/search/search-filters.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ describe('Search filters', () => {
};

const expectedFileTypes = ['pdf', 'wpd'];
const expectedCreators = [`${user1} ${user1} (1)`, `${user2} ${user2} (1)`];
const expectedModifiers = [`${user1} ${user1} (1)`, `${user2} ${user2} (1)`];
const expectedLocations = ['_REPOSITORY_ (1)', `${site} (1)`];

const apis = {
user1: new RepoClient(user1, user1),
Expand All @@ -79,9 +76,8 @@ describe('Search filters', () => {

const fileTypeFilter = filters.fileType;
const createdDateFilter = filters.createdDate;
const creatorFilter = filters.creator;
const peopleFilter = filters.people;
const locationFilter = filters.location;
const modifierFilter = filters.modifier;
const modifiedDateFilter = filters.modifiedDate;
const adminApiActions = new AdminActions();

Expand Down Expand Up @@ -119,8 +115,7 @@ describe('Search filters', () => {
it('[C279186] Filters are displayed', async () => {
expect(await createdDateFilter.isDisplayed()).toBe(true, 'Created date filter panel not displayed');
expect(await fileTypeFilter.isDisplayed()).toBe(true, 'File type filter panel not displayed');
expect(await creatorFilter.isDisplayed()).toBe(true, 'Creator filter panel not displayed');
expect(await modifierFilter.isDisplayed()).toBe(true, 'Modifier filter panel not displayed');
expect(await peopleFilter.isDisplayed()).toBe(true, 'People filter panel not displayed');
expect(await locationFilter.isDisplayed()).toBe(true, 'Location filter panel not displayed');
expect(await modifiedDateFilter.isDisplayed()).toBe(true, 'Modified date filter panel not displayed');
});
Expand Down Expand Up @@ -321,125 +316,100 @@ describe('Search filters', () => {
});
});

describe('Filter by Creator', () => {
describe('Filter by People', () => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
});

it('[C279205] Expand / Collapse the Creator filter panel', async () => {
await creatorFilter.openDialog();
expect(await creatorFilter.isDialogPresent()).toBe(true, 'Creator filter panel not expanded');
it('[C279205] Expand / Collapse the People filter panel', async () => {
await peopleFilter.openDialog();
expect(await peopleFilter.isDialogPresent()).toBe(true, 'People filter panel not expanded');

expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators, 'Incorrect Creator filters facets');
expect(await creatorFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Creator filter categories not displayed');
expect(await peopleFilter.getCurrentTabLabel()).toEqual('Creator', 'Incorrect Creator tab label');
expect(await peopleFilter.isChipListDisplayed()).toBe(true, 'Creator chip list is not displayed');

await creatorFilter.closeDialog();
expect(await creatorFilter.isDialogPresent()).toBe(false, 'Creator filter panel is expanded');
await peopleFilter.changeTabToModifier();
expect(await peopleFilter.getCurrentTabLabel()).toEqual('Modifier', 'Incorrect Modifier tab label');
expect(await peopleFilter.isChipListDisplayed()).toBe(true, 'Modifier chip list is not displayed');

await peopleFilter.closeDialog();
expect(await peopleFilter.isDialogPresent()).toBe(false, 'People filter panel is expanded');
});

it('[C279206] Results are filtered by Creator', async () => {
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
await peopleFilter.openDialog();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}`);
expect(await peopleFilter.getChipTitle()).toEqual(`Created by: ${user1} ${user1} `);

await creatorFilter.openDialog();
await creatorFilter.checkCategory(user2);
await creatorFilter.clickApplyButton();
await BrowserActions.click(filters.resetAllButton);
await peopleFilter.openDialog();
await peopleFilter.selectChip(`${user2} ${user2}`);
await peopleFilter.clickApplyButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}, ${user2} ${user2}`);
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file not displayed');
expect(await peopleFilter.getChipTitle()).toEqual(`Created by: ${user2} ${user2} `);
});

it('[C279207] Clear the Creator filter options', async () => {
await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
it('[C279207] Results are filtered by Modifier', async () => {
await peopleFilter.openDialog();
await peopleFilter.changeTabToModifier();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await peopleFilter.getChipTitle()).toEqual(`Modified by: ${user1} ${user1} `);

await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
await creatorFilter.clickResetButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await creatorFilter.getChipTitle()).toEqual('', 'Creator selection not cleared');
});

it('[C279208] Search for a specific creator', async () => {
await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators, 'Incorrect Creator filters facets');
await creatorFilter.filterCategoriesBy(user1);
expect(await creatorFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`], 'Incorrect Creator filters facets');
});
});

describe('Filter by Modifier', () => {
afterEach(async () => {
await Utils.pressEscape();
await BrowserActions.click(filters.resetAllButton);
});
await peopleFilter.openDialog();
await peopleFilter.changeTabToModifier();
await peopleFilter.selectChip(`${user2} ${user2}`);
await peopleFilter.clickApplyButton();

it('[C279224] Expand / Collapse the Modifier filter panel', async () => {
await modifierFilter.openDialog();
expect(await modifierFilter.isDialogPresent()).toBe(true, 'Modifier filter panel not expanded');

expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers, 'Incorrect Modifier filters facets');
expect(await modifierFilter.isFilterCategoryInputDisplayed()).toBe(true, 'Modifier filter categories not displayed');

await modifierFilter.closeDialog();
expect(await modifierFilter.isDialogPresent()).toBe(false, 'Modifier filter panel is expanded');
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(false, 'JPG file not displayed');
expect(await peopleFilter.getChipTitle()).toEqual(`Modified by: ${user2} ${user2} `);
});

it('[C279225] Results are filtered by Modifier', async () => {
await modifierFilter.openDialog();
await modifierFilter.checkCategory(user1);
await modifierFilter.clickApplyButton();
it('[C279208] Clear the Creator filter options', async () => {
await peopleFilter.openDialog();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await modifierFilter.getChipTitle()).toEqual(`${user1} ${user1}`, 'Incorrect File type filters facets');

await modifierFilter.openDialog();
await modifierFilter.checkCategory(user2);
await modifierFilter.clickApplyButton();
await peopleFilter.openDialog();
expect(await peopleFilter.getSelectedValues()).toEqual([`${user1} ${user1}`]);
await peopleFilter.clickResetButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await modifierFilter.getChipTitle()).toEqual(`${user1} ${user1}, ${user2} ${user2}`, 'Incorrect modifier filters facets');
expect(await peopleFilter.getChipTitle()).toEqual('', 'Creator selection not cleared');
});

it('[C279226] Clear the Modifier filter options', async () => {
await modifierFilter.openDialog();
await modifierFilter.checkCategory(user1);
await modifierFilter.clickApplyButton();
it('[C279209] Clear the Modifier filter options', async () => {
await peopleFilter.openDialog();
await peopleFilter.changeTabToModifier();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');

await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersCheckedValues()).toEqual([`${user1} ${user1} (1)`]);
await modifierFilter.clickResetButton();
await peopleFilter.openDialog();
expect(await peopleFilter.getSelectedValues()).toEqual([`${user1} ${user1}`]);
await peopleFilter.clickResetButton();

expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(true, 'PDF file not displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');

await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersCheckedValues()).toEqual([], 'Modifier selection not cleared');
});

it('[C279227] Search for a specific modifier', async () => {
await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers, 'Incorrect Modifier filters facets');
await modifierFilter.filterCategoriesBy(user1);
expect(await modifierFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`], 'Incorrect Modifier filters facets');
expect(await peopleFilter.getChipTitle()).toEqual('', 'Modifier selection not cleared');
});
});

Expand Down Expand Up @@ -584,9 +554,9 @@ describe('Search filters', () => {
await fileTypeFilter.selectFileType('jpg');
await fileTypeFilter.clickApplyButton();

await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
await peopleFilter.openDialog();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

await locationFilter.openDialog();
await locationFilter.setAutocompleteInputValue(site);
Expand All @@ -595,7 +565,7 @@ describe('Search filters', () => {
expect(await dataTable.isItemPresent(filePdfUser2.name)).toBe(false, 'PDF file is displayed');
expect(await dataTable.isItemPresent(fileJpgUser1.name)).toBe(true, 'JPG file not displayed');
expect(await fileTypeFilter.getChipTitle()).toEqual(`${SizeOperator.AT_MOST} 1024 KB, jpg`);
expect(await creatorFilter.getChipTitle()).toEqual(`${user1} ${user1}`);
expect(await peopleFilter.getChipTitle()).toEqual(`Created by: ${user1} ${user1} `);
expect(await locationFilter.getChipTitle()).toEqual(site);

await BrowserActions.click(filters.resetAllButton);
Expand All @@ -609,9 +579,9 @@ describe('Search filters', () => {
await fileTypeFilter.selectFileType('jpg');
await fileTypeFilter.clickApplyButton();

await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
await peopleFilter.openDialog();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

expect(await dataTable.getRowsCount()).toEqual(1, 'expected 1 result');

Expand All @@ -625,9 +595,9 @@ describe('Search filters', () => {
await fileTypeFilter.selectFileType('jpg');
await fileTypeFilter.clickApplyButton();

await creatorFilter.openDialog();
await creatorFilter.checkCategory(user1);
await creatorFilter.clickApplyButton();
await peopleFilter.openDialog();
await peopleFilter.selectChip(`${user1} ${user1}`);
await peopleFilter.clickApplyButton();

expect(await page.pagination.getRange()).toEqual('Showing 1-1 of 1');

Expand All @@ -637,33 +607,29 @@ describe('Search filters', () => {
});

it('[C308042] The filter facets display is updated when making a new query', async () => {
await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersValues()).toEqual(expectedCreators);
await creatorFilter.closeDialog();
const expectedUsers1 = [`${user1} ${user1}`, `${user2} ${user2}`];
await peopleFilter.openDialog();
expect(await peopleFilter.getAutocompleteOptions(' ')).toEqual(expectedUsers1);
await peopleFilter.closeDialog();

await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersValues()).toEqual(expectedModifiers);
await modifierFilter.closeDialog();

await locationFilter.openDialog();
expect(await locationFilter.getFiltersSelectedValues()).toEqual(expectedLocations);
await locationFilter.closeDialog();
await peopleFilter.openDialog();
await peopleFilter.changeTabToModifier();
expect(await peopleFilter.getAutocompleteOptions(' ')).toEqual(expectedUsers1);
await peopleFilter.closeDialog();

await searchInput.clickSearchButton();
await searchInput.searchFor(fileJpgUser1.name);
await dataTable.waitForBody();

await creatorFilter.openDialog();
expect(await creatorFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`]);
await creatorFilter.closeDialog();

await modifierFilter.openDialog();
expect(await modifierFilter.getFiltersValues()).toEqual([`${user1} ${user1} (1)`]);
await modifierFilter.closeDialog();
const expectedUsers2 = [`${user1} ${user1}`];
await peopleFilter.openDialog();
await peopleFilter.changeTabToCreator();
expect(await peopleFilter.getAutocompleteOptions('')).toEqual(expectedUsers2);
await peopleFilter.closeDialog();

await locationFilter.openDialog();
expect(await locationFilter.getFiltersSelectedValues()).toEqual([`${site}`]);
await locationFilter.closeDialog();
await peopleFilter.openDialog();
expect(await peopleFilter.getAutocompleteOptions('')).toEqual(expectedUsers2);
await peopleFilter.closeDialog();
});
});
});
Loading

0 comments on commit 26cd95c

Please sign in to comment.