# setupConsoleErrorCollection

**Kind:** Function

**Source:** [`atloria-monorepo/apps/web-e2e/src/utils/test-helpers.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/apps/web-e2e/src/utils/test-helpers.ts#L216)

Set up console error collection for a page.
Call this before navigating to collect errors during the action.
Returns a function to get collected errors.

## Signature

```ts
function setupConsoleErrorCollection(page: Page): { getErrors: () => string[]; cleanup: () => void }
```

## Parameters

| Name | Type |
|---|---|
| `page` | `Page` |

**Returns:** `{ getErrors: () => string[]; cleanup: () => void }`
