Ghost (QA Testing)
API-orchestrated automated test session control
Ghost functionality is provided via API-backed thunks.
Start Session
1 import { createSDKStore, startGhostThunk } from '@forbocai/core'; 2 3 const store = createSDKStore(); 4 5 const 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 12 console.log(started.sessionId, started.status);
Status, Results, Stop, History
1 import { 2 getGhostStatusThunk, 3 getGhostResultsThunk, 4 stopGhostThunk, 5 getGhostHistoryThunk 6 } from '@forbocai/core'; 7 8 const 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 14 const 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 20 await store.dispatch(stopGhostThunk({ 21 sessionId: 'ghost_session_id', 22 apiUrl: 'https://api.forboc.ai', 23 apiKey: process.env.FORBOCAI_API_KEY 24 })).unwrap(); 25 26 const history = await store.dispatch(getGhostHistoryThunk({ 27 limit: 10, 28 apiUrl: 'https://api.forboc.ai', 29 apiKey: process.env.FORBOCAI_API_KEY 30 })).unwrap(); 31 32 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
