Ver Fonte

Skip maximize verification on linux

I record my linux mocks just on a vagrant machine, so firefox is running
headless. Apparently headless browsers don't care too much for
maximization, so we'll skip the tests on linux.
vagrant há 11 anos atrás
pai
commit
f1a0290f2f
1 ficheiros alterados com 9 adições e 3 exclusões
  1. 9 3
      t/01-driver.t

+ 9 - 3
t/01-driver.t

@@ -176,9 +176,15 @@ WINDOW: {
     is ($ret->{'width'}, 480, 'Got the right width');
     $ret = $driver->maximize_window();
     is ($ret, 1, "Got confirmation from maximize");
-    $ret = $driver->get_window_size();
-    ok ($ret->{'height'} > 640, 'Height has increased');
-    ok ($ret->{'width'} > 480, 'Width has increased');
+
+  SKIP: {
+        skip 'headless browsers don\'t get maximized', 2
+          unless $^O =~ /darwin|MSWin32/;
+        $ret = $driver->get_window_size();
+        ok ($ret->{'height'} > 640, 'Height has increased');
+        ok ($ret->{'width'} > 480, 'Width has increased');
+    }
+
     $ret = $driver->get_page_source();
     ok($ret =~ m/^<html/i, 'Received page source');
     eval {$driver->set_implicit_wait_timeout(20001);};