Преглед на файлове

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

Aditya Ivaturi преди 14 години
родител
ревизия
3f0884a091
променени са 2 файла, в които са добавени 8 реда и са изтрити 0 реда
  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