summary refs log tree commit diff
path: root/nixos/tests/breitbandmessung.nix
blob: 12b1a094839beea3b512969ea3c0d8afe2d29a30 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import ./make-test-python.nix ({ lib, ... }: {
  name = "breitbandmessung";
  meta.maintainers = with lib.maintainers; [ b4dm4n ];

  machine = { pkgs, ... }: {
    imports = [
      ./common/user-account.nix
      ./common/x11.nix
    ];

    # increase screen size to make the whole program visible
    virtualisation.resolution = { x = 1280; y = 1024; };

    test-support.displayManager.auto.user = "alice";

    environment.systemPackages = with pkgs; [ breitbandmessung ];
    environment.variables.XAUTHORITY = "/home/alice/.Xauthority";

    # breitbandmessung is unfree
    nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "breitbandmessung" ];
  };

  enableOCR = true;

  testScript = ''
    machine.wait_for_x()
    machine.execute("su - alice -c breitbandmessung >&2  &")
    machine.wait_for_window("Breitbandmessung")
    machine.wait_for_text("Breitbandmessung")
    machine.wait_for_text("Datenschutz")
    machine.screenshot("breitbandmessung")
  '';
})