Browser tests: nodes instead of documents; addresses by node id; /linkhere and /linkall
menu.spec.ts becomes nodes.spec.ts: standing on the library root, /n/<id> addresses through a reload, Back and Forward (and an old /doc/ address), the jump box, a file imported into a node two levels down with a link relative to its top, exported back the same and copied just after itself, Move under… by key and by the menu (never under itself; the root offered first), history's f and r on the node the reader is on, the offline round trip, the node routes over HTTP, and panes and phone width. The other specs open a tree by its titles (helpers openAt, openPage, visit: /n/<id>, hoisted in the column as /doc/ was), make top-level sections from the library page instead of /new, scan with /linkhere (and check its scope against /linkall's), and expect a section's head on every pane but the first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
1 parent
bed47c0c7a
commit
c4d6856649
17 files changed
+584
-490
No files matched your search
+2
-2
@@ -5,7 +5,7 @@
|
||||
* a menu's button closes it; a link's underline and its curve are one stroke at every pixel ratio.
|
||||
*/
|
||||
import { expect, test, type Browser, type Page } from "@playwright/test";
|
||||
import { autoLayout, curveFaults, pixels, seedLinks, settle } from "./helpers";
|
||||
import { autoLayout, curveFaults, pixels, seedLinks, settle, visit } from "./helpers";
|
||||
|
||||
const pane = (page: Page, title: string | RegExp) =>
|
||||
typeof title === "string" ? page.locator(".strip .pane", { has: page.locator(`:is(.wiki-head h2, .pane-head h2, .top h1):text-is("${title}")`) }).first() : page.locator(".strip .pane", { has: page.locator(`:is(.wiki-head h2, .pane-head h2, .top h1)`, { hasText: title }) }).first();
|
||||
@@ -176,7 +176,7 @@ async function linked(browser: Browser, dpr: number) {
|
||||
await ctx.route(/wikipedia\.org|wikimedia\.org|stanford\.edu|example\.org/, (r) => r.abort());
|
||||
const page = await ctx.newPage();
|
||||
await autoLayout(page);
|
||||
await page.goto("/doc/the-one-merger");
|
||||
await visit(page, "The one merger");
|
||||
await page.waitForSelector(".strip .pane");
|
||||
await page.evaluate(() => document.fonts.ready);
|
||||
await page.waitForFunction(() => (globalThis as any).__ie?.ready);
|
||||
|
||||
Reference in new issue
Block a user