testrail-report.t 1.3 KB

123456789101112131415161718192021222324
  1. use strict;
  2. use warnings;
  3. use Test::More 'tests' => 6;
  4. my @args = qw{bin/testrail-report --apiurl http://testrail.local --user "test@fake.fake" --password "fake" --project "CRUSH ALL HUMANS" --run "SEND T-1000 INFILTRATION UNITS BACK IN TIME" --mock t/test_multiple_files.tap};
  5. my $out = `@args`;
  6. is($? >> 8, 0, "Exit code OK reported with multiple files");
  7. my $matches = () = $out =~ m/Reporting result of case/ig;
  8. is($matches,2,"Attempts to upload multiple times");
  9. @args = qw{bin/testrail-report --apiurl http://testrail.local --user "test@fake.fake" --password "fake" --project "CRUSH ALL HUMANS" --run "SEND T-1000 INFILTRATION UNITS BACK IN TIME" --case-ok --mock t/test_multiple_files.tap};
  10. $out = `@args`;
  11. is($? >> 8, 0, "Exit code OK reported with multiple files (case-ok mode)");
  12. $matches = () = $out =~ m/Reporting result of case/ig;
  13. is($matches,4,"Attempts to upload multiple times (case-ok mode)");
  14. @args = qw{bin/testrail-report --apiurl http://testrail.local --user "test@fake.fake" --password "fake" --project "TestProject" --run "TestingSuite" --case-ok --mock t/test_subtest.tap};
  15. $out = `@args`;
  16. is($? >> 8, 0, "Exit code OK reported with subtests (case-ok mode)");
  17. $matches = () = $out =~ m/Reporting result of case/ig;
  18. is($matches,2,"Attempts to upload do not do subtests (case-ok mode)");