vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / nixos / tests / lomiri-calculator-app.nix
blob14d8073611f23a6e408c1c092ec5bd7b00218da0
1 { pkgs, lib, ... }:
3   name = "lomiri-calculator-app-standalone";
4   meta.maintainers = lib.teams.lomiri.members;
6   nodes.machine =
7     { config, pkgs, ... }:
8     {
9       imports = [ ./common/x11.nix ];
11       services.xserver.enable = true;
13       environment = {
14         systemPackages = with pkgs.lomiri; [
15           suru-icon-theme
16           lomiri-calculator-app
17         ];
18         variables = {
19           UITK_ICON_THEME = "suru";
20         };
21       };
23       i18n.supportedLocales = [ "all" ];
25       fonts.packages = with pkgs; [
26         # Intended font & helps with OCR
27         ubuntu-classic
28       ];
29     };
31   enableOCR = true;
33   testScript = ''
34     machine.wait_for_x()
36     with subtest("lomiri calculator launches"):
37         machine.execute("lomiri-calculator-app >&2 &")
38         machine.wait_for_text("Calculator")
39         machine.screenshot("lomiri-calculator")
41     with subtest("lomiri calculator works"):
42         machine.send_key("tab") # Fix focus
44         machine.send_chars("22*16\n")
45         machine.wait_for_text("352")
46         machine.screenshot("lomiri-calculator_caninfactdobasicmath")
48     machine.succeed("pkill -f lomiri-calculator-app")
50     with subtest("lomiri calculator localisation works"):
51         machine.execute("env LANG=de_DE.UTF-8 lomiri-calculator-app >&2 &")
52         machine.wait_for_text("Rechner")
53         machine.screenshot("lomiri-calculator_localised")
55     # History of previous run should have loaded
56     with subtest("lomiri calculator history works"):
57         machine.wait_for_text("352")
58   '';