diff --git a/e2e/playwright/search/src/tests/search-filters-date.e2e.ts b/e2e/playwright/search/src/tests/search-filters-date.e2e.ts index 28edf8e481..e57966d8a3 100644 --- a/e2e/playwright/search/src/tests/search-filters-date.e2e.ts +++ b/e2e/playwright/search/src/tests/search-filters-date.e2e.ts @@ -63,15 +63,15 @@ test.describe('Search - Filters - Date', () => { await searchPage.searchFilters.dateFilter.click(); await searchPage.searchFiltersDate.betweenButton.click(); await expect(searchPage.searchFiltersDate.betweenRadioButton).toBeChecked(); - await expect(searchPage.searchFiltersDate.modifiedTabTitle).toHaveCSS('color', 'rgba(0, 0, 0, 0.54)'); + expect(await searchPage.searchFiltersDate.isModifiedTabSelected()).toBe('false'); await searchPage.searchFiltersDate.openCreatedModifiedTab(searchPage, 'Modified'); await expect(searchPage.searchFiltersDate.anytimeRadioButton).toBeChecked(); - await expect(searchPage.searchFiltersDate.modifiedTabTitle).toHaveCSS('color', 'rgb(33, 33, 33)'); + expect(await searchPage.searchFiltersDate.isModifiedTabSelected()).toBe('true'); await searchPage.searchFiltersDate.openCreatedModifiedTab(searchPage, 'Created'); await expect(searchPage.searchFiltersDate.betweenRadioButton).toBeChecked(); - await expect(searchPage.searchFiltersDate.createdTabTitle).toHaveCSS('color', 'rgb(33, 33, 33)'); + expect(await searchPage.searchFiltersDate.isSearchTabSelected()).toBe('true'); }); test('[C699048-2] Filter by date - Created anytime', async ({ searchPage }) => { 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 index a570b48dcc..92282c930d 100644 --- 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 @@ -100,7 +100,7 @@ export class SearchFiltersDate extends BaseComponent { startDay, endDay } = params; - + await searchPage.searchWithin(searchPhrase, searchType); await searchPage.searchFilters.dateFilter.click(); @@ -139,4 +139,12 @@ export class SearchFiltersDate extends BaseComponent { await expect(searchPage.searchFilters.dateFilter).toContainText(dateText, { ignoreCase: true }); } } + + async isModifiedTabSelected(): Promise { + return this.modifiedTab.getAttribute('aria-selected'); + } + + async isSearchTabSelected(): Promise { + return this.createdTab.getAttribute('aria-selected'); + } } 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 index b31fb63b56..2f37d4a8e8 100644 --- 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 @@ -37,13 +37,13 @@ export class SearchFiltersProperties extends BaseComponent { public fileSizeInput = this.getChild(`[placeholder$='Enter file size']`); public unitButton = this.getChild(`.adf-search-properties-file-size-unit`); public fileTypeInput = this.getChild(`[placeholder$='File Type']`); - public atLeastOption = this.page.locator(`.mat-option`, { hasText: 'At Least' }); - public atMostOption = this.page.locator(`.mat-option`, { hasText: 'At Most' }); - public exactlyOption = this.page.locator(`.mat-option`, { hasText: 'Exactly' }); - public kbUnit = this.page.locator(`.mat-option`, { hasText: 'KB' }); - public mbUnit = this.page.locator(`.mat-option`, { hasText: 'MB' }); - public gbUnit = this.page.locator(`.mat-option`, { hasText: 'GB' }); - public dropdownOptions = this.page.locator(`.mat-option`); + public atLeastOption = this.page.locator(`mat-option`, { hasText: 'At Least' }); + public atMostOption = this.page.locator(`mat-option`, { hasText: 'At Most' }); + public exactlyOption = this.page.locator(`mat-option`, { hasText: 'Exactly' }); + public kbUnit = this.page.locator(`mat-option`, { hasText: 'KB' }); + public mbUnit = this.page.locator(`mat-option`, { hasText: 'MB' }); + public gbUnit = this.page.locator(`mat-option`, { hasText: 'GB' }); + public dropdownOptions = this.page.locator(`mat-option`); async setPropertiesParameters( page: SearchPage,