2020-02-10 20:01:47 +03:00
|
|
|
import ./make-test-python.nix ({ pkgs, esr ? false, ... }: {
|
2014-06-28 18:04:49 +04:00
|
|
|
name = "firefox";
|
2015-07-12 13:09:40 +03:00
|
|
|
meta = with pkgs.stdenv.lib.maintainers; {
|
2019-02-22 18:14:13 +03:00
|
|
|
maintainers = [ eelco shlevy ];
|
2015-07-12 13:09:40 +03:00
|
|
|
};
|
2010-01-05 17:12:51 +03:00
|
|
|
|
2011-09-14 22:20:50 +04:00
|
|
|
machine =
|
2018-07-20 23:56:59 +03:00
|
|
|
{ pkgs, ... }:
|
2010-01-05 17:12:51 +03:00
|
|
|
|
2013-09-04 15:05:09 +04:00
|
|
|
{ imports = [ ./common/x11.nix ];
|
2020-02-10 20:01:47 +03:00
|
|
|
environment.systemPackages =
|
|
|
|
(if esr then [ pkgs.firefox-esr ] else [ pkgs.firefox ])
|
|
|
|
++ [ pkgs.xdotool ];
|
2010-01-05 17:12:51 +03:00
|
|
|
};
|
|
|
|
|
2019-11-05 18:27:07 +03:00
|
|
|
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")
|
2010-01-05 17:12:51 +03:00
|
|
|
'';
|
2011-09-14 22:20:50 +04:00
|
|
|
|
2014-04-14 16:02:44 +04:00
|
|
|
})
|