Files
computer-playbook/roles/web-app-fediwall/files/playwright/playwright.spec.js
kevinveenbirkenbachandClaude Opus 4.7 f578e3c3a0 refactor(web-app-{fediwall,friendica}): split playwright spec into per-test modules; add friendica anonymous-profile-view + admin-follow-biber
Split each role's playwright.spec.js into `_shared.js` (env, login/post
helpers, lifecycle hook) plus one `test-*.js` per scenario, registered
from the orchestrator via `require().register(shared)` — matches the
pattern already used by web-app-pixelfed and web-app-taiga so each test
stays atomar and individually inspectable.

Adds two new friendica tests:
- test-anonymous-profile-view.js: pins the oauth2-proxy ACL whitelist
  for `/profile/` by asserting an anonymous visitor reaches biber's
  profile without being bounced to Keycloak. Materialises the friendica
  user row through the LDAP login path first since the profile would
  otherwise 404.
- test-admin-follow-biber.js: exercises the local-instance follow flow
  end-to-end (POST `/contact/follow` → 302 → `/contact/<id>` with
  biber's nick@host on the contact detail page).

Also extends `web-app-friendica/meta/services.yml` `services.oauth2.acl`
with the whitelist surfaces (federation/discovery, public profile +
community feed, theme assets, instance-info pages) the new
anonymous-profile-view test pins.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 01:09:02 +02:00

31 lines
1.3 KiB
JavaScript

// Fediwall Playwright spec — orchestration only. Shared env vars, login
// helpers (Mastodon OIDC + Friendica ldapauth + post-on-Friendica /compose
// flow), and the wall-content assertion helpers live in `_shared.js`; each
// scenario is registered from its own `test-*.js` companion module so each
// test stays atomar and individually inspectable.
const { test } = require("@playwright/test");
const shared = require("./_shared");
test.use({ ignoreHTTPSErrors: true });
test.beforeEach(shared.beforeEach);
// Baseline scenarios — MUST pass even when every shared service is disabled.
require("./test-fediwall-root-tls").register(shared);
require("./test-fediwall-default-slug").register(shared);
require("./test-fediwall-html-content").register(shared);
require("./test-fediwall-wall-config").register(shared);
require("./test-fediwall-spa-mount").register(shared);
// Cross-Fediverse scenario — requires Mastodon AND Friendica.
require("./test-walls-surface-posts").register(shared);
// Persona scenarios. Bodies live in the shared helper
// roles/test-e2e-playwright/files/personas.js so every role's persona
// flow stays consistent.
require("./test-guest-persona").register(shared);
require("./test-biber-persona").register(shared);
require("./test-administrator-persona").register(shared);