> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ui-driver setup for UI flow test cases

> Turn on UI flow test cases on a self-hosted installation by giving ui-driver its database, service account, platform URLs and a network policy.

ui-driver renders UI flows in a headless Chromium browser. It runs [UI flow test cases](https://docs.flowx.ai/6.x/ai-platform/evaluations.md#ui-flow-test-cases) for Integration Designer and renders screens for the Developer Agentic Harness. It is part of the `devtime` group of the `flowx-ai` Helm chart, and the chart deploys it with test runs off.

## Before you start

> [!WARNING]
>
> **Test runs act for the maker through the ui-driver service account.** ui-driver accepts a test run only from a caller that sends a token with the `SA_FLOWX` role, such as Integration Designer. It plays the run as the `flowx-ui-driver-sa` service account, on behalf of the maker who started the test. Render requests also need a token, and ui-driver uses that token for its calls to the platform.
>
> Also apply the network policy in [Restrict who can reach ui-driver](#restrict-who-can-reach-ui-driver), so that only the services that call ui-driver can reach it.

You need:

* The `flowx-ai` Helm chart, with the `devtime` group turned on: `groups.devtime.enabled: true`
* MongoDB, reachable from the cluster
* The `flowx-ui-driver-sa` client in Keycloak. See [ui-driver service account](https://docs.flowx.ai/6.x/setup-guides/access-management/configuring-an-iam-solution.md#ui-driver-service-account)
* Recommended: a Kubernetes network plugin that enforces NetworkPolicy

***

## Turn on test runs

**1. Create the MongoDB user and database**

Create a MongoDB user named `ui-driver` with the `readWrite` role on a database named `ui-driver`. Store its password in a Kubernetes secret named `mongodb-ui-driver-ui-driver`, under the key `password`.

ui-driver keeps queued test runs in this database, in the `ui_driver_test_jobs` collection.

**2. Check the service account**

ui-driver signs in with the `flowx-ui-driver-sa` client, a confidential client with service accounts on and the `SA_FLOWX` realm role. Authorization System creates it when it has Keycloak admin access and the service-accounts realm exists. Otherwise, create it yourself. See [ui-driver service account](https://docs.flowx.ai/6.x/setup-guides/access-management/configuring-an-iam-solution.md#ui-driver-service-account).

Its secret is the `KEYCLOAK_UI_DRIVER_CLIENT_SECRET` key of the `keycloak-flowx-realm-clients` secret.

> [!NOTE]
>
> The chart reads `KEYCLOAK_UI_DRIVER_CLIENT_SECRET` in the `authorization-system` pod even when the `devtime` group is off, so add the key on upgrade either way. See [New secret key: ui-driver service account](https://docs.flowx.ai/release-notes/v6.x/v6.1.0-november-2026/deployment-guidelines-v6.1.md#new-secret-key-ui-driver-service-account).

**3. Select the service account and the database**

```yaml theme={"dark"}
services:
  ui-driver:
    component:
      idpClients: ["uiDriver"]
      mongo:
        uiDriver:
          serverRef: "flowx"
          credentials: "uiDriver"
          database: "ui-driver"
          alias: "ai_render"
```

Keep the `ai_render` alias: ui-driver reads its database connection under that name. The `flowx` server and the `uiDriver` credentials and client are defined in the chart. See [How does a service connect to a dependency?](https://docs.flowx.ai/6.x/setup-guides/configure-flowx-ai-helm-chart.md#how-does-a-service-connect-to-a-dependency)

Set both together. With the database and no service account, ui-driver stops at startup.

**4. Point ui-driver at your platform**

Set the two URLs a test run loads the UI flow from. Both must be reachable from the ui-driver pod.

```yaml theme={"dark"}
services:
  ui-driver:
    env:
      AI_RENDER_API_URL: "https://services.example.com"
      AI_RENDER_STATIC_ASSETS_PATH: "https://cdn.example.com/media"
```

Use the same values as the Designer's `BASE_API_URL` and `STATIC_ASSETS_PATH`. See [Designer setup](https://docs.flowx.ai/6.x/setup-guides/designer-setup-guide.md). The chart has no default for `AI_RENDER_STATIC_ASSETS_PATH`, and without it ui-driver refuses every test run.

**5. Restrict who can reach ui-driver**

Recommended: apply the network policy in [Restrict who can reach ui-driver](#restrict-who-can-reach-ui-driver) in the same release.

### ui-driver configuration

| Environment Variable | Description | Default Value |
| - | - | - |
| `AI_RENDER_API_URL` | Public API URL of your FlowX.AI platform, the same as the Designer's `BASE_API_URL`. A test run calls the platform only at this origin | `https://services.<rootDomain>` (chart) |
| `AI_RENDER_STATIC_ASSETS_PATH` | URL your Media Library assets are served from, the same as the Designer's `STATIC_ASSETS_PATH`. Required for test runs | - |
| `AI_RENDER_PROCESS_API_PATH` | API path prefix of the process engine | `/onboarding` (chart) |
| `AI_RENDER_TEST_CONCURRENCY` | Test runs one pod plays at once. `0` turns test runs off | `1` |
| `AI_RENDER_CALLBACK_BASE_URL` | Internal URL of Integration Designer, where ui-driver posts each test result | `http://integration-designer:80` |

The chart sets the service account and database variables (`KEYCLOAK_SA_*`, `AI_RENDER_MONGODB_*`) from the values in step 3. Don't set them by hand.

### Caller check

ui-driver checks the token of each caller that submits or cancels a test run. The token must be signed with RS256, come from the expected issuer and audience, and carry the `SA_FLOWX` role in `realm_access.roles`. A caller without a valid token gets `401`, and one without the role gets `403`.

With Keycloak, ui-driver checks tokens against your service accounts realm and needs no extra setting. With another identity provider, set all three variables, and check that its tokens meet the requirements above before you turn on test runs:

| Environment Variable | Description | Default Value |
| - | - | - |
| `AI_RENDER_JOB_TOKEN_ISSUER` | Issuer in the caller tokens | The Keycloak service accounts realm URL |
| `AI_RENDER_JOB_TOKEN_JWKS_URL` | URL of the issuer's signing keys | The realm's `/protocol/openid-connect/certs` URL |
| `AI_RENDER_JOB_TOKEN_AUDIENCE` | Audience in the caller tokens | `realm-management` |

If you override `FLOWX_LIB_CASCLIENT_IMPERSONATION_IMPERSONATINGCLIENTS` on Application Manager, keep `flowx-ui-driver-sa` in the list, so test runs read Media Library files with the maker's project permissions.

### Integration Designer configuration

Integration Designer sends each test case to ui-driver over the cluster network.

| Environment Variable | Description | Default Value |
| - | - | - |
| `FLOWX_EVALS_UIFLOW_RENDERER_BASEURL` | Base URL of the ui-driver service | `http://ui-driver:80` |

Change it, and `AI_RENDER_CALLBACK_BASE_URL` on ui-driver, only if the two services don't reach each other under their default service names.

***

## Restrict who can reach ui-driver

As defense in depth, let only Integration Designer, and the harness if you use it, connect to ui-driver. Render a NetworkPolicy for ui-driver that admits only pods labeled `ui-driver-client: "true"`, and add that label to the services that call it:

```yaml theme={"dark"}
services:
  ui-driver:
    networkPolicy:
      enabled: true
      allowExternal: false
  integration-designer:
    podLabels:
      ui-driver-client: "true"
  harness:
    podLabels:
      ui-driver-client: "true"
```

Leave the ui-driver ingress off and its service as `ClusterIP`, as the chart deploys it. For the other NetworkPolicy settings, see [How do I restrict network traffic to a service?](https://docs.flowx.ai/6.x/setup-guides/configure-flowx-ai-helm-chart.md#how-do-i-restrict-network-traffic-to-a-service)

***

## Harness renders

The Developer Agentic Harness renders the screens it builds through ui-driver and uses the same platform URLs. Set them on the harness to the values you gave ui-driver:

| Environment Variable | Description | Default Value |
| - | - | - |
| `HARNESS_RENDER_URL` | Internal URL of ui-driver | `http://ui-driver` (chart) |
| `HARNESS_RENDER_API_URL` | Same value as `AI_RENDER_API_URL` | `https://services.<rootDomain>` (chart) |
| `HARNESS_RENDER_STATIC_ASSETS` | Same value as `AI_RENDER_STATIC_ASSETS_PATH` | - |

Without these, the harness still starts, but saves its edits without rendering them first.

***

## Verify your setup

> [!TIP]
>
> `kubectl port-forward svc/ui-driver 8080:80`, then `curl localhost:8080/health`, returns `200` with `"jobs": {"enabled": true, "mongo": true, ...}`. With test runs off, `jobs` is `{"enabled": false}`.

> [!TIP]
>
> `kubectl get networkpolicy ui-driver` lists the policy, and the `integration-designer` pods carry the `ui-driver-client=true` label.

> [!TIP]
>
> In the Designer, a UI flow test case runs to a result with screenshots. See [Run UI flow test cases](https://docs.flowx.ai/6.x/ai-platform/evaluations.md#run-ui-flow-test-cases).

***

## Troubleshooting

> [accordion] ui-driver stops at startup
>
> **Symptoms:** The pod restarts and the log says test jobs need the service account or test runs on.
>
> **Solutions:**
>
> 1. Check that `idpClients: ["uiDriver"]` is set together with the `uiDriver` database
> 2. Check that `AI_RENDER_TEST_CONCURRENCY` is greater than `0`

> [accordion] Every test run is refused
>
> **Symptoms:** Test runs fail at once with an error that a run with the service account needs a setting.
>
> **Solutions:**
>
> 1. Set `AI_RENDER_STATIC_ASSETS_PATH` and `AI_RENDER_API_URL` on ui-driver
> 2. Check that both URLs are reachable from the ui-driver pod

> [accordion] Test runs never finish
>
> **Symptoms:** UI flow test cases stay in progress until they time out.
>
> **Solutions:**
>
> 1. Check that the `integration-designer` pods carry the `ui-driver-client: "true"` label, so the network policy lets them reach ui-driver
> 2. Check that ui-driver reaches Integration Designer at `AI_RENDER_CALLBACK_BASE_URL`
> 3. Check that `GET /health` on ui-driver shows `"mongo": true`

***

## Related resources

> [card] [UI flow test cases](https://docs.flowx.ai/6.x/ai-platform/evaluations.md#ui-flow-test-cases)
>
> Create and run UI flow test cases in the Designer

> [card] [ui-driver service account](https://docs.flowx.ai/6.x/setup-guides/access-management/configuring-an-iam-solution.md#ui-driver-service-account)
>
> Create the `flowx-ui-driver-sa` client

> [card] [Configure the FlowX Helm chart](https://docs.flowx.ai/6.x/setup-guides/configure-flowx-ai-helm-chart.md)
>
> Service groups, dependencies and network policies

> [card] [Integration Designer setup](https://docs.flowx.ai/6.x/setup-guides/integration-designer-setup.md)
>
> Integration Designer configuration


## Related topics

- [Integration Designer setup](https://docs.flowx.ai/6.x/setup-guides/integration-designer-setup.md)
- [Configure the flowx-ai Helm chart for your infrastructure](https://docs.flowx.ai/6.x/setup-guides/configure-flowx-ai-helm-chart.md)
- [Evaluations](https://docs.flowx.ai/6.x/ai-platform/evaluations.md)
- [Deployment guidelines v6.1.0](https://docs.flowx.ai/release-notes/v6.x/v6.1.0-november-2026/deployment-guidelines-v6.1.md)
- [Configuring an IAM solution (Keycloak)](https://docs.flowx.ai/6.x/setup-guides/access-management/configuring-an-iam-solution.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.