/// import { EventEmitter } from 'events'; import { Options, PlyOptions, RunOptions } from './options'; import { Suite } from './suite'; import { Test } from './test'; import { Request } from './request'; import { Case } from './case'; import { Log } from './log'; import { FlowSuite } from './flows'; import { OverallResults } from './runs/model'; export declare class Ply { private logger?; readonly options: PlyOptions; constructor(options?: Options, logger?: Log | undefined); /** * Load request from .ply file */ loadRequest(location: string): Promise; loadRequestSync(location: string): Request; /** * Load request suites. * @param locations can be URLs or file paths */ loadRequests(location: string): Promise[]>; loadRequests(...locations: string[]): Promise[]>; loadRequests(locations: string[], ...moreLocations: string[]): Promise[]>; /** * Throws if location or suite not found */ loadRequestSuite(location: string): Promise>; /** * Load request suites. * @param locations can be URLs or file paths */ loadRequestsSync(location: string): Suite[]; loadRequestsSync(...locations: string[]): Suite[]; loadRequestsSync(locations: string[], ...moreLocations: string[]): Suite[]; /** * Throws if location or suite not found */ loadRequestSuiteSync(location: string): Suite; loadSuite(location: string): Promise>; loadSuiteSync(location: string): Suite; /** * Throws if location or suite not found */ loadCaseSuites(location: string): Promise[]>; loadCases(file: string): Promise[]>; loadCases(...files: string[]): Promise[]>; loadCases(files: string[], ...moreFiles: string[]): Promise[]>; /** * Throws if location or suite not found */ loadFlowSuites(location: string): Promise; loadFlow(file: string): Promise; loadFlows(file: string): Promise; loadFlows(...files: string[]): Promise; loadFlows(files: string[], ...moreFiles: string[]): Promise; } /** * A Plyee is a test (request/case), or a suite. * * Format: #^ * eg: c:/ply/ply/test/ply/requests/movie-queries.ply.yaml#moviesByYearAndRating * or: /Users/me/ply/ply/test/ply/cases/movieCrud.ply.ts#movie-crud^add new movie * or for a suite: /Users/me/ply/ply/test/ply/requests/movie-queries.ply.yaml * (TODO: handle caseFile#suite^case) */ export declare class Plyee { readonly path: string; private hash; private hat; constructor(suite: string, test: Test); constructor(path: string); get location(): string; get suite(): string; get test(): string | undefined; toString(): string; static isRequest(path: string): boolean; static isCase(path: string): boolean; static isFlow(path: string): boolean; /** * Maps plyee paths to Plyee by Suite. */ static requests(paths: string[]): Map; static cases(paths: string[]): Map; static flows(paths: string[]): Map; /** * Returns a map of unique suite location to Plyee[] * @param paths test paths * @param test (optional) for matching */ static collect(paths: string[], test?: (plyee: Plyee) => boolean): Map; } /** * Utility for executing multiple tests, organized into their respective suites. * Used by both CLI and vscode-ply. */ export declare class Plier extends EventEmitter { private readonly ply; /** * general purpose logger not associated with suite (goes to console) */ readonly logger: Log; get options(): PlyOptions; constructor(options?: Options, logger?: Log); /** * Plyees should be test paths (not suites). */ run(plyees: string[], runOptions?: RunOptions, plyVersion?: string): Promise; /** * Finds plyees from suites and tests. * @param paths suite/test paths */ find(paths: string[]): Promise; }