Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Playwright + bootstrap verification + page-editor v1.1 tests (closes openbuilt#79, partially closes #9 #10)#81

Merged
rubenvdlinde merged 3 commits into
developmentfrom
fix/openbuilt-79-playwright-and-bootstrap-verification
May 17, 2026
Merged

Playwright + bootstrap verification + page-editor v1.1 tests (closes openbuilt#79, partially closes #9 #10)#81
rubenvdlinde merged 3 commits into
developmentfrom
fix/openbuilt-79-playwright-and-bootstrap-verification

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

Multi-issue cleanup landing on development:

openbuilt#79 — Playwright e2e debt

  • Clean URL paths everywhere: `/index.php/apps/openbuilt/...` was being rewritten by NC32 to `/apps/openbuilt/` (dropping the trailing path), so every Vue Router `waitForX` timed out. Switched all `page.goto` calls to the clean form; API URLs (`/index.php/apps/openbuilt/api/...`) are unchanged.
  • `tests/e2e/global-setup.ts` writes a shared storageState that every spec inherits via `use.storageState` — kills the per-spec form-login dance that was racing NC's brute-force throttle when workers ran in parallel.
  • Removed the now-redundant `loginAsAdmin` `beforeEach` hooks from schema-designer, template-gallery, page-designer.
  • Removed the global `OCS-APIRequest: true` header from the browser context (was making NC treat browser page loads as API calls, breaking the login-form redirect).
  • Auto-provisioned the `rbac-outsider` user for rbac-403 specs.

Local Playwright (1-worker against the dev container): 24 failed → 15 failed / 8 passed / 23 skipped. Remaining failures are content-level assertions (e.g. `hello-world` seed expectations, page-designer detail) — they need feature-level investigation per spec, not test-infra fixes.

openbuilt#10 — Bootstrap verification

  • Task 4.3: `scripts/check-manifest.js` + `npm run check:manifest` validates the shell manifest and the wizard seed against the canonical `@conduction/nextcloud-vue/src/schemas/app-manifest.schema.json` (ADR-024). Wizard `{registerSlug}` placeholder is substituted before validation so the structural shape is what's checked.
  • Task 4.3 Vitest: `tests/scripts/check-manifest.spec.js` (4 cases) covers happy path, hand-rolled validity, missing-required failure, placeholder substitution.
  • Task 5.2: `tests/Unit/ApplicationVersionLifecycleSchemaTest.php` (5 cases) asserts the declarative `x-openregister-lifecycle` state machine in `lib/Settings/openbuilt_register.json` is well-formed — initial state, the three named states, the three transitions with correct from→to pairs, the publish transition's `upsert_relation` for BuiltAppRoute upkeep, and the disallowed-transition guard.

Task 4.4 (visual smoke on fresh `docker compose up`) and the container-bound end-to-end transition test for 5.2 remain — they need a real fresh container and are tracked separately.

openbuilt#9 — page-editor v1.1

  • Task 7.1: Vitest specs for the 3 previously-untested sub-editors (StubPageEditor, DashboardPageEditor, DetailPageEditor) — 22 new cases. Brings sub-editor test coverage to 10/10.
  • Task 7.2: `tests/composables/manifestRoundTrip.spec.js` (8 cases) — parse → stringify → parse deep-equal + still-validates-against-schema + idempotent on second round-trip for shell manifest + wizard seed + synthetic manifests with nested config blocks.
  • Task 8.1: New README "Visual designer (Design tab + Raw JSON fallback)" section.

Remaining #9 sub-tasks (deferred):

Test plan

  • `composer test:unit` (via `OPENBUILT_SKIP_NC_BOOTSTRAP=1 vendor/bin/phpunit`) — PHPUnit 212/212
  • `npm test` — Vitest 521/521
  • `npm run check:manifest` — both seed manifests PASS
  • `npx playwright test --project=chromium` — 8/46 chromium tests pass on dev container (was 1/46 before this branch)

Closes openbuilt#79.
Partially closes openbuilt#9 (tasks 7.1, 7.2, 8.1 done; OQ-3, OQ-2, 7.5, 7.6 deferred).
Partially closes openbuilt#10 (tasks 4.3, 5.2 done; 4.4 and the container-bound half of 5.2 deferred).

…ifecycle schema test

Drives openbuilt#79 (Playwright debt) and openbuilt#10 tasks 4.3 / 5.2
(bootstrap verification) in one branch.

## #79 — Playwright spec fixes

- `/index.php/apps/openbuilt/{path}` was being rewritten by NC32 to
  `/apps/openbuilt/` (dropping the trailing path). Vue Router never
  saw `/applications` etc., so every page-nav locator timed out.
  Use clean URLs throughout. API calls (`/index.php/apps/openbuilt/api/...`)
  are unaffected and stay as-is.
- Remove the per-spec `loginAsAdmin` / `beforeEach` form login from
  schema-designer, template-gallery, and page-designer. globalSetup
  (added in PR #78) already writes a shared storageState for every
  spec — the duplicate per-spec login was racing the brute-force
  throttle and timing out when the page wasn't on /login.
- version-rollback navigates to `/apps/openbuilt/applications` (not
  the dashboard) so the ApplicationCards are present.
- rbac-403 navigates to `/applications` to find the empty-state copy
  + an outsider user is auto-provisioned in dev (occ user:add).

Net Playwright on dev container: 24 failed → fewer (full re-run in
flight; spec listing surface dropped from 0% to ~30%+ passing).

## #10 — Bootstrap verification (4.3 + 5.2)

- `scripts/check-manifest.js` + `npm run check:manifest` validate the
  openbuilt shell manifest and the wizard seed against the canonical
  `@conduction/nextcloud-vue/src/schemas/app-manifest.schema.json`
  schema. The wizard seed's `{registerSlug}` placeholder is
  substituted with a syntactically-valid slug before validation so
  the structural shape is what's being asserted.
- `tests/scripts/check-manifest.spec.js` (4 Vitest cases) cover the
  happy path, hand-rolled validity, missing-required-property
  failure path, and the `{registerSlug}` placeholder substitution.
- `tests/Unit/ApplicationVersionLifecycleSchemaTest.php` (5 PHPUnit
  cases) asserts the declarative state machine in
  `lib/Settings/openbuilt_register.json` is well-formed: initial
  state is `draft`, the three states are draft/published/archived,
  the three transitions are publish/archive/reopen with the right
  from→to pairs, the publish transition declares the
  `upsert_relation` that maintains BuiltAppRoute, and disallowed
  transitions (draft→archived etc.) are absent.

Task 4.4 (visual smoke on fresh docker compose up) and the
container-bound end-to-end transition test for 5.2 remain — they
need a real fresh container which is out of scope for this PR.
…ilt#9 task 7.1)

The CustomPageEditor / FormPageEditor / etc. already had Vitest specs;
the three remaining v1.1 sub-editors did not. Filling the gap:

- tests/components/page-editor/StubPageEditor.spec.js (6 tests) —
  raw-JSON round-trip, parse-error path, external config re-seed,
  stability when the watcher re-emits an identical config.
- tests/components/page-editor/DashboardPageEditor.spec.js (5 tests) —
  validatedConfigKeys contract, update(key, value) round-trip,
  empty-array + null deletion semantics.
- tests/components/page-editor/DetailPageEditor.spec.js (11 tests) —
  full update + sidebar-shape transition matrix, routeParams parser,
  updateSidebarKey preservation, updateSidebarPropsTabs cleanup. The
  useRegisterPicker composable is mocked so the test never hits OR.

All three editors now have parity with their already-tested siblings.

Vitest 487 → 513. PHPUnit 212/212 still green.
…signer section (openbuilt#9 tasks 7.2 + 8.1)

## Task 7.2 — manifest round-trip Vitest

tests/composables/manifestRoundTrip.spec.js asserts that the canonical
manifests (OpenBuilt shell + wizard seed) survive a JSON.parse →
JSON.stringify → JSON.parse cycle without losing information AND still
validate against the ADR-024 schema after the round-trip.

Strict bytewise equality is too brittle (key ordering varies between
authors), so the test checks deep-equal + schema-still-valid +
idempotency-on-second-round-trip. Three additional cases cover
synthetic manifests with nested config blocks (sort, columns) to make
sure the editor never flattens or coerces.

Note: `lib/Resources/template/src/manifest.json` is a Mustache
scaffold (`{{appId}}` etc.) and is intentionally NOT in the validator
target list — it's rendered at export time, not consumed as a
runtime manifest.

## Task 8.1 — README Visual-designer section

New "Visual designer (Design tab + Raw JSON fallback)" section above
the chained-spec list explains:

- Design tab is the default; type-aware sub-editors per page type;
  carries inline-mark validator + undo/redo
- Raw JSON tab is the integrator fallback; edits round-trip
  losslessly through parse → stringify → parse (covered by the
  spec above)
- How to run `npm run check:manifest` locally to validate manifest
  shapes against the canonical schema

Vitest 513 → 521. PHPUnit still 212/212 green.
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openbuilt @ 1131edd

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

Quality workflow — 2026-05-17 07:04 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit that referenced this pull request May 19, 2026
fix(docs): hand-written meta descriptions (#81)
rubenvdlinde added a commit that referenced this pull request May 19, 2026
sync: development → documentation (meta descriptions #81)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant