TestRail-API-mockOnly.t 1003 B

12345678910111213141516171819202122232425
  1. use strict;
  2. use warnings;
  3. #Test things we can only mock, because the API doesn't support them.
  4. use Test::More 'tests' => 5;
  5. use TestRail::API;
  6. use Test::LWP::UserAgent::TestRailMock;
  7. use Scalar::Util qw{reftype};
  8. my $browser = $Test::LWP::UserAgent::TestRailMock::mockObject;
  9. my $tr = TestRail::API->new('http://hokum.bogus','fake','fake',1);
  10. $tr->{'browser'} = $browser;
  11. $tr->{'debug'} = 0;
  12. my $project = $tr->getProjectByName('TestProject');
  13. my $plan = $tr->getPlanByName($project->{'id'},'HooHaaPlan');
  14. my $runs = $tr->getChildRuns($plan);
  15. is(reftype($runs),'ARRAY',"getChildRuns returns array");
  16. is(scalar(@$runs),4,"getChildRuns with multi-configs in the same group returns correct # of runs");
  17. my $summary = $tr->getPlanSummary($plan->{'id'});
  18. is($summary->{'plan'},1094,"Plan ID makes it through in summary method");
  19. is($summary->{'totals'}->{'untested'},4,"Gets total number of tests correctly");
  20. is($summary->{'percentages'}->{'untested'},'100.00%',"Gets total percentages correctly");