***

title: Ghost (QA Testing)
description: 'API-backed Ghost session execution, polling, and history'
slug: ue/ghost
--------------

Ghost behavior in the UE plugin mirrors the current ghost slice in the TypeScript SDKs. The UE runtime starts and monitors API-backed Ghost sessions rather than running a separate local test-engine abstraction.

## Core Types

Key response types:

* `FGhostRunResponse`
* `FGhostStatusResponse`
* `FGhostResultsResponse`
* `FGhostHistoryEntry`
* `FGhostTestReport`

`FGhostConfig` carries the request metadata used to start a session.

## Start And Poll A Session

```cpp
#include "RuntimeStore.h"
#include "RuntimeConfig.h"
#include "CLI/CliOperations.h"

auto Store = createSDKStore();
SDKConfig::SetApiConfig(TEXT("https://api.forboc.ai"), ApiKey);

FGhostRunResponse Run = SDKOps::GhostRun(Store, TEXT("smoke"), 300);
FGhostStatusResponse Status = SDKOps::GhostStatus(Store, Run.SessionId);
FGhostResultsResponse Results = SDKOps::GhostResults(Store, Run.SessionId);
```

To stop a running session:

```cpp
FGhostStopResponse Stop = SDKOps::GhostStop(Store, Run.SessionId);
```

To inspect recent history:

```cpp
TArray<FGhostHistoryEntry> History = SDKOps::GhostHistory(Store, 10);
```

## Slice Behavior

`getGhostResultsThunk(...)` translates the raw API result payload into `FGhostTestReport` data inside `GhostSlice`, including:

* pass/fail counts
* duration
* coverage
* metrics
* per-test screenshot and error metadata

## Blueprint Support

The Blueprint library currently exposes:

* `GhostRun(TestSuite, Duration) -> SessionId`
* `GhostStop(SessionId) -> StopStatus`

For status, results, and history polling, use C++ with `SDKOps` or the direct thunks.
