Skip to content

test(e2e): run the library against a real Nextcloud - #56

Merged
skjnldsv merged 1 commit into
mainfrom
test/real-server-e2e
Sep 21, 2026
Merged

skjnldsv merged 1 commit into
mainfrom
test/real-server-e2e

Conversation

@skjnldsv

Copy link
Copy Markdown
Contributor

The playground answers for itself, which is what makes it finish in twenty seconds and also what it cannot do. There is no server behind it, so nothing that depends on one can be tested there, and that includes every format that needs a preview rendered.

This adds a second suite next to it rather than instead of it. A minimal app loads the built package into a container the way a host app would, and the tests upload a real file over WebDAV, sign in through the login form and open it from the Files list.

It loads dist/ rather than the source on purpose. What gets published is what should work on a server, so that is what the harness runs.

Separate config, separate script, because it costs a container and the fast suite is the one to work in:

npm run test:e2e         # playground, no docker, ~20s
npm run test:e2e:server  # real Nextcloud

What it found

The three formats I wrote it for do not pass. They skip, with the reason.

The library gates every preview-backed format on core.previews.enabled_providers, and that capability does not exist on server master. It is added by CoreCapabilities.php in nextcloud/server#63954, which is still open. So on any current server, image/tiff, image/heic, image/jp2 and the rest can never be offered however well the server renders them: no capability, no gating list, no handler.

That is worth knowing on its own, and it is the sort of thing only a real server was ever going to tell us. It also means those three start passing the day #63954 lands, with no change here.

What does pass is the whole path they will use, over a jpeg: real upload, real session, the library loaded from its built package by an app, a server-rendered preview, and a decoded picture on screen.

Notes

The suite clicks the file in the list rather than using ?openfile=true. The harness app's script is added by an app, so it can register its file action after the Files app has already read that query; on a real server the viewer comes from core and is in time. Clicking is the path this suite is about anyway.

e2e-server/js/ is build output and gitignored.

I have not wired this into CI. It wants a docker-enabled job and a decision about whether it gates merges or runs nightly, which seemed worth asking rather than assuming.

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

The playground answers for itself, which is what makes it quick and also
what it cannot do: there is no server, so nothing that depends on one can
be covered there. That is most of what the viewer touches, and all of the
formats that need a preview rendered.

This adds a second suite alongside it, not instead of it. A minimal app
loads the built package into a container the way a host app would, and
the tests upload a real file, sign in and open it from the Files list.
The built package rather than the source, so what is tested is what gets
published.

It is a separate config and a separate npm script, because it costs a
container and the twenty-second suite is the one to work in.

The three formats it was written for do not pass yet, and skip with the
reason: the library gates every preview-backed format on the server
reporting which providers it has, and that capability does not exist
until nextcloud/server#63954. Finding that out is most of what this is
worth so far. What does pass is the whole path the formats will use, over
a jpeg: real upload, real session, real preview, picture on screen.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
@skjnldsv skjnldsv added status: review Waiting for reviews type: tests 🧪 Tests related issue or changes AI assisted labels Sep 21, 2026
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.62%. Comparing base (345aaa1) to head (d83dcde).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #56   +/-   ##
=======================================
  Coverage   88.62%   88.62%           
=======================================
  Files          39       39           
  Lines        2743     2743           
  Branches      561      561           
=======================================
  Hits         2431     2431           
  Misses        305      305           
  Partials        7        7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@skjnldsv
skjnldsv merged commit 9eaac8e into main Sep 21, 2026
18 checks passed
@skjnldsv
skjnldsv deleted the test/real-server-e2e branch September 21, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted status: review Waiting for reviews type: tests 🧪 Tests related issue or changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant