Sequence and Parallel Groups
In ReAPI, Groups allow you to organize and control how multiple steps execute within your test flow. There are two types of Groups: Sequence Group and Parallel Group. While they serve different purposes, they can be easily switched between one another, allowing for flexible test design.
Sequence Group
The Sequence Group executes its child nodes in a specified, sequential order. This ensures that each step completes before moving to the next, making it ideal when steps must occur in a set order.
Parallel Group
The Parallel Group executes its child nodes simultaneously, meaning all steps within the group are processed at the same time. This approach is useful when testing parallel processes or handling APIs that support concurrent requests.
Important Considerations for Parallel Groups
- Order of Execution: In a Parallel Group, execution order is not guaranteed and may be random. Be cautious when using parallel execution, especially if certain steps depend on others completing first.
- Parallel Limit: The maximum level of parallel execution allowed within a Parallel Group is 6 nodes at once. Exceeding this limit may cause test execution issues or unintended behavior.
Switching Between Sequence and Parallel
You can easily switch between Sequence and Parallel modes for any group. However, it’s essential to keep the differences in execution order in mind, particularly if steps are designed to execute in a specific sequence.
Use Cases
- Sequence Group: Use for steps that must occur in order, such as setting up data, executing a request, and then validating the response.
- Parallel Group: Ideal for performance testing, concurrent API calls, or cases where multiple actions can occur independently without dependency on execution order.
These Groups give you powerful options to structure your tests efficiently, providing both control and flexibility in managing sequential or simultaneous actions.