Flows have less mature testing than Apex. Multiple approaches.
1. Manual testing in Flow Builder.
- Debug Run — execute flow with controlled input.
- Step through each element.
- Inspect variables.
- Validate decision paths.
Best for: feature development, ad-hoc testing.
2. UAT.
- Business users execute scenarios.
- Manual verification of outcomes.
- Time-consuming for complex flows.
3. Apex tests for invocable / record-triggered flows.
- Trigger flow via Apex DML.
- Assert resulting changes.
`apex @isTest static void testRecordTriggeredFlow() { Account a = new Account(Name='Test', Status__c='Active');
Test.startTest(); insert a; Test.stopTest();
// Flow should have created a Task List<Task> tasks = [SELECT Id FROM Task WHERE WhatId=:a.Id]; System.assertEquals(1, tasks.size()); } `
4. UI automation (Provar / Selenium / Cypress).
- Test screen flows end-to-end.
- Click through flow screens.
- Validate final state.
5. Bulk testing.
- Insert 200 records that trigger flow.
- Confirm all process correctly.
- Watch for governor limits.
6. Regression testing.
- After flow changes, re-test affected scenarios.
Salesforce Flow Test (newer feature):
- Apex-style tests for autolaunched flows.
- Salesforce's evolving testing capability.
- Limited but growing.
Common patterns:
- Test each branch — every Decision element path.
- Test failure handling — Fault Connector paths.
- Test bulkification — flows can fail at 200 records.
- Test permissions — flow runs in different user contexts.
Common pitfalls:
- No flow tests — flow changes go untested.
- Manual-only testing — slow, error-prone.
- No bulk testing — flow fails at scale.
- Fault paths untested — error handling broken.
Senior QA insight: flow testing is challenging but increasingly mature. Salesforce investing in better flow testing tools.
The senior framing: don't skip flow testing because tooling is harder. Find approaches that work for your context.
