about summary refs log tree commit diff
path: root/nixos/tests/minecraft.nix
blob: 1c34f04b4df2230a971b822dedd1ea6a745b7645 (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
import ./make-test-python.nix ({ pkgs, lib, ... }: {
  name = "minecraft";
  meta = with lib.maintainers; { maintainers = [ nequissimus ]; };

  nodes.client = { nodes, ... }:
      let user = nodes.client.config.users.users.alice;
      in {
        imports = [ ./common/user-account.nix ./common/x11.nix ];

        environment.systemPackages = [ pkgs.minecraft ];

        nixpkgs.config.allowUnfree = true;

        test-support.displayManager.auto.user = user.name;
      };

  enableOCR = true;

  testScript = { nodes, ... }:
    let user = nodes.client.config.users.users.alice;
    in ''
      client.wait_for_x()
      client.execute("su - alice -c minecraft-launcher >&2 &")
      client.wait_for_text("Create a new Microsoft account")
      client.sleep(10)
      client.screenshot("launcher")
    '';
})