Repository navigation
Tests: follow Compare chat into the More submenu in the Playwright chat UI driver - #6153
Conversation
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.
There was a problem hiding this comment.
Code Review
This pull request updates the Playwright chat UI tests to handle a decluttered plus menu where the 'Compare chat' option is now nested under a 'More' submenu. The feedback suggests simplifying the fallback logic by leveraging Playwright's lazy locators, which makes re-assigning the 'compare_item' locator multiple times redundant.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| 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) |
There was a problem hiding this comment.
In Playwright, locators are lazy and represent a query formulation rather than a static element reference. Calling .count() or any other action/query on compare_item will automatically re-evaluate the locator against the current DOM. Re-assigning compare_item = page.get_by_role(...) multiple times is redundant and can be safely removed to simplify the code.
| 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) | |
| 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) | |
| if compare_item.count() == 0: | |
| more_trigger.click(force = True) | |
| page.wait_for_timeout(400) |
Brings the Playwright chat UI driver fix (unslothai#6153) that follows Compare chat into the More submenu; the previous merge predated it, which is why Chat UI Tests failed on this branch with 'Compare chat item not found'.
PR #6153 taught the chat UI driver to find Compare chat inside the decluttered plus menu (#6140) but the extra UI driver kept looking for the old top-level item, so all three Studio UI CI workflows have been red on main since (Compare nav not found). Mirror the same hover-then-click More fallback here.
…er (#6177) PR #6153 taught the chat UI driver to find Compare chat inside the decluttered plus menu (#6140) but the extra UI driver kept looking for the old top-level item, so all three Studio UI CI workflows have been red on main since (Compare nav not found). Mirror the same hover-then-click More fallback here.
Summary
Chat UI Tests has been red on every PR since this morning (for example #6146 and #6148, whose diffs touch unrelated code) with:
Root cause: the plus-menu declutter (#6140) moved the Compare chat item into a nested "More" submenu (
DropdownMenuSubinthread.tsxandshared-composer.tsx), and the Playwright driver still looked for it at the top level of the plus menu. The UI itself is fine for users; this is driver-vs-UI drift.Change
After opening the plus menu, if Compare chat is not directly present, open the "More" sub-trigger (hover first, click as a fallback for environments where hover does not expand Radix submenus) and look again. The direct lookup stays first, so the driver keeps passing if the item ever moves back to the top level.
Testing
py_compilepasses; the real verification is this PR's own Chat UI Tests check, which exercises the driver against the built UI. Note the same runs also confirmed the b9585 prebuilt installs and validates in CI ("prebuilt installed and validated"), so once this lands the Chat UI lane should be fully green again.Related
The other repo-wide red (Core HF=latest) is the transformers v5 strict-config break in unsloth_zoo's use_cache tests, fixed separately in unslothai/unsloth-zoo#746.