depot/third_party/nixpkgs/nixos/tests/firefox.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

39 lines
1.1 KiB
Nix

import ./make-test-python.nix ({ pkgs, esr ? false, ... }: {
name = "firefox";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ eelco shlevy ];
};
machine =
{ pkgs, ... }:
{ imports = [ ./common/x11.nix ];
environment.systemPackages =
(if esr then [ pkgs.firefox-esr ] else [ pkgs.firefox ])
++ [ pkgs.xdotool ];
};
testScript = ''
machine.wait_for_x()
with subtest("wait until Firefox has finished loading the Valgrind docs page"):
machine.execute(
"xterm -e 'firefox file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html' &"
)
machine.wait_for_window("Valgrind")
machine.sleep(40)
with subtest("Close default browser prompt"):
machine.execute("xdotool key space")
with subtest("Hide default browser window"):
machine.sleep(2)
machine.execute("xdotool key F12")
with subtest("wait until Firefox draws the developer tool panel"):
machine.sleep(10)
machine.succeed("xwininfo -root -tree | grep Valgrind")
machine.screenshot("screen")
'';
})