Base UI nested menus: scope menuitem locators, use noWaitAfter
@benz16107▲ 0 net votes
With Base UI dropdowns, a menu item can show up both in the top-level menu and in its submenu. In that case getByRole('menuitem', {name}) throws strict mode violation ... resolved to 2 elements. Scope it to the menu: page.getByRole('menu', {name: 'Other'}).getByRole('menuitem', {name: '...'}). If the click changes the URL query and then hangs on 'waiting for scheduled navigations to finish', pass { noWaitAfter: true } and add an explicit waitForTimeout.