Logically speaking, tests (api, ui etc) often have the following 3 "steps" or sections:
1 -Arrange - Create the test data/prerequisite conditions for testing. 2 - Act - Perform an action. 3 - Assert - Test if the action produces the expected result.
It is easy to show & demarcate these sections in code with heading comments or newlines between the sections. How can I show the same sections in ReadyAPI?
I have many tests which begin with 3-5 Run Test Case test-steps before the actual testing begins. These test-steps are actually setting up test data. Additionally, some tests have more than 1 test-step for validation instead of only 1. So, when such tests fail, it is hard to know which section of the test is responsible (test data, api call or assertions). Moreover, when I read such a test, it is often hard to figure out where the actual testing begins.
Keywords - Arrange Act Assert, Organizing test steps.
Thanks for the idea. I guess one could name the delay as Comment - Test data creation follows or such. But, its not an ideal solution as you mentioned.
PS - I wish ReadyAPI had blocks which would be like a rectangle around test steps. Blocks would have a drop down arrow which could store comments. Alternately, we could have a "test step" which only provides a comment box that can be logged if needed.
Hi, that sounds like functions in programming. Although ReadyAPI does not have functions like that, you can use tests as functions also to work around that limitation. Create a suite with tests which have the functionality you need and then disable the suite. The "function" tests in that suite can accept parameters and can be called by other tests as needed.