summaryrefslogtreecommitdiffstats
path: root/nixos/tests/ladybird.nix
blob: 9b7a9e51d61caa08c3b24137f10e0edcb1b1ee86 (plain)
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
{ pkgs, ... }:
{
  name = "ladybird";
  meta = with pkgs.lib.maintainers; {
    maintainers = [ fgaz ];
  };

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

      services.xserver.enable = true;
      programs.ladybird.enable = true;
    };

  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")
  '';
}