UNPKG

angles-javascript-client

Version:

This is the javascript client for the Angles Dashboard. It allows you to store your test results.

63 lines (62 loc) 3.23 kB
import { AxiosInstance } from 'axios'; import { TeamRequests } from './requests/TeamRequests'; import { EnvironmentRequests } from './requests/EnvironmentRequests'; import { BuildRequests } from './requests/BuildRequests'; import { ExecutionRequests } from './requests/ExecutionRequests'; import { ScreenshotRequests } from './requests/ScreenshotRequests'; import { Build } from './models/Build'; import { Artifact } from './models/Artifact'; import { Screenshot } from './models/Screenshot'; import { StepStates } from './models/enum/StepStates'; import { ScreenshotPlatform } from './models/requests/ScreenshotPlatform'; import { Execution } from './models/Execution'; import { ImageCompareResponse } from './models/response/ImageCompareResponse'; import { Platform } from "./models/Platform"; export declare class AnglesReporterClass { private static _instance; protected axiosInstance: AxiosInstance; teams: TeamRequests; environments: EnvironmentRequests; builds: BuildRequests; executions: ExecutionRequests; screenshots: ScreenshotRequests; private currentBuild; private currentExecution; private currentAction; private apiConfig; constructor(); setBaseUrl(baseUrl: string): void; /** * If the current build at a seperate point, then you can set it again by calling this function. * @param buildId */ setCurrentBuild(buildId: string): void; private instantiateAxios; static getInstance(): AnglesReporterClass; /** * Returns the single instance of the angles reporter. * * @param {string} [baseUrl] - Set a new base url whilst grabbing the latest instance. e.g. http://127.0.0.1:3000/rest/api/v1.0/ */ static getInstanceWithBaseUrl(baseUrl: string): AnglesReporterClass; startBuild(name: string, team: string, environment: string, component: string, phase: string): Promise<Build>; addArtifacts(artifacts: Artifact[]): Promise<Build>; startTest(title: string, suite: string): void; updateTestName(title: string, suite: string): void; storePlatformDetails(platform: Platform): void; saveTest(): Promise<Execution>; saveScreenshot(filePath: string, view: string, tags: string[]): Promise<Screenshot>; saveScreenshotWithPlatform(filePath: string, view: string, tags: string[], platform: ScreenshotPlatform): Promise<Screenshot>; compareScreenshotAgainstBaseline(screenshotId: string): Promise<ImageCompareResponse>; addAction(name: string): void; info(info: string): void; debug(info: string): void; infoWithScreenshot(info: string, screenshotId: string): void; error(error: string): void; errorWithScreenshot(error: string, screenshotId: string): void; pass(name: string, expected: string, actual: string, info: string): void; passWithScreenshot(name: string, expected: string, actual: string, info: string, screenshot: string): void; fail(name: string, expected: string, actual: string, info: string): void; failWithScreenshot(name: string, expected: string, actual: string, info: string, screenshotId: string): void; addStep(name: string, expected: string, actual: string, info: string, status: StepStates, screenshot: string): void; }