Sfoglia il codice sorgente

Added extra check to make sure that mocking json is available on the given platform, otherwise skips the tests

Aditya Ivaturi 14 anni fa
parent
commit
3f0884a091
2 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 4 0
      t/01-driver.t
  2. 4 0
      t/02-webelement.t

+ 4 - 0
t/01-driver.t

@@ -27,6 +27,10 @@ BEGIN {
 
 my $record = (defined $ENV{'WD_MOCKING_RECORD'} && ($ENV{'WD_MOCKING_RECORD'}==1))?1:0;
 my $mock_file = '01-driver-mock-'.$^O.'.json';
+if (!$record && !(-e "t/mock-recordings/$mock_file"))
+{
+   plan skip_all => "Mocking of tests is not been enabled for this platform";
+}
 t::lib::MockSeleniumWebDriver::register($record,"t/mock-recordings/$mock_file");
 
 # Start our local http server

+ 4 - 0
t/02-webelement.t

@@ -27,6 +27,10 @@ BEGIN {
 
 my $record = (defined $ENV{'WD_MOCKING_RECORD'} && ($ENV{'WD_MOCKING_RECORD'}==1))?1:0;
 my $mock_file = '02-webelement-mock-'.$^O.'.json';
+if (!$record && !(-e "t/mock-recordings/$mock_file"))
+{
+   plan skip_all => "Mocking of tests is not been enabled for this platform";
+}
 t::lib::MockSeleniumWebDriver::register($record,"t/mock-recordings/$mock_file");
 
 # Start our local http server