Flow Settings
Endpoints for managing flow execution settings and timing configurations.
Flow Settings Management
GET /api/flow-settings
Gets current flow settings.
Response:
{
"timeBeforeSubflows": 0,
"timeAfterSubflows": 0,
"betweenFlowsDelaySeconds": 1,
"preSubflowDelay": 1,
"postSubflowDelay": 1,
"testCaseExecutionInterval": 0,
"setupSubflowReferences": [
{
"flowId": "setup-flow-123",
"preSubflowDelay": 2,
"postSubflowDelay": 1
}
],
"teardownSubflowReferences": [
{
"flowId": "cleanup-flow-456",
"preSubflowDelay": 1,
"postSubflowDelay": 0
}
]
}
PUT /api/flow-settings
Updates flow settings.
Request Body:
{
"timeBeforeSubflows": 5,
"timeAfterSubflows": 3,
"betweenFlowsDelaySeconds": 2,
"preSubflowDelay": 1,
"postSubflowDelay": 1,
"testCaseExecutionInterval": 30,
"setupSubflowReferences": [
{
"flowId": "setup-flow-123",
"preSubflowDelay": 2,
"postSubflowDelay": 1
}
],
"teardownSubflowReferences": [
{
"flowId": "cleanup-flow-456",
"preSubflowDelay": 1,
"postSubflowDelay": 0
}
]
}
Response:
{
"success": true,
"settings": {
"timeBeforeSubflows": 5,
"timeAfterSubflows": 3,
"betweenFlowsDelaySeconds": 2,
"preSubflowDelay": 1,
"postSubflowDelay": 1,
"testCaseExecutionInterval": 30
},
"updatedAt": "2024-01-01T00:00:00.000Z"
}
Timing Parameters
Global Settings
timeBeforeSubflows: Delay before executing setup subflows (0-300 seconds)timeAfterSubflows: Delay after executing teardown subflows (0-300 seconds)betweenFlowsDelaySeconds: Delay between consecutive flow executions (0-300 seconds)preSubflowDelay: Default delay before each subflow execution (0-60 seconds)postSubflowDelay: Default delay after each subflow execution (0-60 seconds)testCaseExecutionInterval: Interval between test case executions (0-300 seconds)
Per-Subflow Overrides
Each subflow reference can override global timing settings:
{
"flowId": "setup-flow-123",
"preSubflowDelay": 2, // Override global preSubflowDelay
"postSubflowDelay": 1, // Override global postSubflowDelay
"testCaseExecutionInterval": 45 // Override global interval
}
Execution Flow
The timing parameters control execution in this sequence:
-
Setup Phase:
- Wait
timeBeforeSubflows - For each setup subflow:
- Wait
preSubflowDelay(global or per-subflow) - Execute subflow
- Wait
postSubflowDelay(global or per-subflow)
- Wait
- Wait
-
Main Execution:
- Execute main flow steps
- If multiple flows: wait
betweenFlowsDelaySecondsbetween each
-
Test Case Intervals:
- If
testCaseExecutionInterval> 0: wait between test executions
- If
-
Teardown Phase:
- Wait
timeAfterSubflows - For each teardown subflow:
- Wait
preSubflowDelay(global or per-subflow) - Execute subflow
- Wait
postSubflowDelay(global or per-subflow)
- Wait
- Wait
Usage Examples
Basic Configuration
curl -X PUT http://localhost:3001/api/flow-settings \
-H "Content-Type: application/json" \
-d '{
"timeBeforeSubflows": 5,
"timeAfterSubflows": 3,
"betweenFlowsDelaySeconds": 2,
"preSubflowDelay": 1,
"postSubflowDelay": 1
}'
Setup and Teardown Flows
curl -X PUT http://localhost:3001/api/flow-settings \
-H "Content-Type: application/json" \
-d '{
"setupSubflowReferences": [
{
"flowId": "login-setup-flow",
"preSubflowDelay": 2,
"postSubflowDelay": 1
}
],
"teardownSubflowReferences": [
{
"flowId": "logout-cleanup-flow",
"preSubflowDelay": 1,
"postSubflowDelay": 0
}
]
}'
Test Case Execution with Intervals
curl -X PUT http://localhost:3001/api/flow-settings \
-H "Content-Type: application/json" \
-d '{
"testCaseExecutionInterval": 30,
"preSubflowDelay": 5,
"postSubflowDelay": 5
}'
Best Practices
Timing Guidelines
- Subflow Delays: Use 2-5 seconds for app initialization
- Between Flows: Use 1-2 seconds for state cleanup
- Test Intervals: Use 30+ seconds for load testing
- UI Transitions: Use 1-3 seconds for UI element waits
Performance Considerations
- Minimize delays in CI/CD environments
- Use longer delays for flaky UI elements
- Consider device performance when setting intervals
- Monitor execution times and adjust accordingly
Error Handling
- Timing parameters are validated (0-300 seconds for most)
- Invalid values fall back to defaults (usually 0)
- Execution continues even if timing fails
- Logs include timing information for debugging