UNPKG

@testomatio/reporter

Version:
93 lines (92 loc) 2.85 kB
declare namespace _default { export { saveArtifact as artifact }; export { logMessage as log }; export { addStep as step }; export { setKeyValue as keyValue }; export { setLabel as label }; export { linkTest }; export { linkJira }; } export default _default; /** * Stores path to file as artifact and uploads it to the S3 storage * @param {string | {path: string, type: string, name: string}} data - path to file or object with path, type and name * @param {any} [context=null] - optional context parameter * @returns {void} */ declare function saveArtifact(data: string | { path: string; type: string; name: string; }, context?: any): void; /** * Attach log message(s) to the test report * @param {...any} args - log messages to attach * @returns {void} */ declare function logMessage(...args: any[]): void; /** * Similar to "log" function but marks message in report as a step * @param {string} message - step message * @param {{[key: string]: any}} [logs] optional key-value object with additional info, e.g. logs * @returns {void} * * Example: * step('Get response', { logs: {status: 'success'} }); */ declare function addStep(message: string, logs?: { [key: string]: any; }): void; /** * Add key-value pair(s) to the test report * @param {{[key: string]: string} | string} keyValue - object { key: value } (multiple props allowed) OR key (string) * @param {string|undefined} [value=undefined] - optional value when keyValue is a string * @returns {void} * * @example * meta('key', 'value'); * meta({ key: 'value' }); * meta({ key1: 'value1', key2: 'value2' }); */ declare function setKeyValue(keyValue: { [key: string]: string; } | string, value?: string | undefined): void; /** * Adds label(s) to the test * @param {string | { * [key: string]: string} * } key - just label OR custom field name OR object with custom field name and value * @param {string | null} [value=null] - optional label value (of custom field value) * (used when key is a string) * @returns {void} * * @example * label('high'); * label('priority', 'high'); * label({priority: 'high'}); */ declare function setLabel(key: string | { [key: string]: string; }, value?: string | null): void; /** * Add link(s) to the test report * @param {...string | string[]} testIds - test IDs to link * @returns {void} * * @example * linkTest('T11111111', 'T22222222') * or * linkTest(['T11111111', 'T22222222']) */ declare function linkTest(...testIds: (string | string[])[]): void; /** * Add JIRA issue link(s) to the test report * @param {...(string | string[])} jiraIds - JIRA issue IDs to link * @returns {void} * * @example * linkJira('TICKET-1', 'TICKET-2') * or * linkJira(['TICKET-1', 'TICKET-2']) */ declare function linkJira(...jiraIds: (string | string[])[]): void;