mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Chromium never treats plaintext .onion origins as a secure context, so keycloak-js (PKCE via crypto.subtle) could not run. A custom Playwright browser fixture launches Firefox with the Tor-Browser prefs (dom.securecontext.allowlist_onions, origin/mixed-content handling) for onion targets and keeps Chromium for clearnet; all dashboard specs share it via the register pattern. keycloak-js is now vendored from the deployment's own CDN as an ES module (jsdelivr is unreachable over Tor) with CORS opened on the CDN proxy. Personas and the oidc-login spec wait for adapter readiness and navbar settle before driving login/logout, which the async code->token exchange needs over Tor latency. Verified: full deploy matrix green (onion 14/14 twice, clearnet pass). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
948 B
JavaScript
23 lines
948 B
JavaScript
const { test, expect } = require("./fixtures/onion-test");
|
|
const { gotoOnion } = require("./personas");
|
|
|
|
exports.register = function (shared) {
|
|
test("dashboard integrates matomo tracking assets", async ({ page }) => {
|
|
shared.skipUnlessServiceEnabled("matomo");
|
|
|
|
const diagnostics = shared.attachDiagnostics(page);
|
|
const documentResponse = await gotoOnion(page,"/");
|
|
|
|
expect(documentResponse, "Expected the dashboard document response to exist").toBeTruthy();
|
|
expect(documentResponse.status(), "Expected the dashboard document response to be successful").toBeLessThan(400);
|
|
|
|
const documentHtml = await documentResponse.text();
|
|
|
|
await shared.waitForDashboardReady(page);
|
|
await shared.waitForResourceResponse(diagnostics.responses, `${shared.env.matomoBaseUrl}/matomo.js`, "Matomo tracking script");
|
|
|
|
expect(documentHtml).toContain("matomo.js");
|
|
expect(documentHtml).toContain("matomo.php?idsite=");
|
|
});
|
|
};
|