From 5f50f23013a62af86b211bb89e1ce60421ba9fe8 Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 22 May 2015 11:23:09 +0200 Subject: [PATCH] nixos/tests/chromium: Detect popup using OCR. This will make the test a lot more reliable, because we no longer need to press ESC multiple times hoping that it will close the popup. Unfortunately in order to run this test I needed to locally revert the gyp update from a305e6855dd8723683c77635f45ae28411c8f36c. With the old gyp version however the test runs fine and it's able to properly detect the popup. Signed-off-by: aszlig --- nixos/tests/chromium.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/nixos/tests/chromium.nix b/nixos/tests/chromium.nix index 026433fc7ee9..2241bc9c3bca 100644 --- a/nixos/tests/chromium.nix +++ b/nixos/tests/chromium.nix @@ -9,6 +9,8 @@ import ./make-test.nix ( }: rec { name = "chromium"; + enableOCR = true; + machine.imports = [ ./common/x11.nix ]; machine.virtualisation.memorySize = 1024; @@ -106,15 +108,11 @@ import ./make-test.nix ( "ulimit -c unlimited; ". "$pkg/bin/chromium $args \"$url\" & disown" ); + $machine->waitForText(qr/Type to search or enter a URL to navigate/); $machine->waitUntilSucceeds("${xdo "check-startup" '' search --sync --onlyvisible --name "startup done" # close first start help popup key -delay 1000 Escape - # XXX: This is to make sure the popup is closed, but we better do - # screenshots to detect visual changes. - key -delay 2000 Escape - key -delay 3000 Escape - key -delay 4000 Escape windowfocus --sync windowactivate --sync ''}");