about summary refs log tree commit diff
path: root/nixos/tests/teleports.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/teleports.nix')
-rw-r--r--nixos/tests/teleports.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixos/tests/teleports.nix b/nixos/tests/teleports.nix
new file mode 100644
index 0000000000000..a4293f954a455
--- /dev/null
+++ b/nixos/tests/teleports.nix
@@ -0,0 +1,48 @@
+{ pkgs, lib, ... }:
+{
+  name = "teleports-standalone";
+  meta.maintainers = lib.teams.lomiri.members;
+
+  nodes.machine =
+    { config, pkgs, ... }:
+    {
+      imports = [ ./common/x11.nix ];
+
+      services.xserver.enable = true;
+
+      environment = {
+        systemPackages = with pkgs.lomiri; [
+          suru-icon-theme
+          teleports
+        ];
+        variables = {
+          UITK_ICON_THEME = "suru";
+        };
+      };
+
+      i18n.supportedLocales = [ "all" ];
+
+      fonts.packages = with pkgs; [
+        # Intended font & helps with OCR
+        ubuntu-classic
+      ];
+    };
+
+  enableOCR = true;
+
+  testScript = ''
+    machine.wait_for_x()
+
+    with subtest("teleports launches"):
+        machine.execute("teleports >&2 &")
+        machine.wait_for_text(r"(TELEports|Phone Number)")
+        machine.screenshot("teleports_open")
+
+    machine.succeed("pkill -f teleports")
+
+    with subtest("teleports localisation works"):
+        machine.execute("env LANG=de_DE.UTF-8 teleports >&2 &")
+        machine.wait_for_text("Telefonnummer")
+        machine.screenshot("teleports_localised")
+  '';
+}