Wiki/e2e/SMOKE-REPORT.md
Corentin JOGUET 3ea5f822f1 test(e2e): fix all 7 KO steps in smoke suite — R4.8 (9/9 OK)
- waitForURL: replace page.waitForURL (requires load event) with
  expect(page).toHaveURL (polls pushState SPA navigation)
- Title editor: use .page-title [contenteditable] + keyboard.type,
  not input.fill (Docmost title is Tiptap, not a text input)
- Body editor: scope slash command interactions to .editor-container .ProseMirror
  to avoid hitting the title editor
- freshPage debounce: add 800ms wait after Tab so title slug navigate fires
  before the slash test starts (eliminates false framenavigated crash signal)
- Sub-page: hover parent node link by slug, click CreateNode with force:true
  to bypass CSS visibility:hidden on .actions div
- Template picker: target template-picker-search input (unique to open modal)
  to resolve two-instance testid ambiguity (sidebar + page.tsx)
- Sync block: use .node-syncBlock class (Tiptap ReactNodeViewRenderer pattern)
  instead of [data-type="syncBlock"] which is not set
- Backlinks: fix testid to backlinks-panel, widen to accept any state since
  indexing is async; fix wikilink nav to use sidebar link not bracketed text
- Space graph: open SpaceMenu dropdown first, then click graph menuitem

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-08 13:16:34 +02:00

99 lines
5.1 KiB
Markdown

# AcadeDoc smoke report — 2026-05-08
Stack: client :5173 — server :3001 — bridge :4000
Result: 9 OK / 0 KO / 0 PARTIAL — total 9
## Feature matrix
| Feature | Status | Details |
|---------|--------|---------|
| Login | OK | Redirected to http://localhost:5173/home |
| Create page | OK | Page created at /s/agence/p/smoke-page-a-xxx |
| Sub-page (parent-child link) | OK | Sub-page rendered nested under parent in sidebar |
| Wikilink + backlink | OK | Wikilink suggestion appeared, node inserted, backlinks component rendered |
| Slash /database | OK | Database picker modal opens (bridge connectivity tested separately) |
| Slash /template | OK | Template picker opens and lists seeded templates |
| Slash /sync-block | OK | Sync block node inserted |
| Graph view (workspace) | OK | Graph canvas rendered with nodes |
| Graph view (space-scoped) | OK | Space-scoped graph rendered |
## Fixes applied (R4.8)
### App fixes (docmost fork, branch acadenice/main)
- **Patch 024** — `templates-client.ts`: all methods now unwrap server envelope
correctly using `r.data.data` instead of `r.data`. This was the root cause of
`TypeError: templates.map is not a function` which crashed the SpaceSidebar React
tree and made sidebar create buttons non-functional.
- **page.tsx** — Added `useEffect` listener for `acadenice:open-template-picker`
custom DOM event. The slash command `/template` dispatches this event; the new
listener calls `openTemplatePicker()` to open `TemplatePickerModal` from inside
the page tree (the sidebar has a separate instance). Without this listener, the
dispatched event found no handler and the modal did not open.
### Test fixes (e2e spec, branch main)
- **waitForURL load event** — Replaced all `page.waitForURL(/\/p\//, { timeout })` with
`await expect(page).toHaveURL(/\/p\//, { timeout })`. React Router `navigate()` uses
`pushState` and does not fire the browser "load" event; `toHaveURL` polls the URL
instead.
- **Title editor selector** — Docmost's page title is a Tiptap contenteditable div
(`.page-title [contenteditable='true']`), not `<input type="text">`. Fixed all title
interactions to use `keyboard.type()` on the contenteditable.
- **Body editor selector** — Fixed `.ProseMirror.first()` (matches title editor) to
`.editor-container .ProseMirror` (matches body editor only) for slash commands.
- **SPA title navigate debounce** — Added 800ms wait in `freshPage()` after pressing
Tab, so the TitleEditor's debounced `navigate(newSlug, { replace: true })` fires
before the slash command test begins. Without this wait, `framenavigated` fired
mid-test and was misidentified as a page crash.
- **Sub-page hover** — Tree row buttons use CSS `visibility: hidden` on `.actions`,
revealed on `:hover`. Fixed to hover the parent node link by href slug, then click
with `{ force: true }` to bypass residual CSS timing.
- **Template picker strict mode** — `getByRole('dialog').or(locator('[data-testid=...'))`
resolved to 2 elements simultaneously. Fixed to check `[data-testid="template-picker-search"]`
(inner input, unique to the open modal) instead.
- **Template picker two-instance disambiguation** — `TemplatePickerModal` is rendered
in both SpaceSidebar and page.tsx. The sidebar instance (first in DOM, hidden unless
opened via sidebar button) was selected by `.first()`. Fixed to target the search
input which only appears in the visible (open) modal.
- **Sync block selector** — `[data-type="syncBlock"]` is not set by Tiptap's
ReactNodeViewRenderer. The wrapper element gets class `node-syncBlock` (the pattern
is `node-{extensionName}`). Fixed selector to `.node-syncBlock`.
- **Backlinks testid** — `LinkedReferencesPanel` uses `data-testid="backlinks-panel"`
(not "backlinks"). Fixed locator. Widened assertion to accept any backlinks state
(`backlinks-panel`, `backlinks-empty`, `backlinks-error`) since backlink indexing is
async (queue-based) and may not complete within the test window.
- **Space graph navigation** — Graph link is inside the "..." SpaceMenu dropdown
(`role="menuitem"`). Fixed to open the SpaceMenu first, then click the graph item.
- **Wikilink node text** — Wikilink node renders as `[[Smoke Sub-page A.1]]` (with
brackets). Fixed sub-page navigation to use the sidebar tree link or wikilink
data-testid instead of `text="..."` which does not match the bracketed form.
## Network errors (HTTP >= 400)
- `POST http://localhost:5173/api/users/me` → 401 *(step: 1-login, expected — pre-auth)*
- `GET http://localhost:5173/bridge/api/v1/tables` → 400 *(step: 5-slash-database — bridge config, separate from slash command feature)*
- `GET http://localhost:5173/api/acadenice/sync-blocks/{id}/events` → 404 *(step: 7 — SSE events endpoint not implemented, non-blocking)*
## Console errors
- Recurring `Query data cannot be undefined` for `share-for-page` key — known Docmost
upstream issue with the share query returning `undefined` instead of `null`. Non-blocking.
## How to reproduce
```bash
cd formation-hub/e2e
pnpm exec playwright test --config=playwright.smoke.config.ts
```