一键导入
e2e
E2E test guide for org-node-ui-lite (Playwright + Emacs integration)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
E2E test guide for org-node-ui-lite (Playwright + Emacs integration)
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
How to manage agent primitives (skills and instructions) via Agent Package Manager. Use when adding, editing, or removing skills or instructions.
Best practices for Emacs Lisp testing in this repository. Use when writing or debugging Elisp tests.
Best practices for GitHub Actions in this repository. Use when modifying or creating GitHub Actions workflows.
Best practices for Playwright E2E tests. Use when debugging or writing Playwright tests, especially when dealing with global setup or dev servers.
基于 SOC 职业分类
| name | e2e |
| description | E2E test guide for org-node-ui-lite (Playwright + Emacs integration) |
| trigger | automatic |
npm run test:e2e # Playwright + Emacs integration tests
Internally this is:
PLAYWRIGHT_BROWSERS_PATH=/opt/pw-browsers playwright test
Chromium binary lives at /opt/pw-browsers. Do not attempt to download a
different version; install the version that matches the already-present binary.
Playwright test
│ page.goto("http://localhost:5173")
▼
Vite dev server (port 5173) ← started by webServer in playwright.config.ts
│ /api/* → proxy
▼
Emacs HTTP server (port 5174) ← started by globalSetup (e2e/global-setup.ts)
│ org-mem scans e2e/fixtures/*.org
▼
org-node-ui-lite-mode API (/api/graph.json, /api/node/:id.json)
Lifecycle:
globalSetup spawns emacs --batch --load e2e/emacs-server.el.eldev/29.3/packages/, sets org-mem-watch-dirs
to e2e/fixtures/, enables org-mem-updater-mode + org-node-cache-mode
(per the org-mem documented quickstart), then calls httpd-startglobalSetup polls http://localhost:5174/api/graph.json until ≥ 1 node
is returned — this naturally waits for the async org-mem scan to finishglobalTeardown sends SIGTERM to EmacsThe global-setup.ts also creates a stub packages/frontend/dist/index.html
so org-node-ui-lite-mode's dist-check passes (the actual frontend is served
by Vite, not Emacs, during tests).
Edit e2e/fixtures/*.org. Standard org-id format:
* Heading Title
:PROPERTIES:
:ID: some-unique-id
:END:
Content. Links use the standard org-id syntax:
[[id:target-id][Target Title]]
Rules:
:ID: property.[[id:X][Y]] link under a heading with ID src creates an edge src → X..org file is enough.| Symptom | Likely cause |
|---|---|
| "did not become ready within 90s" | Emacs batch startup crashed — check [emacs] stderr in test output |
graph endpoint returns 30 nodes fails | Fixture file has a heading without :ID:, or a duplicate ID |
graph endpoint returns 31 edges fails | A fixture file has unintended [[id:...]] links in prose/examples |
node endpoint returns backlinks for X fails | The source node's fixture file is missing the expected link |
| UI tests fail despite API passing | Vite proxy not running — check npm run dev output |
To inspect what Emacs actually returns:
curl -s http://localhost:5174/api/graph.json | python3 -m json.tool | head -40
curl -s http://localhost:5174/api/node/math-linear-algebra.json | python3 -m json.tool
(Only works while an E2E test run is in progress, or if you manually start Emacs.)
org-mem / el-job-ng internals to implement waiting logic.
The polling loop in global-setup.ts is the correct approach.org-mem-watch-dirs, org-mem-updater-mode) is sufficient.