gui tests: list-sort reads the Library's servers without the MCP hub's row (#2679)

e0ea15b8e put the MCP hub's row (.lib-hublist) under the Library's
server list. list-sort's serverNames read every .lib-list's rows, so it
got "MCP hub" / "MCP 聚合" after the three servers and was red in both
engines and both languages (6 of 6) since then, on mote and on the
Linux box. Found by the whole GUI suite run for 85d159a28. The hub row
is no server and isn't sorted, so the selector leaves .lib-hublist out.

Run: node --test list-sort on mote (chromium + webkit, en + zh): 6/6;
the same on WSL magpie-desktop: 6/6. Red on the old selector: 6/6 on
WSL at fa2dfc145. No other GUI test reads .lib-list rows that way
(grep).

The rest of that suite's reds are already filed and red before
85d159a28 too (same files at fa2dfc145 on mote and Linux):
gateway-key-models #4081, routing-* #4121 #3789 #3799, rest-try-now
#4127, key-replace #4126, mobile-web #3952, search-first #3795.
This commit is contained in:
yetone
2026-10-29 07:51:58 +08:00
parent 310efb635c
commit 91a2f603cd
+2 -1
View File
@@ -94,7 +94,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
const tips = (sort) => page.locator(`.segs.sortby[data-sort="${sort}"] .opt`).evaluateAll((os) => os.map((o) => o.title));
// the Library's MCP servers: A→Z first, whatever order magpie gave them in
const serverNames = () => names("#view-library .lib-list .lib-row > .who > .name");
// (the MCP hub's row below them is no server, and isn't sorted)
const serverNames = () => names("#view-library .lib-list:not(.lib-hublist) .lib-row > .who > .name");
const openLib = async () => {
await page.goto("http://magpie.test/");
await page.locator('button[data-view="library"]').click();