Skip to content

Commit

Permalink
Merge pull request #23924 from 7c6f434c/improve-firefox-test
Browse files Browse the repository at this point in the history
nixos: tests: firefox: make more comprehensive

(cherry picked from commit f9fb38f)
The test will block the channel without the xterm change.
  • Loading branch information
7c6f434c authored and vcunat committed Mar 17, 2017
1 parent fa39bc1 commit df5a471
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions nixos/tests/firefox.nix
Expand Up @@ -8,15 +8,21 @@ import ./make-test.nix ({ pkgs, ... }: {
{ config, pkgs, ... }:

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

testScript =
''
$machine->waitForX;
$machine->execute("firefox file://${pkgs.valgrind.doc}/share/doc/valgrind/html/index.html &");
$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");
'';

Expand Down

0 comments on commit df5a471

Please sign in to comment.