Ghost (QA Testing)

API-orchestrated automated test session control

View as Markdown

Ghost functionality is provided via API-backed thunks.

Start Session

1import { createSDKStore, startGhostThunk } from '@forbocai/core';
2
3const store = createSDKStore();
4
5const started = await store.dispatch(startGhostThunk({
6 testSuite: 'exploration',
7 duration: 300,
8 apiUrl: 'https://api.forboc.ai',
9 apiKey: process.env.FORBOCAI_API_KEY
10})).unwrap();
11
12console.log(started.sessionId, started.status);

Status, Results, Stop, History

1import {
2 getGhostStatusThunk,
3 getGhostResultsThunk,
4 stopGhostThunk,
5 getGhostHistoryThunk
6} from '@forbocai/core';
7
8const status = await store.dispatch(getGhostStatusThunk({
9 sessionId: 'ghost_session_id',
10 apiUrl: 'https://api.forboc.ai',
11 apiKey: process.env.FORBOCAI_API_KEY
12})).unwrap();
13
14const results = await store.dispatch(getGhostResultsThunk({
15 sessionId: 'ghost_session_id',
16 apiUrl: 'https://api.forboc.ai',
17 apiKey: process.env.FORBOCAI_API_KEY
18})).unwrap();
19
20await store.dispatch(stopGhostThunk({
21 sessionId: 'ghost_session_id',
22 apiUrl: 'https://api.forboc.ai',
23 apiKey: process.env.FORBOCAI_API_KEY
24})).unwrap();
25
26const history = await store.dispatch(getGhostHistoryThunk({
27 limit: 10,
28 apiUrl: 'https://api.forboc.ai',
29 apiKey: process.env.FORBOCAI_API_KEY
30})).unwrap();
31
32console.log(status.status, results.totalTests, history.length);

CLI

$npx forbocai ghost run exploration
$npx forbocai ghost status <sessionId>
$npx forbocai ghost results <sessionId>
$npx forbocai ghost stop <sessionId>
$npx forbocai ghost history