What is integration testing?
Integration testing verifies that multiple components work together correctly. For APIs, this means testing **complete user workflows** that span multiple endpoints, ensuring data flows correctly between them.
Example: E-commerce checkout flow
- 1. POST /auth/login → Get auth token
- 2. POST /cart/add → Add product (use token from step 1)
- 3. GET /cart → Verify product in cart
- 4. POST /checkout → Complete purchase
- 5. GET /orders/:id → Confirm order created
If any step fails or data doesn't pass correctly between steps, the integration test fails.
Why integration testing matters
Individual endpoints might work perfectly in isolation, but fail when chained together. Integration tests catch:
- State management bugs: Session expires between steps
- Data consistency issues: User created in step 1 doesn't exist in step 2
- Authorization failures: Token from login not accepted by other endpoints
- Race conditions: Async operations complete out of order
- Database transaction failures: Partial commits leave data in broken state
How to run integration tests in Flasqo
-
Navigate to Integration Testing
Go to Testing Types → Integration Testing → Launch -
Create a test scenario
Click "New Scenario" and name it (e.g., "User Signup to First Purchase") -
Add first endpoint
• Endpoint:POST /auth/signup
• Body:{"email": "test@example.com", "password": "SecurePass123"}
• Extract:user_idfrom response -
Chain second endpoint
Click "+ Add Step"
• Endpoint:POST /auth/login
• Body:{"email": "test@example.com", "password": "SecurePass123"}
• Extract:auth_tokenfrom response -
Continue chaining
Add more steps, using extracted values:
• Use{{auth_token}}in Authorization header
• Use{{user_id}}in request body
Flasqo auto-populates variables from previous steps -
Add assertions
For each step, validate:
• Status code = 200
• Response contains expected fields
• Values match expectations -
Run scenario
Click "Run Integration Test"
Flasqo executes steps sequentially and reports which step failed (if any)
Common integration test scenarios
User lifecycle
Signup → Email verification → Login → Update profile → Delete account
E-commerce flow
Browse products → Add to cart → Apply coupon → Checkout → Payment → Order confirmation
Content management
Create draft → Add media → Publish → Edit → Unpublish → Delete
Multi-user collaboration
User A creates document → User A shares with User B → User B edits → User A views changes
Best practices
1. Test realistic user journeys
Don't test random endpoint combinations. Focus on actual workflows users perform.
2. Clean up test data
Add final step to delete created resources. Prevents test data pollution.
3. Test both happy and sad paths
What happens if step 3 fails? Does the system rollback step 1 and 2?
4. Run in isolated test environment
Use test database, not production. Integration tests create/modify data.
Test complete user workflows
Chain endpoints, validate data flow, catch integration bugs before production.
Start Integration Testing Free