App-Prove-Plugin-Testrail.t 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env perl
  2. use strict;
  3. use warnings;
  4. use Test::More 'tests' => 4;
  5. use Test::Fatal;
  6. use App::Prove;
  7. use App::Prove::Plugin::TestRail;
  8. #I'm the secret squirrel
  9. $ENV{'TESTRAIL_MOCKED'} = 1;
  10. #Test the same sort of data as would come from the Test::Rail::Parser case
  11. my $prove = App::Prove->new();
  12. $prove->process_args("-PTestRail=apiurl=http://some.testlink.install/,user=someUser,password=somePassword,project=TestProject,run=TestingSuite,version=0.014,case_per_ok=1",'t/fake.test');
  13. is (exception {$prove->run()},undef,"Running TR parser case via plugin functions");
  14. #Check that plan, configs and version also make it through
  15. $prove = App::Prove->new();
  16. $prove->process_args("-PTestRail=apiurl=http://some.testlink.install/,user=someUser,password=somePassword,project=TestProject,run=Executing the great plan,version=0.014,case_per_ok=1,plan=GosPlan,configs=testConfig",'t/fake.test');
  17. is (exception {$prove->run()},undef,"Running TR parser case via plugin functions works with configs/plans");
  18. #Check that spawn options make it through
  19. $prove = App::Prove->new();
  20. $prove->process_args("-PTestRail=apiurl=http://some.testlink.install/,user=someUser,password=somePassword,project=TestProject,run=TestingSuite2,version=0.014,case_per_ok=1,spawn=9",'t/skipall.test');
  21. is (exception {$prove->run()},undef,"Running TR parser case via plugin functions works with configs/plans");
  22. $prove = App::Prove->new();
  23. $prove->process_args("-PTestRail=apiurl=http://some.testlink.install/,user=someUser,password=somePassword,project=TestProject,plan=bogoPlan,run=bogoRun,version=0.014,case_per_ok=1,spawn=9",'t/skipall.test');
  24. is (exception {$prove->run()},undef,"Running TR parser spawns both runs and plans");