fix(test): use role selector for Reka UI context menu

data-reka-context-menu-content attribute does not exist on Reka UI
ContextMenuContent. Use getByRole('menu') and getByRole('menuitem')
for reliable context menu detection.
This commit is contained in:
dante01yoon
2026-04-01 15:22:20 +09:00
parent a6eb5acaa9
commit 5530956e7f

View File

@@ -66,12 +66,15 @@ test.describe('Workflow tabs', () => {
await topbar.getTab(0).click({ button: 'right' })
const contextMenu = comfyPage.page.locator(
'[data-reka-context-menu-content]'
)
await expect(contextMenu).toBeVisible()
// Reka UI ContextMenuContent renders with role="menu"
const contextMenu = comfyPage.page.getByRole('menu')
await expect(contextMenu).toBeVisible({ timeout: 5000 })
await expect(contextMenu).toContainText('Close Tab')
await expect(contextMenu).toContainText('Save')
await expect(
contextMenu.getByRole('menuitem', { name: /Close Tab/i })
).toBeVisible()
await expect(
contextMenu.getByRole('menuitem', { name: /Save/i })
).toBeVisible()
})
})