python312Packages.homematicip: 1.1.2 -> 1.1.3 (#356780)
[NixPkgs.git] / nixos / tests / lomiri-docviewer-app.nix
blobc21a121f6c0222e4f4e31b63d09ed262e1deffaa
1 { lib, ... }:
2 let
3   exampleText = "Lorem ipsum dolor sit amet";
4 in
6   name = "lomiri-docviewer-app-standalone";
7   meta.maintainers = lib.teams.lomiri.members;
9   nodes.machine =
10     { config, pkgs, ... }:
11     {
12       imports = [ ./common/x11.nix ];
14       services.xserver.enable = true;
16       environment = {
17         etc."docviewer-sampletext.txt".text = exampleText;
18         systemPackages =
19           with pkgs;
20           [
21             libreoffice # txt -> odf to test LibreOfficeKit integration
22           ]
23           ++ (with pkgs.lomiri; [
24             suru-icon-theme
25             lomiri-docviewer-app
26           ]);
27         variables = {
28           UITK_ICON_THEME = "suru";
29         };
30       };
32       i18n.supportedLocales = [ "all" ];
34       fonts = {
35         packages = with pkgs; [
36           # Intended font & helps with OCR
37           ubuntu-classic
38         ];
39       };
40     };
42   enableOCR = true;
44   testScript = ''
45     machine.wait_for_x()
47     with subtest("lomiri docviewer launches"):
48         machine.succeed("lomiri-docviewer-app >&2 &")
49         machine.wait_for_text("No documents")
50         machine.screenshot("lomiri-docviewer_open")
52     machine.succeed("pkill -f lomiri-docviewer-app")
54     # Setup different document types
55     machine.succeed("soffice --convert-to odt --outdir /root/ /etc/docviewer-sampletext.txt")
56     machine.succeed("soffice --convert-to pdf --outdir /root/ /etc/docviewer-sampletext.txt")
58     with subtest("lomiri docviewer txt works"):
59         machine.succeed("lomiri-docviewer-app /etc/docviewer-sampletext.txt >&2 &")
60         machine.wait_for_text("${exampleText}")
61         machine.screenshot("lomiri-docviewer_txt")
63     machine.succeed("pkill -f lomiri-docviewer-app")
65     with subtest("lomiri docviewer odt works"):
66         machine.succeed("lomiri-docviewer-app /root/docviewer-sampletext.odt >&2 &")
67         machine.wait_for_text("${exampleText}")
68         machine.screenshot("lomiri-docviewer_odt")
70     machine.succeed("pkill -f lomiri-docviewer-app")
72     with subtest("lomiri docviewer pdf works"):
73         machine.succeed("lomiri-docviewer-app /root/docviewer-sampletext.pdf >&2 &")
74         machine.wait_for_text("${exampleText}")
75         machine.screenshot("lomiri-docviewer_pdf")
77     machine.succeed("pkill -f lomiri-docviewer-app")
79     with subtest("lomiri docviewer localisation works"):
80         machine.succeed("env LANG=de_DE.UTF-8 lomiri-docviewer-app >&2 &")
81         machine.wait_for_text("Keine Dokumente")
82         machine.screenshot("lomiri-docviewer_localised")
83   '';