1
0
Эх сурвалжийг харах

changed live tests to skip if selenium server isn't running, also switched from 'no_plan' to done_testing

Gordon Child 14 жил өмнө
parent
commit
d28f38fe1a

+ 4 - 2
t/01-driver-live.t

@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
+use Test::More;
 use Net::Ping;
 use Data::Dumper;
 
@@ -9,7 +9,7 @@ BEGIN {
    my $p = Net::Ping->new("tcp", 2);
     $p->port_number(4444);
     unless ($p->ping('localhost')) {
-        BAIL_OUT ("Selenium server is not running on localhost:4444");
+        plan skip_all => "Selenium server is not running on localhost:4444";
         exit;
     }
     unless (use_ok( 'Selenium::Remote::Driver')) {
@@ -200,3 +200,5 @@ else
     `ps aux | grep http-server\.pl | grep perl | awk '{print \$2}' | xargs kill`;
 }
 
+done_testing;
+

+ 4 - 2
t/02-webelement-live.t

@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More 'no_plan';
+use Test::More;
 use Net::Ping;
 use Data::Dumper;
 
@@ -9,7 +9,7 @@ BEGIN {
     my $p = Net::Ping->new("tcp", 2);
     $p->port_number(4444);
     unless ($p->ping('localhost')) {
-        BAIL_OUT ("Selenium server is not running on localhost:4444");
+        plan skip_all => "Selenium server is not running on localhost:4444";
         exit;
     }
     unless (use_ok( 'Selenium::Remote::Driver')) {
@@ -125,3 +125,5 @@ else
 {
     `ps aux | grep http-server\.pl | grep perl | awk '{print \$2}' | xargs kill`;
 }
+
+done_testing;