[MM-61570]: Refactored the post priority menu and fixed the keyboard navigation issue in the menu. (#29583)

* [MA-7]: Refactored the post priority menu and fixed the keyboard navigation issue in the menu

* [MA-7]: Updated the menu list structure and fixed menu not closing bug

* [MA-7]: Review fixes minor code structure fixes

* [MA-7]: Fixed failing e2e test cases

* [MA-7]: Fixed styling and Keyboard behaviour of menu

* [MA-7]: Minor changes after rebased with master

* [MA-7]: Fixed failing playwright test case

* [MA-7]: Fixed failing e2e test cases

* [MA-7]: Fixed reverting of selected priority to previous value on menu close

* [MA-7]: Fixed failing smoke test

* [MA-7]: Fixed submenu pointer event and failing playwright test cases

* [MA-7]: Fixed failing playwright test case

* fix playwright tests

* fix playwright tests

---------

Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Этот коммит содержится в:
ayush-chauhan233
2025-02-20 03:00:22 +05:30
коммит произвёл GitHub
родитель d76e0b9d3d
Коммит 102e3472d8
17 изменённых файлов: 371 добавлений и 452 удалений

Просмотреть файл

@@ -18,14 +18,14 @@ export default class MessagePriority {
this.priorityIcon = container.locator('#messagePriority');
// Priority menu that opens when clicking the icon
this.priorityMenu = container.locator('[role="menu"]').filter({hasText: /Message Priority/});
this.priorityMenu = container.locator('[role="menu"]');
// Standard priority option in the menu (id comes from webapp implementation)
this.standardPriorityOption = this.priorityMenu.locator('#menu-item-priority-standard');
// Priority dialog elements
this.priorityDialog = container.page().getByRole('dialog');
this.dialogHeader = this.priorityDialog.locator('h2.modal-title');
this.priorityDialog = container.page().getByRole('menu');
this.dialogHeader = container.page().locator('h4.modal-title');
}
async clickPriorityIcon() {
@@ -50,7 +50,7 @@ export default class MessagePriority {
}
async closePriorityMenu() {
await this.priorityIcon.click();
await this.priorityMenu.press('Escape');
await expect(this.priorityMenu).not.toBeVisible();
}
@@ -69,7 +69,7 @@ export default class MessagePriority {
}
async verifyStandardOptionSelected() {
const standardOption = this.priorityDialog.getByRole('menuitem', {name: 'Standard'});
const standardOption = this.priorityDialog.getByRole('menuitemradio', {name: 'Standard'});
await expect(standardOption).toBeVisible();
await expect(standardOption.locator('svg.StyledCheckIcon-dFKfoY')).toBeVisible();
}

Просмотреть файл

@@ -78,7 +78,7 @@ export default class ScheduledDraftModal {
*/
async selectTime() {
await this.timeLocator.click();
const timeButton = this.timeDropdownOptions.nth(1);
const timeButton = this.timeDropdownOptions.nth(2);
await expect(timeButton).toBeVisible();
await timeButton.click();
}