mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Three waits in the login path were raw literals while their neighbours already went through resolveTimeout, so they kept a flat 30s where a tor circuit needs the onion multiplier. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
36 lines
2.0 KiB
JavaScript
36 lines
2.0 KiB
JavaScript
const { test, expect } = require("@playwright/test");
|
|
const { resolveTimeout } = require("./timeouts");
|
|
const { gotoOnion } = require("./personas");
|
|
|
|
exports.register = function (shared) {
|
|
test.describe("moodle LDAP-only (variant 1)", () => {
|
|
test.skip(shared.env.ssoEnabled, "SSO shared service enabled — variant 1 not active");
|
|
test.skip(!shared.env.ldapEnabled, "LDAP shared service disabled");
|
|
|
|
test("biber: direct LDAP-bind login via Moodle form", async ({ page }) => {
|
|
await gotoOnion(page, `${shared.env.moodleBaseUrl}/login/index.php`);
|
|
const usernameInput = page.locator("input[name='username'], input#username").first();
|
|
await expect(usernameInput).toBeVisible({ timeout: resolveTimeout(30_000) });
|
|
await usernameInput.fill(shared.env.biberUsername);
|
|
const passwordInput = page.locator(".toggle-sensitive-wrapper input[name='password'], .toggle-sensitive-wrapper input#password").first();
|
|
await expect(passwordInput).toBeAttached({ timeout: resolveTimeout(30_000) });
|
|
await expect(async () => {
|
|
await passwordInput.fill(shared.env.biberPassword);
|
|
await expect(passwordInput).toHaveValue(shared.env.biberPassword);
|
|
}).toPass({ timeout: resolveTimeout(30_000) });
|
|
await page.locator("button[type='submit'], input[type='submit'], #loginbtn").first().click({ timeout: resolveTimeout(30_000) });
|
|
await page.waitForLoadState("load");
|
|
const userMenu = page.locator(".usermenu, [data-region='user-menu-toggle'], a[href*='profile.php']").first();
|
|
await expect(userMenu).toBeVisible({ timeout: resolveTimeout(30_000) });
|
|
});
|
|
|
|
test("login page does NOT expose an OIDC entry point", async ({ page }) => {
|
|
await gotoOnion(page, `${shared.env.moodleBaseUrl}/login/index.php`);
|
|
const oidcButton = page.locator("a, button").filter({
|
|
hasText: /openid|oidc|keycloak|single.?sign.?on|sso/i,
|
|
}).first();
|
|
await expect(oidcButton, "OIDC button must NOT be visible in variant 1").toHaveCount(0);
|
|
});
|
|
});
|
|
};
|