test: add beforeHook option
This commit is contained in:
parent
04cd072cd7
commit
b02ec03f19
2 changed files with 11 additions and 0 deletions
|
|
@ -254,6 +254,10 @@ in
|
||||||
type = str;
|
type = str;
|
||||||
default = "http://${config.test.fqdn}";
|
default = "http://${config.test.fqdn}";
|
||||||
};
|
};
|
||||||
|
beforeHook = mkOption {
|
||||||
|
type = str;
|
||||||
|
default = "";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = {
|
config = {
|
||||||
networking.hosts = {
|
networking.hosts = {
|
||||||
|
|
@ -306,6 +310,9 @@ in
|
||||||
page = context.new_page()
|
page = context.new_page()
|
||||||
print(f"Going to {testCfg['startUrl']}")
|
print(f"Going to {testCfg['startUrl']}")
|
||||||
page.goto(testCfg['startUrl'])
|
page.goto(testCfg['startUrl'])
|
||||||
|
|
||||||
|
if testCfg.get("beforeHook") is not None:
|
||||||
|
exec(testCfg.get("beforeHook"))
|
||||||
|
|
||||||
if u['username'] is not None:
|
if u['username'] is not None:
|
||||||
print(f"Filling field username with {u['username']}")
|
print(f"Filling field username with {u['username']}")
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,10 @@ let
|
||||||
|
|
||||||
test.login = {
|
test.login = {
|
||||||
startUrl = "http://${config.test.fqdn}";
|
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";
|
usernameFieldLabelRegex = "Username";
|
||||||
passwordFieldSelector = "get_by_label(\"Password *\")";
|
passwordFieldSelector = "get_by_label(\"Password *\")";
|
||||||
loginButtonNameRegex = "[sS]ign [iI]n";
|
loginButtonNameRegex = "[sS]ign [iI]n";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue