From 2599f9fe9d9bfba144effce92de2be43eed2f203 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 10 Jun 2026 08:05:24 -0700 Subject: [PATCH] Tests: follow Compare chat into the More submenu in the Playwright chat UI driver (#6153) * tests: follow Compare chat into the More submenu in the chat UI driver The plus-menu declutter moved the Compare chat item into a More submenu (DropdownMenuSub in thread.tsx / shared-composer.tsx), so the Playwright driver stopped finding it at the top level and Chat UI Tests went red on every PR regardless of its diff. Open the More sub-trigger (hover, then click as a fallback) before asserting the item; the direct lookup stays first so the driver still passes if the item moves back. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: danielhanchen Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- tests/studio/playwright_chat_ui.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/studio/playwright_chat_ui.py b/tests/studio/playwright_chat_ui.py index dc62194be8..4739d519d9 100644 --- a/tests/studio/playwright_chat_ui.py +++ b/tests/studio/playwright_chat_ui.py @@ -1100,6 +1100,22 @@ with sync_playwright() as p: plus_btn.click(force = True) page.wait_for_timeout(400) compare_item = page.get_by_role("menuitem", name = re.compile(r"Compare chat", re.I)).first + if compare_item.count() == 0: + # The plus menu was decluttered: Compare chat now lives in the + # "More" submenu; hover (then click as fallback) to open it. + more_trigger = page.get_by_role("menuitem", name = re.compile(r"^More$", re.I)).first + if more_trigger.count() > 0: + more_trigger.hover() + page.wait_for_timeout(400) + compare_item = page.get_by_role( + "menuitem", name = re.compile(r"Compare chat", re.I) + ).first + if compare_item.count() == 0: + more_trigger.click(force = True) + page.wait_for_timeout(400) + compare_item = page.get_by_role( + "menuitem", name = re.compile(r"Compare chat", re.I) + ).first if compare_item.count() > 0: compare_item.click(force = True) page.wait_for_timeout(800)