add playwright test for grocy
This commit is contained in:
parent
50cd401e5a
commit
bf29080a0a
6 changed files with 91 additions and 22 deletions
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
|
|
@ -118,7 +118,7 @@ jobs:
|
||||||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
nix build --print-build-logs --show-trace .#checks.x86_64-linux.${{ matrix.check }}
|
nix build --print-build-logs --show-trace --keep-outputs --keep-failed .#checks.x86_64-linux.${{ matrix.check }}
|
||||||
echo "resultPath=$(nix eval .#checks.x86_64-linux.vm_grocy_basic --raw)" >> $GITHUB_ENV
|
echo "resultPath=$(nix eval .#checks.x86_64-linux.vm_grocy_basic --raw)" >> $GITHUB_ENV
|
||||||
- name: Upload Build Result
|
- name: Upload Build Result
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|
|
||||||
19
flake.nix
19
flake.nix
|
|
@ -41,6 +41,25 @@
|
||||||
"dotnet-sdk-6.0.428"
|
"dotnet-sdk-6.0.428"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
overlays = [
|
||||||
|
(final: prev: {
|
||||||
|
exiftool = prev.exiftool.overrideAttrs (f: p: {
|
||||||
|
version = "12.70";
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://exiftool.org/Image-ExifTool-12.70.tar.gz";
|
||||||
|
hash = "sha256-TLJSJEXMPj870TkExq6uraX8Wl4kmNerrSlX3LQsr/4=";
|
||||||
|
};
|
||||||
|
});
|
||||||
|
})
|
||||||
|
(final: prev: {
|
||||||
|
grocy = prev.grocy.overrideAttrs (f: p: {
|
||||||
|
patches = p.patches ++ [
|
||||||
|
./patches/grocy.patch
|
||||||
|
];
|
||||||
|
});
|
||||||
|
})
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
allModules = [
|
allModules = [
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [{
|
config = lib.mkIf cfg.enable (lib.mkMerge [{
|
||||||
|
|
||||||
services.grocy = {
|
services.grocy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hostName = fqdn;
|
hostName = fqdn;
|
||||||
|
|
|
||||||
|
|
@ -1187,18 +1187,6 @@ in
|
||||||
path = [ pkgs.perl ];
|
path = [ pkgs.perl ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(final: prev: {
|
|
||||||
exiftool = prev.exiftool.overrideAttrs (f: p: {
|
|
||||||
version = "12.70";
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://exiftool.org/Image-ExifTool-12.70.tar.gz";
|
|
||||||
hash = "sha256-TLJSJEXMPj870TkExq6uraX8Wl4kmNerrSlX3LQsr/4=";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
# See all options at https://memories.gallery/system-config/
|
# See all options at https://memories.gallery/system-config/
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
||||||
31
patches/grocy.patch
Normal file
31
patches/grocy.patch
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
From b09d31578f4091c81ec2352bd334a007a093d6df Mon Sep 17 00:00:00 2001
|
||||||
|
From: ibizaman <ibizapeanut@gmail.com>
|
||||||
|
Date: Fri, 31 Jan 2025 20:52:40 +0100
|
||||||
|
Subject: [PATCH] Make labels on login form point to correct inputs
|
||||||
|
|
||||||
|
---
|
||||||
|
views/login.blade.php | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/views/login.blade.php b/views/login.blade.php
|
||||||
|
index 89538c3ea..ef708a657 100644
|
||||||
|
--- a/views/login.blade.php
|
||||||
|
+++ b/views/login.blade.php
|
||||||
|
@@ -15,7 +15,7 @@
|
||||||
|
novalidate>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
- <label for="name">{{ $__t('Username') }}</label>
|
||||||
|
+ <label for="username">{{ $__t('Username') }}</label>
|
||||||
|
<input type="text"
|
||||||
|
class="form-control"
|
||||||
|
required
|
||||||
|
@@ -24,7 +24,7 @@ class="form-control"
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
- <label for="name">{{ $__t('Password') }}</label>
|
||||||
|
+ <label for="password">{{ $__t('Password') }}</label>
|
||||||
|
<input type="password"
|
||||||
|
class="form-control"
|
||||||
|
required
|
||||||
|
|
@ -11,12 +11,14 @@ let
|
||||||
waitForUnixSocket = { node, ... }: [
|
waitForUnixSocket = { node, ... }: [
|
||||||
node.config.services.phpfpm.pools.grocy.socket
|
node.config.services.phpfpm.pools.grocy.socket
|
||||||
];
|
];
|
||||||
# TODO: Test login
|
|
||||||
# extraScript = { ... }: ''
|
|
||||||
# '';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
basic = { config, ... }: {
|
basic = { config, ... }: {
|
||||||
|
imports = [
|
||||||
|
testLib.baseModule
|
||||||
|
../../modules/services/grocy.nix
|
||||||
|
];
|
||||||
|
|
||||||
test = {
|
test = {
|
||||||
subdomain = "g";
|
subdomain = "g";
|
||||||
};
|
};
|
||||||
|
|
@ -27,6 +29,35 @@ let
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clientLogin = { config, ... }: {
|
||||||
|
imports = [
|
||||||
|
testLib.baseModule
|
||||||
|
testLib.clientLoginModule
|
||||||
|
];
|
||||||
|
virtualisation.memorySize = 4096;
|
||||||
|
|
||||||
|
test = {
|
||||||
|
subdomain = "g";
|
||||||
|
};
|
||||||
|
|
||||||
|
test.login = {
|
||||||
|
startUrl = "http://${config.test.fqdn}";
|
||||||
|
usernameFieldLabelRegex = "Username";
|
||||||
|
passwordFieldLabelRegex = "Password";
|
||||||
|
loginButtonNameRegex = "OK";
|
||||||
|
testLoginWith = [
|
||||||
|
{ username = "admin"; password = "admin oops"; nextPageExpect = [
|
||||||
|
"expect(page.get_by_text('Invalid credentials, please try again')).to_be_visible()"
|
||||||
|
]; }
|
||||||
|
{ username = "admin"; password = "admin"; nextPageExpect = [
|
||||||
|
"expect(page.get_by_text('Invalid credentials, please try again')).not_to_be_visible()"
|
||||||
|
"expect(page.get_by_role('button', name=re.compile('OK'))).not_to_be_visible()"
|
||||||
|
"expect(page).to_have_title(re.compile('Grocy'))"
|
||||||
|
]; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
https = { config, ...}: {
|
https = { config, ...}: {
|
||||||
shb.grocy = {
|
shb.grocy = {
|
||||||
ssl = config.shb.certs.certs.selfsigned.n;
|
ssl = config.shb.certs.certs.selfsigned.n;
|
||||||
|
|
@ -37,10 +68,13 @@ in
|
||||||
basic = pkgs.testers.runNixOSTest {
|
basic = pkgs.testers.runNixOSTest {
|
||||||
name = "grocy_basic";
|
name = "grocy_basic";
|
||||||
|
|
||||||
|
nodes.client = {
|
||||||
|
imports = [
|
||||||
|
clientLogin
|
||||||
|
];
|
||||||
|
};
|
||||||
nodes.server = {
|
nodes.server = {
|
||||||
imports = [
|
imports = [
|
||||||
testLib.baseModule
|
|
||||||
../../modules/services/grocy.nix
|
|
||||||
basic
|
basic
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
@ -55,10 +89,8 @@ in
|
||||||
|
|
||||||
nodes.server = {
|
nodes.server = {
|
||||||
imports = [
|
imports = [
|
||||||
testLib.baseModule
|
|
||||||
../../modules/services/grocy.nix
|
|
||||||
testLib.certs
|
|
||||||
basic
|
basic
|
||||||
|
testLib.certs
|
||||||
https
|
https
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue