1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "lomiri-system-settings-standalone";
3 meta.maintainers = lib.teams.lomiri.members;
5 nodes.machine = { config, pkgs, ... }: {
10 services.xserver.enable = true;
13 systemPackages = with pkgs.lomiri; [
15 lomiri-system-settings
18 UITK_ICON_THEME = "suru";
22 i18n.supportedLocales = [ "all" ];
24 fonts.packages = with pkgs; [
25 # Intended font & helps with OCR
29 services.upower.enable = true;
37 { name = "wifi"; type = "internal"; element = "networks"; }
38 { name = "bluetooth"; type = "internal"; element = "discoverable|None detected"; }
39 # only text we can really look for with VPN is on a button, OCR on CI struggles with it
40 { name = "vpn"; type = "internal"; element = "Add|Manual|Configuration"; skipOCR = true; }
41 { name = "appearance"; type = "internal"; element = "Background image|blur effects"; }
42 { name = "desktop"; type = "internal"; element = "workspaces|Icon size"; }
43 { name = "sound"; type = "internal"; element = "Silent Mode|Message sound"; }
44 { name = "language"; type = "internal"; element = "Display language|External keyboard"; }
45 { name = "notification"; type = "internal"; element = "Apps that notify"; }
46 { name = "gestures"; type = "internal"; element = "Edge drag"; }
47 { name = "mouse"; type = "internal"; element = "Cursor speed|Wheel scrolling speed"; }
48 { name = "timedate"; type = "internal"; element = "Time zone|Set the time and date"; }
51 { name = "security-privacy"; type = "external"; element = "Locking|unlocking|permissions"; elementLocalised = "Sperren|Entsperren|Berechtigungen"; }
57 with subtest("lomiri system settings launches"):
58 machine.execute("lomiri-system-settings >&2 &")
59 machine.wait_for_text("System Settings")
60 machine.screenshot("lss_open")
62 # Move focus to start of plugins list for following list of tests
63 machine.send_key("tab")
64 machine.send_key("tab")
65 machine.screenshot("lss_focus")
67 # tab through & open all sub-menus, to make sure none of them fail
68 '' + (lib.strings.concatMapStringsSep "\n" (page: ''
69 machine.send_key("tab")
70 machine.send_key("kp_enter")
72 + lib.optionalString (!(page.skipOCR or false)) ''
73 with subtest("lomiri system settings ${page.name} works"):
74 machine.wait_for_text(r"(${page.element})")
75 machine.screenshot("lss_page_${page.name}")
76 '') settingsPages) + ''
78 machine.execute("pkill -f lomiri-system-settings")
80 with subtest("lomiri system settings localisation works"):
81 machine.execute("env LANG=de_DE.UTF-8 lomiri-system-settings >&2 &")
82 machine.wait_for_text("Systemeinstellungen")
83 machine.screenshot("lss_localised_open")
85 # Move focus to start of plugins list for following list of tests
86 machine.send_key("tab")
87 machine.send_key("tab")
88 machine.screenshot("lss_focus_localised")
90 '' + (lib.strings.concatMapStringsSep "\n" (page: ''
91 machine.send_key("tab")
92 machine.send_key("kp_enter")
93 '' + lib.optionalString (page.type == "external") ''
94 with subtest("lomiri system settings ${page.name} localisation works"):
95 machine.wait_for_text(r"(${page.elementLocalised})")
96 machine.screenshot("lss_localised_page_${page.name}")
97 '') settingsPages) + ''