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

  nodes.machine = { config, pkgs, ... }: {
    imports = [
      ./common/x11.nix
    ];

    services.xserver.enable = true;
    environment.systemPackages = [
      pkgs.ladybird
    ];
  };

  enableOCR = true;

  testScript =
    ''
      machine.wait_for_x()
      machine.succeed("echo '<!DOCTYPE html><html><body><h1>Hello world</h1></body></html>' > page.html")
      machine.execute("Ladybird file://$(pwd)/page.html >&2 &")
      machine.wait_for_window("Ladybird")
      machine.sleep(5)
      machine.wait_for_text("Hello world")
      machine.screenshot("screen")
    '';
})