Forum Discussion

rajs2020's avatar
rajs2020
Frequent Contributor
4 years ago

ReadyAPI - Organize test steps into blocks ?

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.

  • i that sounds like a feature request.  In fact, you could take that request one step further and suggest re-usable test blocks, which contain commonly used set of steps.

  • Hi,

    I tend to use a Delay Test Step to achieve this.  Create a Delay Test step, rename it to whatever and set the delay value to 0.

    Not a perfect solution, but workable.

     

    • rajs2020's avatar
      rajs2020
      Frequent Contributor

      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.

      • ChrisAdams's avatar
        ChrisAdams
        Champion Level 3

        i that sounds like a feature request.  In fact, you could take that request one step further and suggest re-usable test blocks, which contain commonly used set of steps.