UNPKG

@mmisty/cypress-allure-adapter

Version:

cypress allure adapter to generate allure results during tests execution (Allure TestOps compatible)

147 lines (146 loc) 5.66 kB
import { FixtureResult, Status, StatusDetails, StepResult, TestResult } from 'allure-js-commons'; import { ReporterRuntime } from 'allure-js-commons/sdk/reporter'; import { ReporterOptions } from './allure'; import { GlobalHooks } from './allure-global-hook'; import { AfterSpecScreenshots, AllureTaskArgs, AutoScreen, EnvironmentInfo, StatusType } from './allure-types'; import { TaskManager } from './task-manager'; import { AllureTaskClient } from './allure-task-client'; type ExecutableItem = StepResult | FixtureResult | TestResult; interface GroupInfo { uuid: string; name: string; scopeUuid: string; childUuids: string[]; nestedLevel: number; } interface TestInfo { uuid: string; result: TestResult; } interface StepInfo { uuid: string; result: StepResult; rootUuid: string; } interface HookInfo { id?: string; uuid: string; result: FixtureResult; nested: number; name: string; scopeUuid: string; } export declare class AllureReporter { private taskManager; private client; private showDuplicateWarn; private allureResults; private allureResultsWatch; private allureAddVideoOnPass; private allureSkipSteps; private videos; private screenshots; groups: GroupInfo[]; tests: TestInfo[]; steps: StepInfo[]; labels: { name: string; value: string; }[]; globalHooks: GlobalHooks; hooks: HookInfo[]; allHooks: HookInfo[]; currentSpec: Cypress.Spec | undefined; taskQueueId: string | undefined; allureRuntime: ReporterRuntime; private writer; descriptionHtml: string[]; private screenshotsTest; private allureResultsDirEnsured; testStatusStored: AllureTaskArgs<'testStatus'> | undefined; testDetailsStored: AllureTaskArgs<'testDetails'> | undefined; constructor(opts: ReporterOptions, taskManager: TaskManager, client: AllureTaskClient); get currentTestAll(): { specRelative: string | undefined; fullTitle: string; uuid: string; mochaId: string; retryIndex: number | undefined; status?: Status; } | undefined; get currentGroup(): GroupInfo | undefined; get currentTest(): TestInfo | undefined; get currentHook(): HookInfo | undefined; get currentStep(): StepInfo | undefined; get currentExecutable(): { uuid: string; result: ExecutableItem; rootUuid?: string; } | undefined; /** * Get all tests for external use (e.g., for server operations) */ getAllTests(): { specRelative: string | undefined; fullTitle: string; uuid: string; mochaId: string; retryIndex: number | undefined; status: string | undefined; }[]; /** * Get screenshots for spec to send to server */ getScreenshotsForSpec(arg: AfterSpecScreenshots): AutoScreen[]; addGlobalHooks(_nestedLevel: number): void; suiteStarted(arg: AllureTaskArgs<'suiteStarted'>): void; addHooks(nested: number): void; specStarted(args: AllureTaskArgs<'specStarted'>): void; hookStarted(arg: AllureTaskArgs<'hookStarted'>): void; setExecutableStatus(executableItem: ExecutableItem | undefined, res: Status, dtls?: StatusDetails): void; setExecutableItemStatus(executableItem: ExecutableItem | undefined, res: Status, dtls?: StatusDetails): void; hookEnded(arg: AllureTaskArgs<'hookEnded'>): void; endHooks(status?: StatusType): void; screenshotAttachment(arg: AllureTaskArgs<'screenshotAttachment'>): void; screenshotOne(arg: AllureTaskArgs<'screenshotOne'>): void; endGroup(): void; endAllGroups(): void; label(arg: AllureTaskArgs<'label'>): void; link(arg: AllureTaskArgs<'link'>): void; fullName(arg: AllureTaskArgs<'fullName'>): void; historyId(arg: AllureTaskArgs<'fullName'>): void; parameter(arg: AllureTaskArgs<'parameter'>): void; private addGroupLabelByUser; suite(arg: AllureTaskArgs<'suite'>): void; parentSuite(arg: AllureTaskArgs<'parentSuite'>): void; subSuite(arg: AllureTaskArgs<'subSuite'>): void; testParameter(arg: AllureTaskArgs<'parameter'>): void; testFileAttachment(arg: AllureTaskArgs<'testFileAttachment'>): void; fileAttachment(arg: AllureTaskArgs<'fileAttachment'>): void; testAttachment(arg: AllureTaskArgs<'testAttachment'>): void; attachment(arg: AllureTaskArgs<'attachment'>): void; addGroupLabels(): void; writeEnvironmentInfo(arg: AllureTaskArgs<'writeEnvironmentInfo'>): void; addEnvironmentInfo(arg: AllureTaskArgs<'addEnvironmentInfo'>): void; startTest(arg: AllureTaskArgs<'testStarted'>): void; endTests(): void; endGroups(): void; endAll(): void; addDescriptionHtml(arg: AllureTaskArgs<'addDescriptionHtml'>): void; applyDescriptionHtml(): void; testStatus(arg: AllureTaskArgs<'testStatus'>): void; testDetails(arg: AllureTaskArgs<'testDetails'>): void; applyGroupLabels(): void; filterSteps(result: FixtureResult | TestResult | StepResult | undefined, skipSteps: RegExp[]): void; endTest(arg: AllureTaskArgs<'testEnded'>): void; startStep(arg: AllureTaskArgs<'stepStarted'>): void; endAllSteps(arg: AllureTaskArgs<'stepEnded'>): void; setLastStepStatus(steps: StepResult[], status: Status, details?: StatusDetails): void; hasChildrenWith(steps: StepResult[], statuses: Status[]): boolean; endStep(arg: AllureTaskArgs<'stepEnded'>): void; private executableAttachment; setAttached(file: string): void; private executableFileAttachment; getEnvInfo(resultsFolder: string): EnvironmentInfo; } export {};