Skip to navigation

Ghost (QA Testing)

API-orchestrated automated test session control
View as Markdown

Ghost functionality is provided via API-backed thunks.

Start Session

import { createSDKStore, startGhostThunk } from '@forbocai/core';
const store = createSDKStore();
const started = await store.dispatch(startGhostThunk({
testSuite: 'exploration',
duration: 300,
apiUrl: 'https://api.forboc.ai',
apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();
console.log(started.sessionId, started.status);

Status, Results, Stop, History

import {
getGhostStatusThunk,
getGhostResultsThunk,
stopGhostThunk,
getGhostHistoryThunk
} from '@forbocai/core';
const status = await store.dispatch(getGhostStatusThunk({
sessionId: 'ghost_session_id',
apiUrl: 'https://api.forboc.ai',
apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();
const results = await store.dispatch(getGhostResultsThunk({
sessionId: 'ghost_session_id',
apiUrl: 'https://api.forboc.ai',
apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();
await store.dispatch(stopGhostThunk({
sessionId: 'ghost_session_id',
apiUrl: 'https://api.forboc.ai',
apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();
const history = await store.dispatch(getGhostHistoryThunk({
limit: 10,
apiUrl: 'https://api.forboc.ai',
apiKey: process.env.FORBOCAI_API_KEY
})).unwrap();
console.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