summary refs log tree commit diff
path: root/nixos/tests/firefox.nix
blob: 58a80243ea9c729a445c64bcbb62bbdec0e77ff7 (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
import ./make-test.nix ({ pkgs, ... }: {
  name = "firefox";
  meta = with pkgs.stdenv.lib.maintainers; {
    maintainers = [ eelco chaoflow shlevy ];
  };

  machine =
    { pkgs, ... }:

    { imports = [ ./common/x11.nix ];
      environment.systemPackages = [ pkgs.firefox pkgs.xdotool ];
    };

  testScript =
    ''
      $machine->waitForX;
      $machine->execute("xterm -e 'firefox file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' &");
      $machine->waitForWindow(qr/Valgrind/);
      $machine->sleep(40); # wait until Firefox has finished loading the page
      $machine->execute("xdotool key space"); # do I want to make Firefox the
                             # default browser? I just want to close the dialog
      $machine->sleep(2); # wait until Firefox hides the default browser window
      $machine->execute("xdotool key F12");
      $machine->sleep(10); # wait until Firefox draws the developer tool panel
      $machine->succeed("xwininfo -root -tree | grep Valgrind");
      $machine->screenshot("screen");
    '';

})