Sfoglia il codice sorgente

Use b46d9f1 to consolidate test harness boilerplate

Daniel Gempesaw 11 anni fa
parent
commit
8b542d6bbe

+ 1 - 3
t/01-driver.t

@@ -18,9 +18,7 @@ my $harness = TestHarness->new(
     this_file => $FindBin::Script
 );
 my %selenium_args = %{ $harness->base_caps };
-unless ($harness->mocks_exist_for_platform) {
-    plan skip_all => "Mocking of tests is not been enabled for this platform";
-}
+$harness->skip_all_unless_mocks_exist;
 
 my $driver = Selenium::Remote::Driver->new(%selenium_args);
 my $website = 'http://localhost:63636';

+ 1 - 3
t/02-webelement.t

@@ -13,9 +13,7 @@ my $harness = TestHarness->new(
     this_file => $FindBin::Script
 );
 my %selenium_args = %{ $harness->base_caps };
-unless ($harness->mocks_exist_for_platform) {
-    plan skip_all => "Mocking of tests is not been enabled for this platform";
-}
+$harness->skip_all_unless_mocks_exist;
 
 my $driver = Selenium::Remote::Driver->new(%selenium_args);
 my $website = 'http://localhost:63636';

+ 1 - 3
t/10-switch-to-window.t

@@ -18,9 +18,7 @@ my %selenium_args = (
     javascript     => 1,
     %{ $harness->base_caps }
 );
-unless ($harness->mocks_exist_for_platform) {
-    plan skip_all => "Mocking of tests is not been enabled for this platform";
-}
+$harness->skip_all_unless_mocks_exist;
 
 plan tests => 9;
 

+ 2 - 3
t/Firefox-Profile.t

@@ -21,9 +21,8 @@ my $harness = TestHarness->new(
     this_file => $FindBin::Script
 );
 my %selenium_args = %{ $harness->base_caps };
-unless ($harness->mocks_exist_for_platform) {
-    plan skip_all => "Mocking of tests is not been enabled for this platform";
-}
+$harness->skip_all_unless_mocks_exist;
+
 my $fixture_dir = $FindBin::Bin . '/www/';
 
 CUSTOM_EXTENSION_LOADED: {

+ 1 - 3
t/Test-Selenium-Remote-Driver-google.t

@@ -13,9 +13,7 @@ my $harness = TestHarness->new(
     this_file => $FindBin::Script
 );
 my %selenium_args = %{ $harness->base_caps };
-unless ($harness->mocks_exist_for_platform) {
-    plan skip_all => "Mocking of tests is not been enabled for this platform";
-}
+$harness->skip_all_unless_mocks_exist;
 
 # Try to find
 my $t = Test::Selenium::Remote::Driver->new(

+ 1 - 3
t/lib/TestHarness.pm

@@ -12,9 +12,7 @@ use Test::More;
         this_file => $FindBin::Script
     );
     my %selenium_args = %{ $harness->base_caps };
-    unless ($harness->mocks_exist_for_platform) {
-        plan skip_all => "Mocking of tests is not been enabled for this platform";
-    }
+    $harness->skip_all_unless_mocks_exist;
 
 =attr this_file