فهرست منبع

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