diff --git a/test/common.nix b/test/common.nix index 8450fc6..bd384c6 100644 --- a/test/common.nix +++ b/test/common.nix @@ -254,6 +254,10 @@ in type = str; default = "http://${config.test.fqdn}"; }; + beforeHook = mkOption { + type = str; + default = ""; + }; }; config = { networking.hosts = { @@ -306,6 +310,9 @@ in page = context.new_page() print(f"Going to {testCfg['startUrl']}") page.goto(testCfg['startUrl']) + + if testCfg.get("beforeHook") is not None: + exec(testCfg.get("beforeHook")) if u['username'] is not None: print(f"Filling field username with {u['username']}") diff --git a/test/services/nextcloud.nix b/test/services/nextcloud.nix index 2c46aeb..5563fde 100644 --- a/test/services/nextcloud.nix +++ b/test/services/nextcloud.nix @@ -205,6 +205,10 @@ let test.login = { startUrl = "http://${config.test.fqdn}"; + # No need since Nextcloud is auto-redirecting to the SSO sign in page. + # beforeHook = '' + # page.get_by_role("link", name="Sign in with SHB-Authelia").click() + # ''; usernameFieldLabelRegex = "Username"; passwordFieldSelector = "get_by_label(\"Password *\")"; loginButtonNameRegex = "[sS]ign [iI]n";