1let
2 tests = {
3 wayland =
4 { pkgs, ... }:
5 {
6 imports = [ ./common/wayland-cage.nix ];
7 services.cage.program = "${pkgs.freetube}/bin/freetube";
8 virtualisation.memorySize = 2047;
9 environment.variables.NIXOS_OZONE_WL = "1";
10 environment.variables.DISPLAY = "do not use";
11 };
12 xorg =
13 { pkgs, ... }:
14 {
15 imports = [
16 ./common/user-account.nix
17 ./common/x11.nix
18 ];
19 virtualisation.memorySize = 2047;
20 services.xserver.enable = true;
21 services.xserver.displayManager.sessionCommands = ''
22 ${pkgs.freetube}/bin/freetube
23 '';
24 test-support.displayManager.auto.user = "alice";
25 };
26 };
27
28 mkTest =
29 name: machine:
30 import ./make-test-python.nix (
31 { pkgs, ... }:
32 {
33 inherit name;
34 nodes = {
35 "${name}" = machine;
36 };
37 meta.maintainers = with pkgs.lib.maintainers; [ kirillrdy ];
38 # time-out on ofborg
39 meta.broken = pkgs.stdenv.hostPlatform.isAarch64;
40 enableOCR = true;
41
42 testScript = ''
43 start_all()
44 machine.wait_for_unit('graphical.target')
45 machine.wait_for_text('Your Subscription list is currently empty')
46 machine.send_key("ctrl-r")
47 machine.wait_for_text('Your Subscription list is currently empty')
48 machine.screenshot("main.png")
49 machine.send_key("ctrl-comma")
50 machine.wait_for_text('Data', timeout=60)
51 machine.screenshot("preferences.png")
52 '';
53 }
54 );
55in
56builtins.mapAttrs (k: v: mkTest k v) tests