UNPKG

@wdio/allure-reporter

Version:
200 lines 6.45 kB
import type { StepContext } from 'allure-js-commons'; import { ContentType, Status } from 'allure-js-commons'; /** * Assign label to test * @name addLabel * @param {string} name - label name * @param {string} value - label value */ export declare function addLabel(name: string, value: string): void; /** * Assign link to test * @name addLink * @param {string} url - link name * @param {string} [name] - link name * @param {string} [type] - link type */ export declare function addLink(url: string, name?: string, type?: string): Promise<void>; /** * Assign allure id label to test to link test to existing entity inside the test ops * @name addAllureId * @param {string} id - inner allure test ops id */ export declare function addAllureId(id: string): Promise<void>; /** * Assign feature to test * @name addFeature * @param {(string)} featureName - feature name or an array of names */ export declare function addFeature(featureName: string): Promise<void>; /** * Assign severity to test * @name addSeverity * @param {string} value - severity value */ export declare function addSeverity(value: string): Promise<void>; /** * Assign issue id to test * @name addIssue * @param {string} id - issue id value */ export declare function addIssue(id: string): Promise<void>; /** * Assign TMS test id to test * @name addTestId * @param {string} testId - test id value */ export declare function addTestId(testId: string): Promise<void>; /** * Assign story label to test * @name addStory * @param {string} storyName - story name for test */ export declare function addStory(storyName: string): Promise<void>; /** * Assign suite label to test * @name addSuite * @param {string} suiteName - story name for test */ export declare function addSuite(suiteName: string): Promise<void>; /** * Assign parent suite label to test * @name addParentSuite * @param {string} suiteName - suite name */ export declare function addParentSuite(suiteName: string): Promise<void>; /** * Assign sub-suite label to test * @name addSubSuite * @param {string} suiteName - sub-suite name */ export declare function addSubSuite(suiteName: string): Promise<void>; /** * Assign epic label to test * @name addEpic * @param {string} epicName - the epic name */ export declare function addEpic(epicName: string): Promise<void>; /** * Assign owner label to test * @name addOwner * @param {string} ownerName - the owner name */ export declare function addOwner(ownerName: string): Promise<void>; /** * Assign tag label to test * @name addTag * @param {string} tagName - the tag name */ export declare function addTag(tagName: string): Promise<void>; /** * Add environment value * @name addEnvironment * @deprecated addEnvironment is deprecated. Use reportedEnvironmentVars in config instead. */ export declare function addEnvironment(name: string, value: string): Promise<void>; /** * Assign test description to test * @name addDescription * @param {string} descriptionText - description for test * @param {string} descriptionType - description type 'text'\'html'\'markdown' */ export declare function addDescription(descriptionText: string, descriptionType?: string): Promise<void>; /** * Add attachment * @name addAttachment * @param {string} name - attachment file name * @param {*} content - attachment content * @param {string=} type - attachment mime type */ export declare function addAttachment(name: string, content: string | Buffer | object, type: string): Promise<void>; /** * Add additional argument to test * @name addArgument * @param {string} name - argument name * @param {string} value - argument value */ export declare function addArgument(name: string, value: string): Promise<void>; /** * Add history id to the test, which won't be re-calculated in the end * @name addHistoryId * @param {string} id - history id */ export declare function addHistoryId(id: string): Promise<void>; /** * Add test case id to the test, which won't be re-calculated in the end * @name addTestCaseId * @param {string} id - test case id */ export declare function addTestCaseId(id: string): Promise<void>; /** * Start allure step * @name startStep * @param {string} title - step name in report */ export declare function startStep(title: string): Promise<void>; /** * End current allure step * @name endStep * @param {status} [status='passed'] - step status */ export declare function endStep(status?: Status): Promise<void>; /** * Create allure step * @name addStep * @param {string} title - step name in report * @param {object} [attachment={}] - attachment for step * @param {string} attachment.content - attachment content * @param {string} [attachment.name='attachment'] - attachment name * @param {string} [attachment.type='text/plain'] - attachment type * @param {string} [status='passed'] - step status */ export declare function addStep(title: string, attachment?: { content: string; name?: string; type?: ContentType; } | undefined, status?: Status): Promise<void>; /** /** * Starts allure step execution with any content * Can be used to generate any hierarchy of steps * @example * ```js * await step("foo", async (context) => { * await step("bar", async (context) => { * await step("baz", async (context) => { * // ... * }) * }) * }) * ``` * @param {string} name - the step name * @param {(context: StepContext) => T | Promise<T>} body - the step content function */ export declare function step<T = void>(name: string, body: (context: StepContext) => T | Promise<T>): Promise<T>; declare const _default: { addLabel: typeof addLabel; addLink: typeof addLink; addAllureId: typeof addAllureId; addFeature: typeof addFeature; addSeverity: typeof addSeverity; addIssue: typeof addIssue; addTestId: typeof addTestId; addStory: typeof addStory; addSuite: typeof addSuite; addParentSuite: typeof addParentSuite; addSubSuite: typeof addSubSuite; addEpic: typeof addEpic; addOwner: typeof addOwner; addTag: typeof addTag; addEnvironment: typeof addEnvironment; addDescription: typeof addDescription; addAttachment: typeof addAttachment; startStep: typeof startStep; endStep: typeof endStep; addStep: typeof addStep; addArgument: typeof addArgument; step: typeof step; }; export default _default; //# sourceMappingURL=api.d.ts.map