depot/nixos/tests/freetube.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

43 lines
1.4 KiB
Nix

let
tests = {
wayland = { pkgs, ... }: {
imports = [ ./common/wayland-cage.nix ];
services.cage.program = "${pkgs.freetube}/bin/freetube";
virtualisation.memorySize = 2047;
environment.variables.NIXOS_OZONE_WL = "1";
environment.variables.DISPLAY = "do not use";
};
xorg = { pkgs, ... }: {
imports = [ ./common/user-account.nix ./common/x11.nix ];
virtualisation.memorySize = 2047;
services.xserver.enable = true;
services.xserver.displayManager.sessionCommands = ''
${pkgs.freetube}/bin/freetube
'';
test-support.displayManager.auto.user = "alice";
};
};
mkTest = name: machine:
import ./make-test-python.nix ({ pkgs, ... }: {
inherit name;
nodes = { "${name}" = machine; };
meta.maintainers = with pkgs.lib.maintainers; [ kirillrdy ];
# time-out on ofborg
meta.broken = pkgs.stdenv.hostPlatform.isAarch64;
enableOCR = true;
testScript = ''
start_all()
machine.wait_for_unit('graphical.target')
machine.wait_for_text('Your Subscription list is currently empty')
machine.send_key("ctrl-r")
machine.wait_for_text('Your Subscription list is currently empty')
machine.screenshot("main.png")
machine.send_key("ctrl-comma")
machine.wait_for_text('Data', timeout=60)
machine.screenshot("preferences.png")
'';
});
in
builtins.mapAttrs (k: v: mkTest k v) tests