Skip to content

Run the e2e suite in CI and cover the plugin's core behaviour - #214

Merged
frolic merged 3 commits into
mainfrom
frolic/obsidian-e2e-baseline
Jul 27, 2026
Merged

Run the e2e suite in CI and cover the plugin's core behaviour#214
frolic merged 3 commits into
mainfrom
frolic/obsidian-e2e-baseline

Conversation

@frolic

@frolic frolic commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

The e2e suite from #198 has never run anywhere — the repo only has manual-release.yml — and the one spec in it can't tell a working plugin from a broken one. It asserts the plugin appears in app.plugins.plugins, which Obsidian populates before onload() finishes, so it passes even when registration has failed and no file will open.

This runs the suite on pull requests and covers the behaviour an SDK upgrade is most likely to disturb, so there's a baseline to upgrade against rather than a leap of faith. It's the groundwork for #212, which bumps tldraw across a major version.

What's covered:

  • creating a drawing, editing it, and reading it back from disk — nothing covered saving before
  • the canvas background matching the Obsidian theme, and following a theme change
  • the plugin's own canvas chrome and main menu rendering

Two decisions worth knowing about:

  • Each spec creates its own drawing rather than opening a committed fixture. Nothing then depends on the schema version of a file on disk, so these specs stay valid across tldraw upgrades instead of needing new fixtures each time.
  • The UI spec clicks with WebdriverIO, not element.click(). tldraw's menus open on pointer events, which a synthetic in-page click doesn't produce — it silently opens nothing and the assertion passes against an empty string.

The workflow runs under xvfb because Obsidian is an Electron app and needs a display.

Test plan

Everything here is the test. Verified locally against the plugin as it stands today — 6 tests across 4 specs, ~22s:

✓ Should appear in the plugin list
✓ writes an edit to disk and reads it back
✓ matches the Obsidian theme background
✓ follows the Obsidian theme when it changes
✓ renders the canvas chrome
✓ renders the plugin main menu

Not covered

Visual correctness — these assert elements exist, not that they look right. Also markdown view mode, embeds in reading view, and mobile.

frolic added 3 commits July 27, 2026 14:59
The suite from #198 wasn't wired to anything, so this runs it on pull
requests, under xvfb because Obsidian is an Electron app.

Adds coverage for the parts a plugin upgrade is most likely to disturb:
creating a drawing, editing it, and reading it back from disk; the canvas
background matching the Obsidian theme and following a theme change; and
the plugin's own canvas chrome and main menu rendering.

The existing load-plugin spec asserts the plugin appears in
app.plugins.plugins, which Obsidian populates before onload() finishes —
so it passes even when the plugin is broken.

Each spec creates its own drawing rather than opening a committed
fixture, so nothing here depends on the schema version of a file on disk
and the suite stays valid across tldraw upgrades.
Whitespace-only churn from running prettier across the test folder; the
file's behaviour is untouched by this branch.
View mode is the plugin's own machinery rather than anything tldraw
provides: a drawing stored in markdown can be shown as a canvas or as
the note it really is, and the plugin swaps the leaf's view between them.

Embedding takes a different path again — the embed registry and a
TldrawImage rather than a full editor — and is the path the TldrawImage
patch exists for, so the test asserts an image actually rendered rather
than just that the container appeared. The embed loads lazily and needs
a shape to draw, so the drawing gets one first and is scrolled into view.
@frolic
frolic marked this pull request as ready for review July 27, 2026 14:09
@frolic
frolic merged commit 9cac7e2 into main Jul 27, 2026
1 check passed
@frolic
frolic deleted the frolic/obsidian-e2e-baseline branch July 27, 2026 14:11
frolic added a commit that referenced this pull request Jul 29, 2026
Bumps the version so 1.30.0 can be released to everyone, rather than
only to BRAT users as `1.30.0-alpha.1` was.

What ships in it:

- **tldraw 5.2.5** (#212), so `.tldr` files saved by a current version
of tldraw open instead of failing with `Incompatible schema?` and an
empty tab — likely closing #184, #138, and the "corrupted file" report
on #193
- **`.tldraw` messaging** (#211): opening one from tldraw offline
explains why it can't be opened yet and links to the export
instructions, rather than landing on Obsidian's unknown-file screen
- the e2e suite now running in CI (#214) and a one-click release (#215)

`npm version` cascades the version into `release/manifest.json` and
`release/versions.json` on its own — the repo has a `version` lifecycle
script — so those changes are mechanical.

### One thing that isn't mechanical

This drops a `"1.29.1"` entry from `release/versions.json`. That version
was staged in b48442c and never released — there's no tag and no GitHub
release for it. It matters here because releasing a non-prerelease
copies `release/versions.json` over the root `versions.json`, which is
the file the plugin registry reads, so the phantom entry would have been
published. Everything in that file shares the same `minAppVersion`, so
it was unlikely to misresolve anyone's install, but it shouldn't go out
either way.

After this, `release/versions.json` matches the published file exactly
apart from the new `1.30.0` line.

### Release plan

Merge, then Actions → Manual Release → Run workflow with `ref: main`.
Unlike the alpha, this path adds the `versions.json` entry and pushes
the manifest commit back, which is what makes it visible to everyone on
the community plugin list.

### Worth knowing before merging

`1.30.0-alpha.1` was published but, as far as I know, never installed
and exercised through BRAT. So the evidence behind this release is the
CI suite (8 behaviours, including opening a current `.tldr`, the theme,
the edit round trip, view mode and embeds) plus manual checks in a
scratch vault — not a soak on a real vault. Mobile is untested by
anything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant