test(integration): make plotly search robust to astrolabe NcTextArea (nc32)

Root cause of the multi-user-basic/nc32 failure: the appstore installs
DIFFERENT astrolabe versions per NC major (min-version jumped 31->32 at
astrolabe 0.25.0). NC31 pulls astrolabe 0.24.0 (search box = NcTextField ->
<input>, submits on Enter); NC32 pulls 0.29.0 (search box = NcTextArea ->
<textarea>, submits on Ctrl/Cmd+Enter). The test's `.mcp-search-input input`
selector + Enter never matched the textarea on nc32, so it timed out after the
SPA mounted fine. This was latent all along but masked on nc32 by the
vector-sync gauge flake, which failed the test earlier; fixing that flake
unmasked it.

Fix: match either `.mcp-search-input textarea, .mcp-search-input input` and
submit based on the element tag (Ctrl+Enter for textarea, Enter for input).
Verified against a live NC32 + astrolabe 0.29.0 stack: the textarea is found
and Ctrl+Enter fires GET /apps/astrolabe/api/search. All other selectors the
test uses (.mcp-loading/.mcp-error/.mcp-results/scatter3d) still exist in 0.29.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-18 00:20:14 +02:00
co-authored by Claude Opus 4.8
parent 650e60de57
commit b8a9400ee0
@@ -245,20 +245,27 @@ The visualization should show this document as a point in PCA-reduced space.
# Phase 5: Navigate to Astrolabe and perform search
await navigate_to_astrolabe_main(page)
# Fill search query - find the Astrolabe search input specifically
# The NcTextField component wraps the input in a div with class mcp-search-input.
# 30s (not 10s): the Astrolabe SPA can be slow to mount its search
# component on a loaded CI runner (observed on nc32) — matches the
# loading-indicator budget below.
search_input = page.locator(".mcp-search-input input")
# Find the Astrolabe search field. The published app differs across
# the NC matrix: NC31 pulls astrolabe <=0.24 (NcTextField -> <input>,
# submits on Enter); NC32 pulls astrolabe >=0.25 (NcTextArea ->
# <textarea>, submits on Ctrl/Cmd+Enter). Match either element so the
# test isn't pinned to one frontend revision.
# 30s (not 10s): the SPA can be slow to mount on a loaded CI runner.
search_input = page.locator(
".mcp-search-input textarea, .mcp-search-input input"
).first
await search_input.wait_for(timeout=30000, state="visible")
await search_input.fill(unique_term)
logger.info("Entered search query: %s", unique_term)
# Trigger search by pressing Enter on the input field
# This is wired to performSearch via @keyup.enter in the Vue component
await search_input.press("Enter")
logger.info("Pressed Enter to trigger search")
# Trigger search. NcTextField submits on Enter; NcTextArea inserts a
# newline on Enter and submits on Ctrl/Cmd+Enter — so key off the tag.
field_tag = await search_input.evaluate("el => el.tagName.toLowerCase()")
if field_tag == "textarea":
await search_input.press("Control+Enter")
else:
await search_input.press("Enter")
logger.info("Triggered search via %s submit", field_tag)
# Wait for loading to complete - watch for loading indicator to disappear
loading_indicator = page.locator(".mcp-loading")