Skip to content

ci(e2e): turn on the shared E2E Tests (Playwright) job - #378

Open
rubenvdlinde wants to merge 1 commit into
developmentfrom
feat/enable-e2e-playwright
Open

ci(e2e): turn on the shared E2E Tests (Playwright) job#378
rubenvdlinde wants to merge 1 commit into
developmentfrom
feat/enable-e2e-playwright

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

Turns on the shared workflow's E2E Tests (Playwright) job for decidesk, and adds the four artefacts it needs to be genuinely green rather than green-by-absence.

Why it was not running

The job's gate is if: inputs.enable-playwright && !cancelled() && needs.security.result != 'failure'. enable-playwright was never set, so the job reported skipped — which on the PR page is visually indistinguishable from a pass. 28 spec files / 171 tests were sitting in tests/e2e/ and none of them had ever executed in CI.

Turning the flag on alone would not have worked, for two independent reasons:

  1. additional-apps was commented out entirely. OpenRegister is not an optional dependency for decidesk — appinfo/routes.php returns \OCA\OpenRegister\AppHost\Routes::standard(), the whole domain model lives in lib/Settings/decidesk_register.json plus 24 register.d/ fragments, and the SPA reads and writes every entity through /apps/openregister/api/objects/decidesk/<schema>. Without it the app cannot provision its register at all and every spec fails against an empty UI. Now pinned to ref: development (not main), so the CI instance matches the environment the app is developed against.

  2. The register still would not provision itself. occ app:enable decidesk runs its repair step with no user session, OpenRegister's RBAC denies the import, and the step catches \Throwable and downgrades it to a warning — occ app:enable exits 0 with no register.

Artefacts

File Purpose
tests/e2e/playwright.config.ts CI-only config, one project (chromium). The run step passes no --project, so whichever config it picks runs every project in it. The root config declares docs-capture (re-shoots documentation screenshots) and visual (its own README records that a CI Linux runner cannot byte-match a dev-container PNG baseline). playwright-test-path: tests/e2e makes the workflow's first config lookup hit this file. testIgnore is repeated at project level because a project-level list replaces the top-level one.
tests/e2e/base-url.ts One resolver replacing 22 copies of process.env.NEXTCLOUD_URL || 'http://localhost:8080'. Accepts PLAYWRIGHT_BASE_URL | NEXTCLOUD_URL | NC_BASE_URL | BASE_URLBASE_URL is the name the shared workflow actually exports — falls back to localhost:8080 only on CI, and throws otherwise. The old default was the shared dev container, and these specs seed real governance objects through the OR object API.
tests/e2e/ci-seed.sh Forced import over the admin HTTP API (POST /apps/decidesk/api/settings/load, the only path that also merges the register.d/ fragments), then verifies the register slug + 18 schema slugs read verbatim out of decidesk_register.json, probes four object collections for readability, warms the SPA, and gates on the bundle serving as JavaScript (a missing bundle returns HTTP 200 text/html, never 404).
tests/e2e/.gitignore Committed before the artefacts can appear. Leading slashes so the visual project's committed PNG baselines under tests/e2e/visual/*.spec.ts-snapshots/ are not matched.

What is deliberately NOT touched

The root playwright.config.ts. The separate Journeydoc Capture job greps it for name: 'docs-capture' and hard-fails without it. The visual and docs-capture projects are excluded by not declaring them in the new config, not by deleting them.

Controls run locally

  • CI config collects 171 tests in 28 files, with 0 visual/ or docs-screenshots entries.
  • With PLAYWRIGHT_BASE_URL/NEXTCLOUD_URL/NC_BASE_URL/BASE_URL/CI all cleared, the resolver raises rather than silently targeting the shared dev container.

Pre-existing red

Integration Tests (Newman) and Quality Report were already failing on development before this branch (run 30838121531, 29 jobs). They are not caused by this change.

The shared workflow's `E2E Tests (Playwright)` job was never enabled on
decidesk, and the state it sat in reads on the PR page exactly like a pass:
`if: inputs.enable-playwright && …` evaluates false, so the job reports
`skipped` rather than `failure`. 28 spec files / 171 tests were in the repo and
none of them had ever run in CI.

Two blockers, both fixed here:

1. `additional-apps` was COMMENTED OUT entirely, so no CI instance ever had
   OpenRegister. That is not an optional dependency for decidesk —
   `appinfo/routes.php` returns `\OCA\OpenRegister\AppHost\Routes::standard()`,
   the whole domain model lives in `lib/Settings/decidesk_register.json` plus
   the 24 `register.d/` fragments, and the SPA reads and writes every entity
   through `/apps/openregister/api/objects/decidesk/<schema>`. Now pinned to
   `development` (not `main`) so the CI instance matches the environment the
   app is actually developed against.

2. The register still would not provision itself. `occ app:enable decidesk`
   runs its repair step with NO user session, OpenRegister's RBAC denies the
   import outright, and the step catches \Throwable and downgrades it to a
   warning — so `occ app:enable` exits 0 with no register. `tests/e2e/ci-seed.sh`
   therefore does the import explicitly over the admin HTTP API
   (`POST /apps/decidesk/api/settings/load` → `loadConfiguration(force: true)`,
   the only path that also merges the `register.d/` fragments), then VERIFIES
   the register slug and 18 schema slugs read verbatim out of
   `decidesk_register.json`, probes four object collections for readability,
   and finally gates on the webpack bundle SERVING as JavaScript.

New artefacts:

- `tests/e2e/playwright.config.ts` — a CI-only config declaring exactly ONE
  project. The workflow's run step passes no `--project`, so whichever config
  it picks runs every project in it; the root config declares `docs-capture`
  (which would re-shoot every documentation screenshot on each PR) and
  `visual` (whose own README records that a CI Linux runner cannot byte-match a
  dev-container PNG baseline). `playwright-test-path: tests/e2e` makes the
  workflow's first config lookup hit this file instead. The root config is
  deliberately untouched — the separate `Journeydoc Capture` job greps it for
  `name: 'docs-capture'`.

- `tests/e2e/base-url.ts` — one resolver, replacing 22 copies of
  `process.env.NEXTCLOUD_URL || 'http://localhost:8080'`. It accepts
  `PLAYWRIGHT_BASE_URL | NEXTCLOUD_URL | NC_BASE_URL | BASE_URL` (`BASE_URL` is
  the name the shared workflow actually exports), falls back to
  `http://localhost:8080` only on CI, and THROWS otherwise. The old default was
  the shared dev container, and these specs seed real governance objects
  through the OpenRegister object API.

- `tests/e2e/.gitignore` — committed before the artefacts can appear. Anchored
  with a leading slash so the `visual` project's committed PNG baselines under
  `tests/e2e/visual/*.spec.ts-snapshots/` are not matched.

Controls run locally: the CI config collects 171 tests in 28 files with zero
`visual/` or `docs-screenshots` entries, and the resolver raises with the
env cleared.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/decidesk @ e14e700

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
build
composer ✅ 100/100
npm ✅ 549/549
PHPUnit
Newman
Playwright

Quality workflow — 2026-08-03 23:11 UTC

Download the full PDF report from the workflow artifacts.

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.

2 participants