diff --git a/e2e/playwright/create-actions/src/tests/create-folder.e2e.ts b/e2e/playwright/create-actions/src/tests/create-folder.e2e.ts index 0de358686..e988ab655 100644 --- a/e2e/playwright/create-actions/src/tests/create-folder.e2e.ts +++ b/e2e/playwright/create-actions/src/tests/create-folder.e2e.ts @@ -78,12 +78,12 @@ test.describe('Create folders', () => { }); test('[C216345] Create new folder dialog check', async () => { - await expect(folderDialog.getLabelText('Name')).toBeVisible(); - await expect(folderDialog.getLabelText('*')).toBeVisible(); + // TODO [ACS-7534] add * after it is added to adf placeholder/label + await expect(folderDialog.getElementByPlaceholder('input', 'Name')).toBeVisible(); await expect(folderDialog.folderNameInputLocator).toBeVisible(); - await expect(folderDialog.getLabelText('Title')).toBeVisible(); + await expect(folderDialog.getElementByPlaceholder('input', 'Title')).toBeVisible(); await expect(folderDialog.folderTitleInput).toBeVisible(); - await expect(folderDialog.getLabelText('Description')).toBeVisible(); + await expect(folderDialog.getElementByPlaceholder('textarea', 'Description')).toBeVisible(); await expect(folderDialog.folderDescriptionInput).toBeVisible(); await expect(folderDialog.cancelButton).toBeEnabled(); await expect(folderDialog.createButton).toBeDisabled(); diff --git a/e2e/playwright/create-actions/src/tests/create-library.e2e.ts b/e2e/playwright/create-actions/src/tests/create-library.e2e.ts index f0d11e7df..148529f16 100644 --- a/e2e/playwright/create-actions/src/tests/create-library.e2e.ts +++ b/e2e/playwright/create-actions/src/tests/create-library.e2e.ts @@ -49,8 +49,10 @@ test.describe('Create Libraries ', () => { let randomLibraryId: string; let randomLibraryDescription: string; const libraryDialogTitle = 'Create Library'; - const libraryNameLabel = 'Name *'; - const libraryIdLabel = 'Library ID *'; + // TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF + const libraryNameLabel = 'Name'; + // TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF + const libraryIdLabel = 'Library ID'; const libraryDescriptionLabel = 'Description'; const publicVisibility = 'Public'; const moderatedVisibility = 'Moderated'; @@ -95,9 +97,9 @@ test.describe('Create Libraries ', () => { test('[C280024] Create Library dialog UI', async () => { await expect(libraryDialog.getDialogTitle(libraryDialogTitle)).toBeVisible(); - await expect(libraryDialog.getLabelText(libraryNameLabel)).toBeVisible(); - await expect(libraryDialog.getLabelText(libraryIdLabel)).toBeVisible(); - await expect(libraryDialog.getLabelText(libraryDescriptionLabel)).toBeVisible(); + await expect(libraryDialog.getElementByPlaceholder(libraryNameLabel)).toBeVisible(); + await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toBeVisible(); + await expect(libraryDialog.getElementByPlaceholder(libraryDescriptionLabel)).toBeVisible(); await expect(libraryDialog.getLabelText(publicVisibility)).toBeVisible(); await expect(libraryDialog.getLabelText(publicVisibility)).toBeChecked(); await expect(libraryDialog.getLabelText(privateVisibility)).toBeVisible(); @@ -113,9 +115,9 @@ test.describe('Create Libraries ', () => { }); test('[C280025] Create a public library', async ({ myLibrariesPage }) => { - await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName); - await expect(libraryDialog.getLabelText(libraryNameLabel)).toHaveValue(randomLibraryName); - await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(randomLibraryName); + await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName); + await expect(libraryDialog.getElementByPlaceholder(libraryNameLabel)).toHaveValue(randomLibraryName); + await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toHaveValue(randomLibraryName); await libraryDialog.createButton.click(); await expect(libraryBreadcrumb.getItemByTitle(randomLibraryName)).toBeVisible(); @@ -157,17 +159,17 @@ test.describe('Create Libraries ', () => { await expect(libraryTable.getCellLinkByName(randomLibraryName).and(myLibrariesPage.page.getByTitle(randomLibraryDescription))).toBeVisible(); await libraryTable.getRowByName(randomLibraryName).click(); await libraryViewDetails.click(); - await expect(libraryDetails.getNameField('Name').locator('input')).toHaveValue(randomLibraryName); - await expect(libraryDetails.getIdField('Library ID').locator('input')).toHaveValue(randomLibraryId); - await expect(libraryDetails.getVisibilityField('Visibility').getByText(publicVisibility)).toBeVisible(); - await expect(libraryDetails.getDescriptionField).toHaveValue(randomLibraryDescription); + expect(await libraryDetails.getNameField('Name').inputValue()).toBe(randomLibraryName); + expect(await libraryDetails.getIdField('Library ID').inputValue()).toBe(randomLibraryId); + await expect(libraryDetails.getVisibilityField('Visibility').locator('.mat-mdc-select-value').getByText(publicVisibility)).toBeVisible(); + expect(await libraryDetails.getDescriptionField.inputValue()).toBe(randomLibraryDescription); createdLibrariesIds.push(randomLibraryId); }); test('[C280029] Cancel button', async () => { await expect(libraryDialog.getDialogTitle(libraryDialogTitle)).toBeVisible(); - await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName); + await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName); await libraryDialog.cancelButton.click(); await expect(libraryDialog.getDialogTitle(libraryDialogTitle)).toBeHidden(); @@ -210,33 +212,33 @@ test.describe('Create Libraries ', () => { 'a|a' ]; - await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName); + await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName); for (const specialLibraryId of idsWithSpecialChars) { - await libraryDialog.getLabelText(libraryIdLabel).clear(); - await libraryDialog.getLabelText(libraryIdLabel).fill(specialLibraryId); + await libraryDialog.getElementByPlaceholder(libraryIdLabel).clear(); + await libraryDialog.getElementByPlaceholder(libraryIdLabel).fill(specialLibraryId); await libraryDialog.page.keyboard.press(tabKeyString); - await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(specialLibraryId); + await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toHaveValue(specialLibraryId); expect(await libraryDialog.isErrorMessageDisplayed(libraryErrors.useNumbersAndLettersOnly), errorMessageNotPresent).toBe(true); await expect(libraryDialog.createButton).toBeDisabled(); } }); test('[C280027] Duplicate library ID', async () => { - await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName); - await libraryDialog.getLabelText(libraryIdLabel).clear(); - await libraryDialog.getLabelText(libraryIdLabel).fill(commonLibraryName); + await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName); + await libraryDialog.getElementByPlaceholder(libraryIdLabel).clear(); + await libraryDialog.getElementByPlaceholder(libraryIdLabel).fill(commonLibraryName); await libraryDialog.page.keyboard.press(tabKeyString); - await expect(libraryDialog.getLabelText(libraryIdLabel)).toHaveValue(commonLibraryName); + await expect(libraryDialog.getElementByPlaceholder(libraryIdLabel)).toHaveValue(commonLibraryName); await expect(libraryDialog.createButton).toBeDisabled(); expect(await libraryDialog.isErrorMessageDisplayed(libraryErrors.libraryIdIsNotAvailable), errorMessageNotPresent).toBe(true); }); test('[C280028] Create library using the ID of a library from the Trashcan', async () => { - await libraryDialog.getLabelText(libraryNameLabel).fill(randomLibraryName); - await libraryDialog.getLabelText(libraryIdLabel).clear(); - await libraryDialog.getLabelText(libraryIdLabel).fill(commonTrashLibraryName); + await libraryDialog.getElementByPlaceholder(libraryNameLabel).fill(randomLibraryName); + await libraryDialog.getElementByPlaceholder(libraryIdLabel).clear(); + await libraryDialog.getElementByPlaceholder(libraryIdLabel).fill(commonTrashLibraryName); await libraryDialog.page.keyboard.press(tabKeyString); await expect(libraryDialog.createButton).toBeEnabled(); diff --git a/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts b/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts index 9368b2116..c87f88fc3 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/actions-dropdown.component.ts @@ -52,7 +52,7 @@ export enum ActionType { export class ActionsDropdownComponent extends BaseComponent { private static rootElement = 'aca-rule-action-list'; - private getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-select-panel .mat-option-text', { hasText: optionName }).first(); + private getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName }).first(); private ruleActionLocator = this.getChild('aca-rule-action'); private addActionButtonLocator = this.getChild('[data-automation-id="rule-action-list-add-action-button"]'); private actionDropdownLocator = this.getChild('[data-automation-id="rule-action-select"]'); @@ -60,7 +60,7 @@ export class ActionsDropdownComponent extends BaseComponent { private actionCheckInInputLocator = '[data-automation-id="header-description"] input'; private actionAutoDeclareLocator = '[data-automation-id="header-version"] mat-select'; private actionSimpleWorkflowStepInputLocator = '[data-automation-id="header-approve-step"] input'; - private actionSimpleWorkflowApproveFolderLocator = `[data-automation-id="header-approve-folder"] input`; + private actionSimpleWorkflowApproveFolderLocator = `[data-automation-id="header-approve-folder"] mat-icon`; private actionSimpleWorkflowActionChoiceLocator = '[data-automation-id="content-node-selector-actions-choose"]'; private actionSimpleWorkflowLabelApproveLocator = `[data-automation-id="card-boolean-label-approve-move"]`; private actionSimpleWorkflowSRejectStepLocator = '[data-automation-id="header-reject-step"] input'; diff --git a/projects/aca-playwright-shared/src/page-objects/components/adf-info-drawer.component.ts b/projects/aca-playwright-shared/src/page-objects/components/adf-info-drawer.component.ts index 66f9ecff0..1a55644f5 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/adf-info-drawer.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/adf-info-drawer.component.ts @@ -32,10 +32,10 @@ export class AdfInfoDrawerComponent extends BaseComponent { super(page, AdfInfoDrawerComponent.rootElement); } - public getNameField = (labelText: string) => this.getChild('[data-automation-id="library-name-properties-wrapper"]', { hasText: labelText }); - public getIdField = (labelText: string) => this.getChild('[data-automation-id="library-id-properties-wrapper"]', { hasText: labelText }); + public getNameField = (labelText: string) => this.getChild(`[data-automation-id="library-name-properties-wrapper"] input[placeholder='${labelText}']`); + public getIdField = (labelText: string) => this.getChild(`[data-automation-id="library-id-properties-wrapper"] input[placeholder='${labelText}']`); public getVisibilityField = (labelText: string) => - this.getChild('[data-automation-id="library-visibility-properties-wrapper"]', { hasText: labelText }); + this.getChild(`[data-automation-id="library-visibility-properties-wrapper"] mat-select[ng-reflect-placeholder='${labelText}']`); public getDescriptionField = this.getChild('[data-automation-id="library-description-properties-wrapper"] textarea'); public propertiesTab = this.page.getByRole('tab', { name: 'Properties' }); public commentsTab = this.page.getByRole('tab', { name: 'Comments' }); @@ -52,14 +52,14 @@ export class AdfInfoDrawerComponent extends BaseComponent { public editButton = this.page.getByRole('button', { name: 'Edit' }); public cancelButton = this.page.getByRole('button', { name: 'Cancel' }); public updateButton = this.page.getByRole('button', { name: 'Update' }); - public hintMessage = this.page.locator('.mat-hint'); - public errorMessage = this.page.locator('.mat-error'); + public hintMessage = this.page.locator('mat-hint'); + public errorMessage = this.page.locator('mat-error'); public expandDetailsButton = this.getChild(`button[title='Expand panel']`); - public expandedDetailsTabs = this.page.locator('.aca-details-container .mat-tab-label-content'); + public expandedDetailsTabs = this.page.locator('.aca-details-container .mdc-tab__text-label'); public expandedDetailsPermissionsTab = this.expandedDetailsTabs.getByText('Permissions'); - public nameField = this.page.locator('label', { hasText: 'Name' }); - public idField = this.page.locator('label', { hasText: 'Library ID' }); - public descriptionField = this.page.locator('label', { hasText: 'Description' }); + public nameField = this.page.locator('input[placeholder=Name]'); + public idField = this.page.locator(`input[placeholder='Library ID']`); + public descriptionField = this.page.locator('textarea[placeholder=Description]'); public visibilityField = this.infoDrawerPanel.getByRole('combobox'); public selectVisibility = (visibilityOption: string) => this.page.getByRole('listbox').getByRole('option', { name: visibilityOption }).click(); diff --git a/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts b/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts index 5ba5eeea0..db9ec9862 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/conditions.component.ts @@ -39,7 +39,7 @@ export enum Comparator { } export class ConditionComponent extends ManageRulesDialogComponent { - private getOptionLocator = (optionName: string): Locator => this.page.locator(`.cdk-overlay-pane .mat-option span`, { hasText: optionName }); + private getOptionLocator = (optionName: string): Locator => this.page.locator(`.cdk-overlay-pane .mat-mdc-option span`, { hasText: optionName }); private async selectField(fields: Partial, index: number): Promise { await this.fieldDropDown.nth(index).click(); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts index 0d1258fea..7b239b569 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dataTable/mat-menu.component.ts @@ -26,7 +26,7 @@ import { Page, expect } from '@playwright/test'; import { BaseComponent } from '../base.component'; export class MatMenuComponent extends BaseComponent { - private static rootElement = '.mat-menu-content'; + private static rootElement = '.mat-mdc-menu-content'; constructor(page: Page) { super(page, MatMenuComponent.rootElement); @@ -39,8 +39,8 @@ export class MatMenuComponent extends BaseComponent { public createFileFromTemplate = this.getChild('[id="app.create.fileFromTemplate"]'); public createLibrary = this.getChild('[id="app.create.library"]'); public getButtonByText = (text: string) => this.getChild('button', { hasText: text }); - public cancelEditingAction = this.getChild(`.mat-menu-item[title='Cancel Editing']`); - public editOfflineAction = this.getChild(`.mat-menu-item[title='Edit Offline']`); + public cancelEditingAction = this.getChild(`.mat-mdc-menu-item[title='Cancel Editing']`); + public editOfflineAction = this.getChild(`.mat-mdc-menu-item[title='Edit Offline']`); async clickMenuItem(menuItem: string): Promise { const menuElement = this.getButtonByText(menuItem); @@ -56,11 +56,11 @@ export class MatMenuComponent extends BaseComponent { } async verifyActualMoreActions(expectedToolbarMore: string[]): Promise { - await this.page.locator('.mat-menu-content').waitFor({ state: 'attached' }); - let menus = await this.page.$$('.mat-menu-content .mat-menu-item'); + await this.page.locator('.mat-mdc-menu-content').waitFor({ state: 'attached' }); + let menus = await this.page.$$('.mat-mdc-menu-content .mat-mdc-menu-item'); let actualMoreActions: string[] = await Promise.all( menus.map(async (button) => { - const title = await (await button.$('span')).innerText(); + const title = await (await button.$('.mdc-list-item__primary-text span')).innerText(); return title || ''; }) ); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-folder-dialog.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-folder-dialog.component.ts index 8af24aae3..8f897f090 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-folder-dialog.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-folder-dialog.component.ts @@ -39,7 +39,7 @@ export class AdfFolderDialogComponent extends BaseComponent { super(page, AdfFolderDialogComponent.rootElement); } - public getLabelText = (text: string) => this.getChild('label', { hasText: text }); + public getElementByPlaceholder = (element:string, text: string) => this.getChild(`${element}[placeholder='${text}']`); /** * This method is used when we want to fill in Create new Folder Dialog and choose Create button diff --git a/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-library-dialog.component.ts b/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-library-dialog.component.ts index 06002fb79..bb9c7d7d4 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-library-dialog.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dialogs/adf-library-dialog.component.ts @@ -37,7 +37,8 @@ export class AdfLibraryDialogComponent extends BaseComponent { } public getLabelText = (text: string) => this.getChild('label', { hasText: text }); - public getDialogTitle = (text: string) => this.getChild('.mat-dialog-title', { hasText: text }); + public getElementByPlaceholder = (text: string) => this.page.getByPlaceholder(text); + public getDialogTitle = (text: string) => this.getChild('.mat-mdc-dialog-title', { hasText: text }); public getErrorByText = (text: string): Locator => this.page.locator('mat-error', {hasText: text}); /** @@ -49,10 +50,13 @@ export class AdfLibraryDialogComponent extends BaseComponent { * @param visibility visibility of the library */ async createLibraryWithNameAndId(nameInput: string, libraryIdInput: string, descriptionInput?: string, visibility?: string): Promise { - await this.getLabelText('Name *').fill(nameInput); - await this.getLabelText('Library ID *').clear(); - await this.getLabelText('Library ID *').fill(libraryIdInput); - if (descriptionInput) { await this.getLabelText('Description').fill(descriptionInput); } + // TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF + await this.getElementByPlaceholder('Name').fill(nameInput); + // TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF + await this.getElementByPlaceholder('Library ID').clear(); + // TODO [ACS-7575] add '*' after it is added to the placeholder/label in ADF + await this.getElementByPlaceholder('Library ID').fill(libraryIdInput); + if (descriptionInput) { await this.getElementByPlaceholder('Description').fill(descriptionInput); } if (visibility) { await this.getLabelText(visibility).click(); } await this.createButton.click(); await this.spinnerWaitForReload(); diff --git a/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts b/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts index e886c31dd..5f58335f6 100755 --- a/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/dialogs/content-node-selector-dialog.ts @@ -34,9 +34,9 @@ export class ContentNodeSelectorDialog extends BaseComponent { public cancelButton = this.getChild('[data-automation-id="content-node-selector-actions-cancel"]'); public actionButton = this.getChild('[data-automation-id="content-node-selector-actions-choose"]'); - public locationDropDown = this.getChild('[id="site-dropdown-container"]'); + public locationDropDown = this.getChild('[id="site-dropdown-container"] mat-form-field'); private selectedRow = this.getChild('.adf-is-selected'); - getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-select-panel .mat-option-text', { hasText: optionName }); + getOptionLocator = (optionName: string): Locator => this.page.locator('.mat-mdc-select-panel .mdc-list-item__primary-text', { hasText: optionName }); private getRowByName = (name: string | number): Locator => this.getChild(`adf-datatable-row`, { hasText: name.toString() }); getDialogTitle = (text: string) => this.getChild('[data-automation-id="content-node-selector-title"]', { hasText: text }); getBreadcrumb = (text: string) => this.getChild('[data-automation-id="current-folder"]', { hasText: text }); diff --git a/projects/aca-playwright-shared/src/page-objects/components/manageRules/manage-rules.component.ts b/projects/aca-playwright-shared/src/page-objects/components/manageRules/manage-rules.component.ts index d8f154ede..abaa48bfb 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/manageRules/manage-rules.component.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/manageRules/manage-rules.component.ts @@ -29,7 +29,7 @@ export class ManageRules extends BaseComponent { private static rootElement = '.aca-manage-rules'; public getGroupsList = (optionName: string): Locator => this.getChild('.aca-rule-list-item__header', { hasText: optionName }); - public disableRuleToggle = this.getChild('.aca-manage-rules__container .mat-slide-toggle-bar').first(); + public disableRuleToggle = this.getChild('.aca-manage-rules__container .mdc-switch__track').first(); constructor(page: Page) { super(page, ManageRules.rootElement); diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts index abd5eba76..2367cf900 100644 --- a/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-overlay.components.ts @@ -28,9 +28,9 @@ import { BaseComponent } from '.././base.component'; export class SearchOverlayComponent extends BaseComponent { private static rootElement = '.cdk-overlay-pane'; - public searchFilesOption = this.getChild('label[for="content-input"]'); - public searchFoldersOption = this.getChild('label[for="folder-input"]'); - public searchLibrariesOption = this.getChild('label[for="libraries-input"]'); + public searchFilesOption = this.getChild('input#content-input'); + public searchFoldersOption = this.getChild('input#folder-input'); + public searchLibrariesOption = this.getChild('input#libraries-input'); public searchInput = this.page.locator('#app-control-input'); public searchButton = this.page.locator('#app-search-button'); public searchInputControl = this.page.locator('.app-search-control'); @@ -42,17 +42,17 @@ export class SearchOverlayComponent extends BaseComponent { async isFoldersOptionChecked() { const optClass = await this.searchFoldersOption.getAttribute('class'); - return optClass.includes('mat-checkbox-checked'); + return optClass.includes('mat-mdc-checkbox-checked'); } async isFilesOptionChecked() { const optClass = await this.searchFilesOption.getAttribute('class'); - return optClass.includes('mat-checkbox-checked'); + return optClass.includes('mat-mdc-checkbox-checked'); } async isLibrariesOptionChecked() { const optClass = await this.searchLibrariesOption.getAttribute('class'); - return optClass.includes('mat-checkbox-checked'); + return optClass.includes('mat-mdc-checkbox-checked'); } async clearOptions() { diff --git a/projects/aca-playwright-shared/src/page-objects/components/search/search-sorting-picker.components.ts b/projects/aca-playwright-shared/src/page-objects/components/search/search-sorting-picker.components.ts index 8952d8c5c..a0aae8d1b 100755 --- a/projects/aca-playwright-shared/src/page-objects/components/search/search-sorting-picker.components.ts +++ b/projects/aca-playwright-shared/src/page-objects/components/search/search-sorting-picker.components.ts @@ -33,8 +33,8 @@ export class SearchSortingPicker extends BaseComponent { public actionMenu = this.page.locator('[data-automation-id="auto_header_content_id_$thumbnail"]'); public sortOrderButton = this.page.locator('#aca-button-sorting-menu'); - public sortByDropdownExpanded = this.page.locator('.mat-menu-panel').first(); - public sortByList = this.page.locator('.mat-menu-panel button'); + public sortByDropdownExpanded = this.page.locator('.mat-mdc-menu-panel').first(); + public sortByList = this.page.locator('.mat-mdc-menu-panel button'); constructor(page: Page, rootElement = SearchSortingPicker.rootElement) { super(page, rootElement); @@ -76,7 +76,7 @@ export class SearchSortingPicker extends BaseComponent { await this.clickSortByDropdown(); } const elem = this.sortByList.getByText(option); - const optionId = await elem.getAttribute('id'); + const optionId = await elem.locator("..").getAttribute('id'); await elem.click(); const directionSortElement = this.page.locator(`[id="${optionId}-${direction.toLocaleLowerCase()}"]`); await directionSortElement.click();