Forum Discussion

JoostDG's avatar
JoostDG
Frequent Contributor
3 years ago

Tip : Use of tags in command line via bamboo build - Run all tests while sending -T tags parameters

In our CI build pipeline (bamboo) I setup two parameters tagTestSuite and tagTestCase. This way, all our automation testers can specify, if needed, which test cases need to be ran based on certain tags. This works fine if there are indeed such tags passed on.

But what if a project just wants to run all of its tests?  These -T parameters cannot be left empty in the command line as that fails the build... Deleting them from the bamboo variables will then lose the standardized approach for all testers to do a tag-based execution. 

 

Seeing the documentation here (https://support.smartbear.com/readyapi/docs/functional/running/automating/cli.html) I noticed you can provide logical operators. So I thought I came up with a nice solution:

I provide as default value for those parameters in bamboo a tag value that nobody would use and by setting the "!" operator in front of it I'd expected that ALL test suites/cases would run. So I've set parameters and resulted in a command line that has these : "-TTestSuite !itShouldRunAllTestSuites" "-TTestCase !itShouldRunAllTestCase". Since none of the testSuite/testCases has a tag "itShouldRunAllTestSuites" or "itShouldRunAllTestCases" I thought my project would be run in full....  But nope: error is shown:  [errorlog] java.lang.Exception: The tag "itShouldRunAllTestSuites" was not found.

Yes, I could go and add a tag to every single test suite and test case to work around this, but that could be tedious and not so future proof...

 

Solution: ReadyAPI seems to look first for a tag and then complain it wasn't found. So I tried this: I've added the tags "itShouldRunAllTestCases" and "itShouldRunAllTestSuites" to my project but did not tag any of my testsuites/testcases with this tag.

Executed above again and now ALL of my tests get's executed nicely!