summaryrefslogtreecommitdiffstats
path: root/nixos/tests/firefox.nix
diff options
context:
space:
mode:
authorJacek Galowicz <jacek@galowicz.de>2019-11-05 16:27:07 +0100
committerJacek Galowicz <jacek@galowicz.de>2019-11-05 18:07:05 +0100
commitd6b7a9909e7b0ca71145019ae49063f282d0d8ba (patch)
tree77bdd7ab4371db96bfc318962d5c501a4e62058d /nixos/tests/firefox.nix
parent45b339b736380fe007721a460b2d2ac9791d8f5c (diff)
nixos/firefox: Port integration test to python
Diffstat (limited to 'nixos/tests/firefox.nix')
-rw-r--r--nixos/tests/firefox.nix36
1 files changed, 22 insertions, 14 deletions
diff --git a/nixos/tests/firefox.nix b/nixos/tests/firefox.nix
index f5b946a08810..56ddabbae771 100644
--- a/nixos/tests/firefox.nix
+++ b/nixos/tests/firefox.nix
@@ -1,4 +1,4 @@
-import ./make-test.nix ({ pkgs, ... }: {
+import ./make-test-python.nix ({ pkgs, ... }: {
name = "firefox";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ eelco shlevy ];
@@ -11,19 +11,27 @@ import ./make-test.nix ({ pkgs, ... }: {
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");
+ 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")
'';
})