diff --git a/e2e/protractor/protractor.excludes.json b/e2e/protractor/protractor.excludes.json index ffaa2597c3..6fb5bff913 100644 --- a/e2e/protractor/protractor.excludes.json +++ b/e2e/protractor/protractor.excludes.json @@ -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", diff --git a/e2e/protractor/suites/search/search-filters.test.ts b/e2e/protractor/suites/search/search-filters.test.ts index d4ac8de309..a456e62498 100644 --- a/e2e/protractor/suites/search/search-filters.test.ts +++ b/e2e/protractor/suites/search/search-filters.test.ts @@ -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), @@ -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(); @@ -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'); }); @@ -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'); }); }); @@ -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); @@ -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); @@ -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'); @@ -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'); @@ -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(); }); }); }); diff --git a/package-lock.json b/package-lock.json index a3d9ce3bc4..a6a36232d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,11 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "6.3.0-5591392156", - "@alfresco/adf-core": "6.3.0-5591392156", - "@alfresco/adf-extensions": "6.3.0-5591392156", - "@alfresco/eslint-plugin-eslint-angular": "6.3.0-5591392156", - "@alfresco/js-api": "6.3.0-1042", + "@alfresco/adf-content-services": "6.3.0-5661759145", + "@alfresco/adf-core": "6.3.0-5661759145", + "@alfresco/adf-extensions": "6.3.0-5661759145", + "@alfresco/eslint-plugin-eslint-angular": "6.3.0-5661759145", + "@alfresco/js-api": "6.3.0-1054", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", "@angular/common": "14.1.3", @@ -46,8 +46,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.3.0-5591392156", - "@alfresco/adf-testing": "6.3.0-5591392156", + "@alfresco/adf-cli": "6.3.0-5661759145", + "@alfresco/adf-testing": "6.3.0-5661759145", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", @@ -121,12 +121,12 @@ "dev": true }, "node_modules/@alfresco/adf-cli": { - "version": "6.3.0-5591392156", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.3.0-5591392156.tgz", - "integrity": "sha512-3HWgp9F8JVKMdpK7gKaQSMYtSdRGx3sUyxKaQikm6aL9YEU+bE36xFmUYSaVryH/Zv6Y407L5lnLDlKqwcYRxQ==", + "version": "6.3.0-5661759145", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.3.0-5661759145.tgz", + "integrity": "sha512-U3sXSa/2yIrTL2Q5iFMLi6LAmGk0gAQ/EBcxoQB2rTwzSceH+OIMgZnC9+48QONg2KqhuoX8miSK85fgFNg/zg==", "dev": true, "dependencies": { - "@alfresco/js-api": ">=6.3.0-1031", + "@alfresco/js-api": ">=6.3.0-1054", "commander": "^6.2.1", "ejs": "^3.1.9", "license-checker": "^25.0.1", @@ -141,15 +141,15 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "6.3.0-5591392156", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.3.0-5591392156.tgz", - "integrity": "sha512-TRlowaSQ99DtdgufCK3U90yugw8UNwxQlpzaWScnVm0tLoWVe4JMJgrHerx5YFb3J/2hDwrVSpJoISdC2KbgNg==", + "version": "6.3.0-5661759145", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.3.0-5661759145.tgz", + "integrity": "sha512-Dh9tugfFu5t5T8HHlAA2xqau/g5Jxf2YNMZaq9hlPXZGIPB8NHZHDhsMpLqFzkyYwhgMMCww+bLPwm8Cu8h1qw==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-core": ">=6.3.0-5591392156", - "@alfresco/js-api": ">=6.3.0-1031", + "@alfresco/adf-core": ">=6.3.0-5661759145", + "@alfresco/js-api": ">=6.3.0-1054", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", "@angular/common": ">=14.1.3", @@ -165,9 +165,9 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "6.3.0-5591392156", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.3.0-5591392156.tgz", - "integrity": "sha512-XR4VfifuKe3W8nEvL98gAct6R87ZxVXhLznZ6lppCTT62sGpuWNU7nIHL365srtCDlBzV/684rf9JEQJJKFpsA==", + "version": "6.3.0-5661759145", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.3.0-5661759145.tgz", + "integrity": "sha512-6MlvgaszsigKIeY7XmFocbVsrPWx0diWNI7nFfE5ugIUvAgVEqmwsB9CcQHW8chfV3IiT/QX+qaOWan2pi65Rw==", "dependencies": { "angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc-jwks": "^13.0.1", @@ -175,8 +175,8 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-extensions": ">=6.3.0-5591392156", - "@alfresco/js-api": ">=6.3.0-1031", + "@alfresco/adf-extensions": ">=6.3.0-5661759145", + "@alfresco/js-api": ">=6.3.0-1054", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", "@angular/common": ">=14.1.3", @@ -194,25 +194,25 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "6.3.0-5591392156", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.3.0-5591392156.tgz", - "integrity": "sha512-ecj7cZvNmveHi1iJrlbgWUC5YIEL+55E3betHS9+gpXEgZ6hMCaawOAjouD1cLLjHC0+zy2NZLprbBKO4HPxZg==", + "version": "6.3.0-5661759145", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.3.0-5661759145.tgz", + "integrity": "sha512-pIptgcpwsuZh13m9s15QdUr4tJf7jRyIF4pZj5oYq1lHmxrP31w+OuDCAj0mtsDZShHqPfZyc41wV1kFRWu5pw==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/js-api": ">=6.3.0-1031", + "@alfresco/js-api": ">=6.3.0-1054", "@angular/common": ">=14.1.3", "@angular/core": ">=14.1.3" } }, "node_modules/@alfresco/adf-testing": { - "version": "6.3.0-5591392156", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.3.0-5591392156.tgz", - "integrity": "sha512-u0sOJwXaUwO7Wu4al2QLFf3jIFhPEqrGpx12hKj0gKuoNsWvYbD20HHJxQ4I5Fr1TUcDLsx9LK0zNFwbukBeyw==", + "version": "6.3.0-5661759145", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.3.0-5661759145.tgz", + "integrity": "sha512-D+a3xboHSCYSuWaa5BdOe46kYl4B82OXZ53qcx+jixlt8Bp5vTvaXcCZvhHUav7p9ZgMD3H9dPxU1kr9HUNdcw==", "dev": true, "dependencies": { - "@alfresco/js-api": "6.3.0-1031", + "@alfresco/js-api": "6.3.0-1054", "@angular/compiler": "14.1.3", "@angular/core": "14.1.3", "rxjs": "6.6.6", @@ -220,29 +220,18 @@ "zone.js": "~0.11.4" }, "peerDependencies": { - "@alfresco/js-api": ">=6.3.0-1031" - } - }, - "node_modules/@alfresco/adf-testing/node_modules/@alfresco/js-api": { - "version": "6.3.0-1031", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-6.3.0-1031.tgz", - "integrity": "sha512-7nQtjyfLzj55t7mbCIzMJmz9J67/wD6vNan2hyGF7wm+70FDKITq8BevdGCh8/kYjOE4JsnNEJOCLnW8fsgY5Q==", - "dev": true, - "dependencies": { - "event-emitter": "^0.3.5", - "superagent": "^6.0.0", - "tslib": "^2.0.0" + "@alfresco/js-api": ">=6.3.0-1054" } }, "node_modules/@alfresco/eslint-plugin-eslint-angular": { - "version": "6.3.0-5591392156", - "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.3.0-5591392156.tgz", - "integrity": "sha512-zBmH4PEj4nUmutt46W6AU0xHXHYJgVlGwU7i6QLA4Mb7kPBe5ESq6sgGeUr4Ixx3c8drwZFzUQQYYGVdpZOdIA==" + "version": "6.3.0-5661759145", + "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.3.0-5661759145.tgz", + "integrity": "sha512-PQGyYJHqGyOWmXw8os7klU25ycrP1MT02fQZ9bOCFn/UHGwWv/hTRLuhhAq8gQuB6XvYIbKwD/2GrOra+5KxzQ==" }, "node_modules/@alfresco/js-api": { - "version": "6.3.0-1042", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-6.3.0-1042.tgz", - "integrity": "sha512-0CYszn2zBtc/HBeDjTbWKHYf+sOk3PK0BO8xAgVR8a0opX4kMgxH4n7WQqfQ5L3CPNkLV5mbvepSRuagVSJiIA==", + "version": "6.3.0-1054", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-6.3.0-1054.tgz", + "integrity": "sha512-q2EuOhb3yT0BBz3zvvUzkgN89T41d64osQieEDYbWmyY0Aq+rO9aY7R7ta2aQ3QxmFzdLy+6KQ2wgqYygb0RAQ==", "dependencies": { "event-emitter": "^0.3.5", "superagent": "^6.0.0", diff --git a/package.json b/package.json index aefcff045d..a0fc63ecec 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,11 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "6.3.0-5591392156", - "@alfresco/adf-core": "6.3.0-5591392156", - "@alfresco/adf-extensions": "6.3.0-5591392156", - "@alfresco/eslint-plugin-eslint-angular": "6.3.0-5591392156", - "@alfresco/js-api": "6.3.0-1042", + "@alfresco/adf-content-services": "6.3.0-5661759145", + "@alfresco/adf-core": "6.3.0-5661759145", + "@alfresco/adf-extensions": "6.3.0-5661759145", + "@alfresco/eslint-plugin-eslint-angular": "6.3.0-5661759145", + "@alfresco/js-api": "6.3.0-1054", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", "@angular/common": "14.1.3", @@ -69,8 +69,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.3.0-5591392156", - "@alfresco/adf-testing": "6.3.0-5591392156", + "@alfresco/adf-cli": "6.3.0-5661759145", + "@alfresco/adf-testing": "6.3.0-5661759145", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", diff --git a/projects/aca-content/package.json b/projects/aca-content/package.json index 95c89394f3..2b8efcf80f 100644 --- a/projects/aca-content/package.json +++ b/projects/aca-content/package.json @@ -5,10 +5,10 @@ "peerDependencies": { "@angular/common": "^14.1.0", "@angular/core": "^14.1.0", - "@alfresco/adf-core": "^6.3.0-5468717985", - "@alfresco/adf-content-services": "^6.3.0-5468717985", - "@alfresco/adf-extensions": "^6.3.0-5468717985", - "@alfresco/js-api": ">=6.3.0-1025", + "@alfresco/adf-core": "^6.3.0-5661759145", + "@alfresco/adf-content-services": "^6.3.0-5661759145", + "@alfresco/adf-extensions": "^6.3.0-5661759145", + "@alfresco/js-api": ">=6.3.0-1054", "@angular/animations": "^14.1.3", "@angular/cdk": "^14.1.3", "@angular/forms": "^14.1.3", diff --git a/projects/aca-shared/package.json b/projects/aca-shared/package.json index 7c2801742f..b506ce3a17 100644 --- a/projects/aca-shared/package.json +++ b/projects/aca-shared/package.json @@ -5,10 +5,10 @@ "license": "LGPL-3.0", "scripts": {}, "peerDependencies": { - "@alfresco/adf-content-services": "^6.3.0-5468717985", - "@alfresco/adf-core": "6.3.0-5468717985", - "@alfresco/adf-extensions": "6.3.0-5468717985", - "@alfresco/js-api": ">=6.3.0-1025", + "@alfresco/adf-content-services": "^6.3.0-5661759145", + "@alfresco/adf-core": "6.3.0-5661759145", + "@alfresco/adf-extensions": "6.3.0-5661759145", + "@alfresco/js-api": ">=6.3.0-1054", "@angular/animations": "^14.1.3", "@angular/common": "^14.1.3", "@angular/compiler": "^14.1.3", diff --git a/projects/aca-testing-shared/src/components/search/filters/facet-tabbed-filter.ts b/projects/aca-testing-shared/src/components/search/filters/facet-tabbed-filter.ts new file mode 100644 index 0000000000..78ae77690e --- /dev/null +++ b/projects/aca-testing-shared/src/components/search/filters/facet-tabbed-filter.ts @@ -0,0 +1,91 @@ +/*! + * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * + * Alfresco Example Content Application + * + * This file is part of the Alfresco Example Content Application. + * If the software was purchased under a paid Alfresco license, the terms of + * the paid license agreement will prevail. Otherwise, the software is + * provided under the following open source license terms: + * + * The Alfresco Example Content Application is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Alfresco Example Content Application is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Alfresco. If not, see . + */ + +import { ElementFinder, ElementArrayFinder, by, browser, protractor, element } from 'protractor'; +import { BrowserVisibility } from '@alfresco/adf-testing'; +import { GenericFilter } from './generic-filter'; + +export class FacetTabbedFilter extends GenericFilter { + private readonly locators = { + tabs: '.mat-tab-list .mat-tab-label', + chipList: '.mat-tab-body-active .adf-chip-list', + chipListInput: '.mat-tab-body-active .adf-chip-list input', + currentTabLabel: '.mat-tab-label-active .mat-tab-label-content', + chip: '.mat-chip span', + option: '.mat-option-text' + }; + + chips: ElementArrayFinder = this.filterDialogOpened.all(by.css(this.locators.chip)); + + get tabs(): ElementArrayFinder { + return this.filterDialogOpened.all(by.css(this.locators.tabs)); + } + + get chipList(): ElementFinder { + return this.filterDialogOpened.element(by.css(this.locators.chipList)); + } + + get chipListInput(): ElementFinder { + return this.filterDialogOpened.element(by.css(this.locators.chipListInput)); + } + + get options(): ElementArrayFinder { + return element.all(by.css(this.locators.option)); + } + + async getCurrentTabLabel(): Promise { + const label = this.filterDialogOpened.element(by.css(this.locators.currentTabLabel)); + return await label.getText(); + } + + async changeTabToModifier(): Promise { + await this.tabs.get(1).click(); + await BrowserVisibility.waitUntilElementHasText(await this.filterDialogOpened.element(by.css(this.locators.currentTabLabel)), 'Modifier'); + } + + async changeTabToCreator(): Promise { + await this.tabs.get(0).click(); + await BrowserVisibility.waitUntilElementHasText(await this.filterDialogOpened.element(by.css(this.locators.currentTabLabel)), 'Creator'); + } + + async isChipListDisplayed(): Promise { + return this.chipList.isDisplayed(); + } + + async getSelectedValues(): Promise { + return this.chips.map((option) => { + return option.getText(); + }); + } + + async selectChip(name: string): Promise { + await this.chipListInput.sendKeys(name); + await browser.actions().sendKeys(protractor.Key.ENTER).perform(); + } + + async getAutocompleteOptions(filterValue: string): Promise { + await this.chipListInput.sendKeys(filterValue); + return this.options.map((option) => option.getText()); + } +} diff --git a/projects/aca-testing-shared/src/components/search/search-filters.ts b/projects/aca-testing-shared/src/components/search/search-filters.ts index 5496c69945..7ea60a9091 100755 --- a/projects/aca-testing-shared/src/components/search/search-filters.ts +++ b/projects/aca-testing-shared/src/components/search/search-filters.ts @@ -28,14 +28,14 @@ import { CreatedDateFilter } from './filters/created-date-filter'; import { FacetFilter } from './filters/facet-filter'; import { AutocompleteChipsFilter } from './filters/autocomplete-chips-filter'; import { PropertiesFilter } from './filters/properties-filter'; +import { FacetTabbedFilter } from './filters/facet-tabbed-filter'; export class SearchFilters extends Component { resetAllButton = browser.element(by.css('button[adf-reset-search]')); createdDate = new CreatedDateFilter(); fileType = new PropertiesFilter(); - creator = new FacetFilter('Creator'); - modifier = new FacetFilter('Modifier'); + people = new FacetTabbedFilter('People'); location = new AutocompleteChipsFilter('Location'); modifiedDate = new FacetFilter('Modified date');