mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 12:17:13 +00:00
Add the global TIMEOUT_FACTOR and a shared timeouts.js helper: resolveTimeout(base) scales by TIMEOUT_FACTOR and, over a .onion target, an extra multiplier, so Tor's per-request latency no longer trips hard-coded timeouts. Migrate every raw timeout in the specs (timeout:/timeout=/setTimeout/waitForTimeout) to resolveTimeout, stage the helper in all three staging paths, and add test_no_raw_timeouts to forbid raw numeric timeouts. Clearnet behaviour is unchanged (factor 1: resolveTimeout(N) === N). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
37 lines
1.6 KiB
JavaScript
37 lines
1.6 KiB
JavaScript
const { test, expect } = require("@playwright/test");
|
|
const { resolveTimeout } = require("./timeouts");
|
|
|
|
// biber + administrator side-by-side: two isolated browser contexts log in
|
|
// independently, biber logs out first, admin session must persist. Exercises
|
|
// ldapauth's bridge for a non-admin LDAP user AND verifies session isolation
|
|
// between contexts. Skips when LDAP is disabled.
|
|
|
|
exports.register = function (shared) {
|
|
test("friendica: biber + administrator side by side in isolated contexts", async ({ browser }) => {
|
|
shared.skipUnlessServiceEnabled("ldap");
|
|
|
|
const login = shared.pickLoginPath();
|
|
const biberContext = await browser.newContext({ ignoreHTTPSErrors: true });
|
|
const adminContext = await browser.newContext({ ignoreHTTPSErrors: true });
|
|
try {
|
|
const biberPage = await biberContext.newPage();
|
|
await login(biberPage, shared.env.biberUsername, shared.env.biberPassword);
|
|
|
|
const adminPage = await adminContext.newPage();
|
|
await login(adminPage, shared.env.adminUsername, shared.env.adminPassword);
|
|
|
|
// biber logs out first — admin session must stay alive.
|
|
await shared.friendicaLogout(biberPage);
|
|
await adminPage.goto(`${shared.trimmedBaseUrl()}/network`, { waitUntil: "domcontentloaded" });
|
|
await expect(
|
|
adminPage.locator("#topbar-first, #navbar-apps-menu, a[href*='/logout']").first(),
|
|
).toBeVisible({ timeout: resolveTimeout(10_000) });
|
|
|
|
await shared.friendicaLogout(adminPage);
|
|
} finally {
|
|
await biberContext.close().catch(() => {});
|
|
await adminContext.close().catch(() => {});
|
|
}
|
|
});
|
|
};
|