* Gets a list of `MatMenuItemHarness` representing the items in the menu. * @param filters Optionally filters which menu items are included.
(
filters?: Omit<MenuItemHarnessFilters, 'ancestor'>,
)
| 96 | * @param filters Optionally filters which menu items are included. |
| 97 | */ |
| 98 | async getItems( |
| 99 | filters?: Omit<MenuItemHarnessFilters, 'ancestor'>, |
| 100 | ): Promise<MatMenuItemHarness[]> { |
| 101 | const panelId = await this._getPanelId(); |
| 102 | if (panelId) { |
| 103 | return this._documentRootLocator.locatorForAll( |
| 104 | MatMenuItemHarness.with({ |
| 105 | ...(filters || {}), |
| 106 | ancestor: `#${panelId}`, |
| 107 | } as MenuItemHarnessFilters), |
| 108 | )(); |
| 109 | } |
| 110 | return []; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Clicks an item in the menu, and optionally continues clicking items in subsequent sub-menus. |