@labnex/cli
Version:
CLI for Labnex, an AI-Powered Testing Automation Platform
148 lines • 4.44 kB
TypeScript
export interface ApiResponse<T = unknown> {
success: boolean;
data: T;
message?: string;
error?: string;
}
export interface Project {
_id: string;
name: string;
projectCode: string;
description?: string;
isActive: boolean;
testCaseCount: number;
taskCount: number;
owner: {
_id: string;
name: string;
email: string;
};
members: Array<{
_id: string;
name: string;
email: string;
role: string;
}>;
createdAt: string;
updatedAt: string;
}
export interface TestCase {
_id: string;
title: string;
description?: string;
steps: string[];
expectedResult: string;
priority: 'LOW' | 'MEDIUM' | 'HIGH';
status: 'PENDING' | 'PASSED' | 'FAILED';
projectId: string;
createdAt: string;
updatedAt: string;
}
export interface TestRun {
_id: string;
projectId: string;
testCases: string[];
status: 'PENDING' | 'RUNNING' | 'COMPLETED' | 'FAILED';
results: {
total: number;
passed: number;
failed: number;
duration: number;
};
config: {
parallel: number;
environment: string;
aiOptimization: boolean;
};
createdAt: string;
updatedAt: string;
}
export declare class LabnexApiClient {
private api;
private token?;
private verboseLogging;
constructor();
setVerbose(verbose: boolean): void;
/**
* Allow commands to turn on verbose logging after the client has been constructed.
* (Helpful for sub-commands that parse --verbose themselves.)
*/
enableVerbose(): void;
login(email: string, password: string): Promise<ApiResponse<{
user: unknown;
token: string;
}>>;
me(): Promise<ApiResponse<{
user: any;
}>>;
getProjects(): Promise<ApiResponse<Project[]>>;
getProject(projectId: string): Promise<ApiResponse<Project>>;
displayProjectDetails(project: Project): Promise<void>;
createProject(project: {
name: string;
projectCode: string;
description?: string;
}): Promise<ApiResponse<Project>>;
getTestCases(projectId: string): Promise<ApiResponse<TestCase[]>>;
createTestCase(projectId: string, testCase: {
title: string;
description?: string;
steps: string[];
expectedResult: string;
priority: 'LOW' | 'MEDIUM' | 'HIGH';
}): Promise<ApiResponse<TestCase>>;
createTestRun(projectId: string, config: {
testCases?: string[];
parallel?: number;
environment?: string;
aiOptimization?: boolean;
baseUrl?: string;
useCloudRunner?: boolean;
credentials?: {
username?: string;
password?: string;
};
}): Promise<ApiResponse<TestRun>>;
getTestRun(runId: string): Promise<ApiResponse<TestRun>>;
getTestRunResults(runId: string): Promise<ApiResponse<{
total: number;
passed: number;
failed: number;
duration: number;
}>>;
getTestRuns(projectId: string): Promise<ApiResponse<TestRun[]>>;
generateTestCase(description: string): Promise<ApiResponse<{
title: string;
description: string;
steps: string[];
expectedResult: string;
}>>;
optimizeTestSuite(projectId: string, codeChanges?: string[]): Promise<ApiResponse<{
selectedTests: string[];
reasoning: string;
}>>;
analyzeFailure(testRunId: string, failureId: string): Promise<ApiResponse<{
analysis: string;
suggestions: string[];
}>>;
analyzeFailureConversational(testRunId: string, failureId: string, conversationHistory: any[], question: string): Promise<ApiResponse<{
analysis: string;
suggestions: string[];
}>>;
interpretTestStep(stepDescription: string): Promise<ApiResponse<string>>;
suggestAlternative(step: string, pageContext?: string): Promise<ApiResponse<string>>;
getDynamicSelectorSuggestion(context: {
failedSelector: string;
descriptiveTerm: string;
pageUrl: string;
domSnippet: string;
originalStep: string;
}): Promise<ApiResponse<{
suggestedSelector: string;
suggestedStrategy?: string;
confidence?: number;
reasoning?: string;
}>>;
}
export declare const apiClient: LabnexApiClient;
//# sourceMappingURL=client.d.ts.map