diff --git a/projects/aca-playwright-shared/src/page-objects/components/index.ts b/projects/aca-playwright-shared/src/page-objects/components/index.ts index 301a91697..f8a6b0ec2 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/index.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/index.ts @@ -36,6 +36,13 @@ export * from './viewer.component'; export * from './search/search-input.component'; export * from './search/search-overlay.components'; export * from './search/search-sorting-picker.components'; +export * from './search/search-filters.component'; +export * from './search/search-filters/search-filters-categories.component'; +export * from './search/search-filters/search-filters-date.component'; +export * from './search/search-filters/search-filters-location.component'; +export * from './search/search-filters/search-filters-logic.component'; +export * from './search/search-filters/search-filters-properties.component'; +export * from './search/search-filters/search-filters-tags.component'; export * from './breadcrumb/breadcrumb.component'; export * from './sidenav.component'; export * from './aca-header.component'; diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters.component.ts new file mode 100644 index 000000000..035137f70 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters.component.ts @@ -0,0 +1,47 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFilters extends BaseComponent { + private static rootElement = '.aca-content__advanced-filters'; + + constructor(page: Page) { + super(page, SearchFilters.rootElement); + } + + public filtersButtons = this.page.locator('adf-search-widget-chip'); + public logicFilter = this.page.locator('adf-search-widget-chip', { hasText: 'Logic' }); + public propertiesFilter = this.page.locator('adf-search-widget-chip', { hasText: 'Properties' }); + public dateFilter = this.page.locator('adf-search-widget-chip', { hasText: 'Date' }); + public locationFilter = this.page.locator('adf-search-widget-chip', { hasText: 'Location' }); + public tagsFilter = this.page.locator('adf-search-widget-chip', { hasText: 'Tags' }); + public categoriesFilter = this.page.locator('adf-search-widget-chip', { hasText: 'Categories' }); + public resetButton = this.getChild('button' , { hasText: 'Reset' }); + public menuCardTitle = this.getChild('.adf-search-filter-title'); + public menuCardClose = this.getChild('.adf-search-filter-title-action'); + public menuCardClear = this.getChild('#cancel-filter-button'); + public menuCardApply = this.getChild('#apply-filter-button'); +} \ No newline at end of file diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-categories.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-categories.component.ts new file mode 100644 index 000000000..f1a4aa9de --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-categories.component.ts @@ -0,0 +1,36 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFiltersCategories extends BaseComponent { + private static rootElement = '.adf-search-filter-menu-card'; + + constructor(page: Page) { + super(page, SearchFiltersCategories.rootElement); + } + + public addOptionInput = this.getChild(`[data-automation-id$='adf-search-chip-autocomplete-input']`); +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-date.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-date.component.ts new file mode 100644 index 000000000..35070251b --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-date.component.ts @@ -0,0 +1,44 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFiltersDate extends BaseComponent { + private static rootElement = '.adf-search-filter-menu-card'; + + constructor(page: Page) { + super(page, SearchFiltersDate.rootElement); + } + + public createdTab = this.getChild(`[role='tab']`, { hasText: 'Created' }); + public modifiedTab = this.getChild(`[role='tab']`, { hasText: 'Modified' }); + public anytimeButton = this.getChild(`[data-automation-id$='date-range-anytime']`); + public inTheLastButton = this.getChild(`[data-automation-id$='date-range-in-last']`); + public inTheLastInput = this.getChild(`[data-automation-id$='date-range-in-last-input']`); + public inTheLastDropdown = this.getChild(`[data-automation-id$='date-range-in-last-dropdown']`); + public betweenButton = this.getChild(`[data-automation-id$='date-range-between']`); + public betweenStartDate = this.getChild(`[data-automation-id$='date-range-between-start-input']`); + public betweenEndDate = this.getChild(`[data-automation-id$='date-range-between-end-input']`); +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-location.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-location.component.ts new file mode 100644 index 000000000..cc385e186 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-location.component.ts @@ -0,0 +1,36 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFiltersLocation extends BaseComponent { + private static rootElement = '.adf-search-filter-menu-card'; + + constructor(page: Page) { + super(page, SearchFiltersLocation.rootElement); + } + + public addOptionInput = this.getChild(`[data-automation-id$='adf-search-chip-autocomplete-input']`); +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-logic.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-logic.component.ts new file mode 100644 index 000000000..f712b8083 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-logic.component.ts @@ -0,0 +1,39 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFiltersLogic extends BaseComponent { + private static rootElement = '.adf-search-filter-menu-card'; + + constructor(page: Page) { + super(page, SearchFiltersLogic.rootElement); + } + + public matchAllInput = this.getChild(`[placeholder$='Results will match all words entered here']`); + public matchAnyInput = this.getChild(`[placeholder$='Results will match any words entered here']`); + public excludeInput = this.getChild(`[placeholder$='Results will exclude matches with these words']`); + public matchExactInput = this.getChild(`[placeholder$='Results will match this entire phrase']`); +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-properties.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-properties.component.ts new file mode 100644 index 000000000..ca2d608ed --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-properties.component.ts @@ -0,0 +1,39 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFiltersProperties extends BaseComponent { + private static rootElement = '.adf-search-filter-menu-card'; + + constructor(page: Page) { + super(page, SearchFiltersProperties.rootElement); + } + + public operatorButton = this.getChild(`.adf-search-properties-file-size-operator`); + public fileSizeInput = this.getChild(`[placeholder$='Results will match all words entered here']`); + public unitButton = this.getChild(`.adf-search-properties-file-size-unit`); + public fileTypeInput = this.getChild(`[placeholder$='Results will exclude matches with these words']`); +} diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-tags.component.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-tags.component.ts new file mode 100644 index 000000000..843aeb919 --- /dev/null +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-filters/search-filters-tags.component.ts @@ -0,0 +1,36 @@ +/*! + * 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 + * from Hyland Software. If not, see . + */ + +import { BaseComponent } from '../../base.component'; +import { Page } from '@playwright/test'; + +export class SearchFiltersTags extends BaseComponent { + private static rootElement = '.adf-search-filter-menu-card'; + + constructor(page: Page) { + super(page, SearchFiltersTags.rootElement); + } + + public addOptionInput = this.getChild(`[data-automation-id$='adf-search-chip-autocomplete-input']`); +} diff --git a/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts b/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts index 3efe7f421..5f71effae 100644 --- a/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts +++ b/projects/aca-playwright-shared/src/page-objects/pages/search.page.ts @@ -24,7 +24,7 @@ import { Page } from '@playwright/test'; import { BasePage } from './base.page'; -import { DataTableComponent, MatMenuComponent, ViewerComponent, SearchInputComponent, SearchOverlayComponent, SidenavComponent, SearchSortingPicker } from '../components'; +import { DataTableComponent, MatMenuComponent, ViewerComponent, SearchInputComponent, SearchOverlayComponent, SidenavComponent, SearchSortingPicker, SearchFilters, SearchFiltersTags, SearchFiltersCategories, SearchFiltersDate, SearchFiltersLocation, SearchFiltersLogic, SearchFiltersProperties } from '../components'; import { AcaHeader } from '../components/aca-header.component'; import { AdfConfirmDialogComponent, AdfFolderDialogComponent } from '../components/dialogs'; @@ -45,6 +45,13 @@ export class SearchPage extends BasePage { public searchInput = new SearchInputComponent(this.page); public searchOverlay = new SearchOverlayComponent(this.page); public searchSortingPicker = new SearchSortingPicker(this.page); + public searchFilters = new SearchFilters(this.page); + public searchFiltersTags = new SearchFiltersTags(this.page); + public searchFiltersCategories = new SearchFiltersCategories(this.page); + public searchFiltersDate = new SearchFiltersDate(this.page); + public searchFiltersLocation = new SearchFiltersLocation(this.page); + public searchFiltersProperties = new SearchFiltersProperties(this.page); + public searchFiltersLogic = new SearchFiltersLogic(this.page); public sidenav = new SidenavComponent(this.page); public confirmDialogComponent = new AdfConfirmDialogComponent(this.page);