How to loop Test Suites or Test Cases
I have a Project that is currently built as
Project
Test Suite
Test Case
Test Steps
I have many Test Steps at the top that run queries and get log in credentials and then the remaining Test Steps run 3 methods that take many different types of input that I need to loop through with the query results. At the bottom of the Test Step stack I have Data Source Loops.
What I would like is for it to be
Project
Test Suite
Test Case
Test Steps
Test Case
Test Steps
etc...
Or
Project
Test Suite
Test Case
Test Steps
Test Suite
Test Case
Test Steps
etc...
The reason I want the individual method Test Steps to be their own Test Case/ Test Suite is because the Project will be ran nightly in Jenkins and with the current model if one step fails the Pass/Fail percentage is 0% for the entire Project. This is not really what is happening since each Step is actually a separate Test Case.
Any help is appreciated
I think you are correct when you say "individual method Test Steps to be their own Test Case", I've always approached things assuming that a test case should be a self contained unit that can be run independently, testing one specific thing.
When faced with an issue like yours, I've always created a "Common Library" Test Suite, where I create all of my reusable "common" test cases, and then in my actual test cases, use the Run TestCase Test Step to call these common test cases. These "common" test cases can return properties as required.
This structure I am suggesting would look something like:
Project
|
|--Test Suite 1
| |--Test Case 1
| |--Test Case 2
|
|--Test Suite 2
| |--Test Case 1
| |--Test Case 2
|
|--Test Suite Common Library
|--Test Case To Do Set up Things
Where all of the test cases in Test Suite 1 and 2 would call the common library test case "Test Case To Do Set up Things".
Finally I alway disable my "Common Library" test suite so it is never "run" as a stand alone test suite, but you can still quite happily call its test cases.
As a side note your question made me think about the TestCase options? In particular the two options:
- Abort on Error
- Fail Test Case on Error
Have you investigated these to see if they help you?.