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

[ACS-8082] fix search e2e #3876

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions e2e/playwright/search/src/tests/search-filters-date.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export class SearchFiltersDate extends BaseComponent {
startDay,
endDay
} = params;

await searchPage.searchWithin(searchPhrase, searchType);
await searchPage.searchFilters.dateFilter.click();

Expand Down Expand Up @@ -139,4 +139,12 @@ export class SearchFiltersDate extends BaseComponent {
await expect(searchPage.searchFilters.dateFilter).toContainText(dateText, { ignoreCase: true });
}
}

async isModifiedTabSelected(): Promise<string> {
return this.modifiedTab.getAttribute('aria-selected');
}

async isSearchTabSelected(): Promise<string> {
return this.createdTab.getAttribute('aria-selected');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down