Flows
Reference for E2E tests (flows) in Cofactor. Node types, flow types, status, health, Regression, Run configuration and node deactivation in Flow Designer.
An E2E test is a flow: a path of nodes that follows one user journey through your application. The CLI and API call it a workflow. To write one, see End-to-end tests.
Find your flows
Select E2E tests in the sidebar, under Test studio. New E2E test creates a flow and opens it in Flow Designer.
Node types
Every node has a type. The nodeType value is what the CLI and API use. The label is what Flow Designer shows.
nodeType | Label | What it does |
|---|---|---|
login | Acting As | Signs in as a persona or credential. |
navigate | Navigate | Goes to a URL or path. |
action | Action | Clicks, types or interacts. Can carry inline assertions. |
assertion | Assertion | Checks something on the page. |
seed | Seed Data | Runs a seed flow first to provision data. |
call_flow | Run a flow | Runs another flow and uses its outputs. |
sandbox_action | Sandbox action | Runs a server-side script on the run's sandbox. |
api_sequence | API Sequence | Calls API endpoints with no browser. |
mcp | MCP | Drives an MCP server with no browser. |
condition | Condition | Branches on true or false, or fails the run on an exact check. |
wait | Wait | Pauses before continuing. |
notification | Notification | Sends an email or an SMS. |
audio | Audio input | Plays a clip into the browser microphone. |
audio-assertion | Audio assertion | Checks audio the page played. |
visual_checkpoint | Visual checkpoint | Compares a screen state with a baseline. |
end | End | Ends the flow as pass or fail. |
setup | Setup Flow | Runs another flow first. Deprecated. |
Fields for each node are on Core nodes, Specialty nodes and Assertions. Seed Data and Setup are on Setup, seed and teardown.
Deactivate a node
To remove a step from runs without deleting it, open the node's menu and choose Deactivate. The node is dimmed with a dashed border, records skipped in runs, and the run continues. The menu then offers Reactivate. Flow Designer does not offer Deactivate on Condition and End nodes.
cofactor workflow node deactivate <workflow id> <node id> --reason "Checkout redesign" cofactor workflow node activate <workflow id> <node id>
What the server checks
Cofactor validates a flow when you start a run and when you add it to Regression. Checks include at least one node, every node connected, and a first node that is Login, Navigate, Seed Data, API Sequence, MCP or Setup.
Flow types
standard is the default. seed provisions shared data and teardown cleans up after it. Neither can join Regression. setup is a deprecated prerequisite flow that runs before the flows that use it. See Setup, seed and teardown.
Status
A new flow is active. Any other status keeps the flow in its suites and excludes it from suite runs.
Statuses are Active, Paused (taken out of suite runs for now), Blocked (cannot pass yet, for example while a bug is open), Under construction and Deprecated. To change status, use the status control at the top of the Activity tab, or the CLI. --set takes active, paused, blocked, under_construction or deprecated.
cofactor workflow status <workflow id> --set paused --reason "Checkout redesign" --ticket <issue id or URL> cofactor workflow pause <workflow id> cofactor workflow unpause <workflow id>
Health
Cofactor recomputes health after each run.
| Health | Meaning |
|---|---|
| Unverified | No finished runs of the current version. |
| Never passed | It has run but has never passed. |
| Passing | Recent runs pass. |
| Reliable | Five or more clean passes in a row. |
| Flaky | The latest run passed, but one of the last ten runs failed or passed only after a retry. |
| Failing | The latest run failed on a flow that has passed before. |
| Degraded | Five or more failures in a row on a flow that is in a suite and has passed before. Suite runs skip it until you edit it or re-enable it. |
When you start a test run, select Re-enable degraded flows to clear Degraded and run those flows again.
Regression
Regression is your default suite. Adding a flow needs a saved flow of type standard or setup that passes validation. It does not need a run. In Flow Designer, the header button reads Add to regression, then In regression once the flow is a member. Select it again to remove the flow.
CLI: cofactor workflow add-to-regression <workflow id> and remove-from-regression.
Run a flow
Select Run Flow in the header. To choose browser, viewport, environment or inputs first, use Run with config in the run menu. Select Stop Run to stop a run.
cofactor workflow run <workflow id> --environment "Staging" --stream
--sandbox <sandbox id> runs on a sandbox you claimed. --viewport <preset> overrides the saved viewport for one run. The presets are desktop, desktop_large, laptop, tablet and mobile. See Runs for results.
Versions
A flow keeps a history of its definitions. Use cofactor workflow revisions list|get|restore <workflow id>. Run cofactor workflow --help for all commands.