|
@@ -4,57 +4,57 @@ use warnings;
|
|
|
use Test::More 'tests' => 18;
|
|
use Test::More 'tests' => 18;
|
|
|
|
|
|
|
|
#check plan mode
|
|
#check plan mode
|
|
|
-my @args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --config testConfig --mock --no-recurse});
|
|
|
|
|
|
|
+my @args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --config testConfig --mock --no-recurse});
|
|
|
my $out = `@args`;
|
|
my $out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK running plan mode, no recurse");
|
|
is($? >> 8, 0, "Exit code OK running plan mode, no recurse");
|
|
|
chomp $out;
|
|
chomp $out;
|
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in plan mode, no recurse");
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in plan mode, no recurse");
|
|
|
|
|
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --config testConfig -m t --mock});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' --config testConfig -m t --mock});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK running plan mode, recurse");
|
|
is($? >> 8, 0, "Exit code OK running plan mode, recurse");
|
|
|
chomp $out;
|
|
chomp $out;
|
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in plan mode, recurse");
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in plan mode, recurse");
|
|
|
|
|
|
|
|
#check non plan mode
|
|
#check non plan mode
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -r 'TestingSuite' -m t --mock --no-recurse});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -r 'TestingSuite' -m t --mock --no-recurse});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK running no plan mode, no recurse");
|
|
is($? >> 8, 0, "Exit code OK running no plan mode, no recurse");
|
|
|
chomp $out;
|
|
chomp $out;
|
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in no plan mode, no recurse");
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in no plan mode, no recurse");
|
|
|
|
|
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -r 'TestingSuite' -m t --mock});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -r 'TestingSuite' -m t --mock});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK running no plan mode, recurse");
|
|
is($? >> 8, 0, "Exit code OK running no plan mode, recurse");
|
|
|
chomp $out;
|
|
chomp $out;
|
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in no plan mode, recurse");
|
|
like($out,qr/skipall\.test$/,"Gets test correctly in no plan mode, recurse");
|
|
|
|
|
|
|
|
#Negative case, filtering by config
|
|
#Negative case, filtering by config
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --mock --config testPlatform1});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --mock --config testPlatform1});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
isnt($? >> 8, 0, "Exit code not OK when passing invalid configs for plan");
|
|
isnt($? >> 8, 0, "Exit code not OK when passing invalid configs for plan");
|
|
|
chomp $out;
|
|
chomp $out;
|
|
|
like($out,qr/no such run/i,"Gets test correctly in plan mode, recurse");
|
|
like($out,qr/no such run/i,"Gets test correctly in plan mode, recurse");
|
|
|
|
|
|
|
|
#check assignedto filters
|
|
#check assignedto filters
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --assignedto teodesian});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --assignedto teodesian});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK when filtering by assignment");
|
|
is($? >> 8, 0, "Exit code OK when filtering by assignment");
|
|
|
like($out,qr/skipall\.test$/,"Gets test correctly when filtering by assignment");
|
|
like($out,qr/skipall\.test$/,"Gets test correctly when filtering by assignment");
|
|
|
|
|
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --assignedto billy});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --assignedto billy});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK when filtering by assignement");
|
|
is($? >> 8, 0, "Exit code OK when filtering by assignement");
|
|
|
chomp $out;
|
|
chomp $out;
|
|
|
is($out,'',"Gets no tests correctly when filtering by wrong assignment");
|
|
is($out,'',"Gets no tests correctly when filtering by wrong assignment");
|
|
|
|
|
|
|
|
#check status filters
|
|
#check status filters
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --mock --config 'testConfig' --status 'passed'});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' -m t --mock --config 'testConfig' --status 'passed'});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK when filtering by status");
|
|
is($? >> 8, 0, "Exit code OK when filtering by status");
|
|
|
like($out,qr/skipall\.test$/,"Gets test correctly when filtering by status");
|
|
like($out,qr/skipall\.test$/,"Gets test correctly when filtering by status");
|
|
|
|
|
|
|
|
-@args = ($^X,qw{bin/testrail-tests -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --status 'failed'});
|
|
|
|
|
|
|
+@args = ($^X,qw{bin/testrail-tests --apiurl http://testrail.local --user "test@fake.fake" --password "fake" -j TestProject -p 'GosPlan' -r 'Executing the great plan' --mock --config 'testConfig' --status 'failed'});
|
|
|
$out = `@args`;
|
|
$out = `@args`;
|
|
|
is($? >> 8, 0, "Exit code OK when filtering by status");
|
|
is($? >> 8, 0, "Exit code OK when filtering by status");
|
|
|
chomp $out;
|
|
chomp $out;
|