add playwright test for hledger

This commit is contained in:
ibizaman 2025-02-11 00:24:45 +01:00 committed by Pierre Penninckx
parent 5a6be171b3
commit 51cc563fe8
2 changed files with 36 additions and 13 deletions

View file

@ -2,7 +2,7 @@
let
testLib = pkgs.callPackage ../common.nix {};
commonTestScript = lib.makeOverridable testLib.accessScript {
commonTestScript = testLib.mkScripts {
hasSSL = { node, ... }: !(isNull node.config.shb.grocy.ssl);
waitForServices = { ... }: [
"phpfpm-grocy.service"
@ -81,7 +81,7 @@ in
nodes.client = {};
testScript = commonTestScript;
testScript = commonTestScript.access;
};
https = pkgs.testers.runNixOSTest {
@ -97,6 +97,6 @@ in
nodes.client = {};
testScript = commonTestScript;
testScript = commonTestScript.access;
};
}

View file

@ -13,6 +13,11 @@ let
};
basic = { config, ... }: {
imports = [
testLib.baseModule
../../modules/services/hledger.nix
];
test = {
subdomain = "h";
};
@ -23,6 +28,26 @@ let
};
};
clientLogin = { config, ... }: {
imports = [
testLib.baseModule
testLib.clientLoginModule
];
test = {
subdomain = "h";
};
test.login = {
startUrl = "http://${config.test.fqdn}";
testLoginWith = [
{ nextPageExpect = [
"expect(page).to_have_title('journal - hledger-web')"
]; }
];
};
};
https = { config, ... }: {
shb.hledger = {
ssl = config.shb.certs.certs.selfsigned.n;
@ -39,10 +64,14 @@ in
basic = pkgs.testers.runNixOSTest {
name = "hledger_basic";
nodes.client = {
imports = [
clientLogin
];
};
nodes.server = {
imports = [
testLib.baseModule
../../modules/services/hledger.nix
basic
];
};
@ -57,8 +86,6 @@ in
nodes.server = { config, ... }: {
imports = [
testLib.baseModule
../../modules/services/hledger.nix
basic
(testLib.backup config.shb.hledger.backup)
];
@ -74,10 +101,8 @@ in
nodes.server = {
imports = [
testLib.baseModule
../../modules/services/hledger.nix
testLib.certs
basic
testLib.certs
https
];
};
@ -92,10 +117,8 @@ in
nodes.server = { config, pkgs, ... }: {
imports = [
testLib.baseModule
../../modules/services/hledger.nix
testLib.certs
basic
testLib.certs
https
testLib.ldap
(testLib.sso config.shb.certs.certs.selfsigned.n)