diff --git a/lib/adapter/playwright.d.ts b/lib/adapter/playwright.d.ts index f62e6e22..d018aa83 100644 --- a/lib/adapter/playwright.d.ts +++ b/lib/adapter/playwright.d.ts @@ -11,5 +11,4 @@ declare class PlaywrightReporter { onEnd(result: any): Promise; #private; } -export function initPlaywrightForStorage(): Promise; import TestomatioClient from '../client.js'; diff --git a/lib/adapter/playwright.js b/lib/adapter/playwright.js index ee5b1005..e99b5ab9 100644 --- a/lib/adapter/playwright.js +++ b/lib/adapter/playwright.js @@ -1,32 +1,8 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.initPlaywrightForStorage = initPlaywrightForStorage; const picocolors_1 = __importDefault(require("picocolors")); const crypto_1 = __importDefault(require("crypto")); const os_1 = __importDefault(require("os")); @@ -132,9 +108,12 @@ class PlaywrightReporter { return path_1.default.join(this.config.outputDir || this.config.projects[0].outputDir, artifact.path); } if (artifact.body) { - const fileName = tmpFile(); - fs_1.default.writeFileSync(fileName, artifact.body); - return fileName; + let filePath = generateTmpFilepath(artifact.name); + const extension = artifact.contentType?.split('/')[1]?.replace('jpeg', 'jpg'); + if (extension) + filePath += `.${extension}`; + fs_1.default.writeFileSync(filePath, artifact.body); + return filePath; } return null; } @@ -214,9 +193,10 @@ function appendStep(step, shift = 0) { } return resultStep; } -function tmpFile(prefix = 'tmp.') { +function generateTmpFilepath(filename = '') { + filename = filename || `tmp.${crypto_1.default.randomBytes(16).toString('hex')}`; const tmpdir = os_1.default.tmpdir(); - return path_1.default.join(tmpdir, prefix + crypto_1.default.randomBytes(16).toString('hex')); + return path_1.default.join(tmpdir, filename); } /** * Returns filename + test title @@ -226,20 +206,4 @@ function tmpFile(prefix = 'tmp.') { function getTestContextName(test) { return `${test._requireFile || ''}_${test.title}`; } -async function initPlaywrightForStorage() { - try { - // @ts-ignore-next-line - // eslint-disable-next-line import/no-extraneous-dependencies - const { test } = await Promise.resolve().then(() => __importStar(require('@playwright/test'))); - // eslint-disable-next-line no-empty-pattern - test.beforeEach(async ({}, testInfo) => { - global.testomatioTestTitle = `${testInfo.file || ''}_${testInfo.title}`; - }); - } - catch (e) { - // ignore - } -} module.exports = PlaywrightReporter; - -module.exports.initPlaywrightForStorage = initPlaywrightForStorage; diff --git a/lib/client.js b/lib/client.js index 3c82ed99..1add9a65 100644 --- a/lib/client.js +++ b/lib/client.js @@ -282,46 +282,45 @@ class Client { .then(() => { if (!this.uploader.isEnabled) return; + const filesizeStrMaxLength = 7; if (this.uploader.successfulUploads.length) { - console.log(constants_js_1.APP_PREFIX, `🗄️ ${this.uploader.successfulUploads.length} artifacts ${process.env.TESTOMATIO_PRIVATE_ARTIFACTS ? 'privately' : picocolors_1.default.bold('publicly')} 🟢uploaded to S3 bucket`); - const filesizeStrMaxLength = 7; - if (this.uploader.successfulUploads.length) { - debug('\n', constants_js_1.APP_PREFIX, `🗄️ ${this.uploader.successfulUploads.length} artifacts uploaded to S3 bucket`); - const uploadedArtifacts = this.uploader.successfulUploads.map(file => ({ - relativePath: file.path.replace(process.cwd(), ''), - link: file.link, - sizePretty: (0, filesize_1.filesize)(file.size, { round: 0 }).toString(), - })); - uploadedArtifacts.forEach(upload => { - debug(`🟢Uploaded artifact`, `${upload.relativePath},`, 'size:', `${upload.sizePretty},`, 'link:', `${upload.link}`); - }); - } - if (this.uploader.failedUploads.length) { - console.log(constants_js_1.APP_PREFIX, `🗄️ ${this.uploader.failedUploads.length} artifacts 🔴${picocolors_1.default.bold('failed')} to upload`); - const failedUploads = this.uploader.failedUploads.map(file => ({ - relativePath: file.path.replace(process.cwd(), ''), - sizePretty: (0, filesize_1.filesize)(file.size, { round: 0 }).toString(), - })); - const pathPadding = Math.max(...failedUploads.map(upload => upload.relativePath.length)) + 1; - failedUploads.forEach(upload => { - console.log(` ${picocolors_1.default.gray('|')} 🔴 ${upload.relativePath.padEnd(pathPadding)} ${picocolors_1.default.gray(`| ${upload.sizePretty.padStart(filesizeStrMaxLength)} |`)}`); - }); - } - if (this.uploader.skippedUploads.length) { - console.log('\n', constants_js_1.APP_PREFIX, `🗄️ ${picocolors_1.default.bold(this.uploader.skippedUploads.length)} artifacts uploading 🟡${picocolors_1.default.bold('skipped')}`); - const skippedUploads = this.uploader.skippedUploads.map(file => ({ - relativePath: file.path.replace(process.cwd(), ''), - sizePretty: file.size === null ? 'unknown' : (0, filesize_1.filesize)(file.size, { round: 0 }).toString(), - })); - const pathPadding = Math.max(...skippedUploads.map(upload => upload.relativePath.length)) + 1; - skippedUploads.forEach(upload => { - console.log(` ${picocolors_1.default.gray('|')} 🟡 ${upload.relativePath.padEnd(pathPadding)} ${picocolors_1.default.gray(`| ${upload.sizePretty.padStart(filesizeStrMaxLength)} |`)}`); - }); - } - if (this.uploader.skippedUploads.length || this.uploader.failedUploads.length) { - const command = `TESTOMATIO= TESTOMATIO_RUN=${this.runId} npx @testomatio/reporter upload-artifacts`; - console.log(constants_js_1.APP_PREFIX, `Run "${picocolors_1.default.magenta(command)}" with valid S3 credentials to upload skipped & failed artifacts`); - } + debug('\n', constants_js_1.APP_PREFIX, `🗄️ ${this.uploader.successfulUploads.length} artifacts uploaded to S3 bucket`); + const uploadedArtifacts = this.uploader.successfulUploads.map(file => ({ + relativePath: file.path.replace(process.cwd(), ''), + link: file.link, + sizePretty: (0, filesize_1.filesize)(file.size, { round: 0 }).toString(), + })); + uploadedArtifacts.forEach(upload => { + debug(`🟢Uploaded artifact`, `${upload.relativePath},`, 'size:', `${upload.sizePretty},`, 'link:', `${upload.link}`); + }); + } + if (this.uploader.failedUploads.length) { + console.log(constants_js_1.APP_PREFIX, `🗄️ ${this.uploader.failedUploads.length} artifacts 🔴${picocolors_1.default.bold('failed')} to upload`); + const failedUploads = this.uploader.failedUploads.map(file => ({ + relativePath: file.path.replace(process.cwd(), ''), + sizePretty: (0, filesize_1.filesize)(file.size, { round: 0 }).toString(), + })); + const pathPadding = Math.max(...failedUploads.map(upload => upload.relativePath.length)) + 1; + failedUploads.forEach(upload => { + console.log(` ${picocolors_1.default.gray('|')} 🔴 ${upload.relativePath.padEnd(pathPadding)} ${picocolors_1.default.gray(`| ${upload.sizePretty.padStart(filesizeStrMaxLength)} |`)}`); + }); + } + if (this.uploader.skippedUploads.length) { + console.log('\n', constants_js_1.APP_PREFIX, `🗄️ ${picocolors_1.default.bold(this.uploader.skippedUploads.length)} artifacts uploading 🟡${picocolors_1.default.bold('skipped')}`); + const skippedUploads = this.uploader.skippedUploads.map(file => ({ + relativePath: file.path.replace(process.cwd(), ''), + sizePretty: file.size === null ? 'unknown' : (0, filesize_1.filesize)(file.size, { round: 0 }).toString(), + })); + const pathPadding = Math.max(...skippedUploads.map(upload => upload.relativePath.length)) + 1; + skippedUploads.forEach(upload => { + console.log(` ${picocolors_1.default.gray('|')} 🟡 ${upload.relativePath.padEnd(pathPadding)} ${picocolors_1.default.gray(`| ${upload.sizePretty.padStart(filesizeStrMaxLength)} |`)}`); + }); + } + if (this.uploader.skippedUploads.length || this.uploader.failedUploads.length) { + const command = `TESTOMATIO= TESTOMATIO_RUN=${this.runId} npx @testomatio/reporter upload-artifacts`; + const numberOfNotUploadedArtifacts = this.uploader.skippedUploads.length + this.uploader.failedUploads.length; + console.log(constants_js_1.APP_PREFIX, `${numberOfNotUploadedArtifacts} artifacts were not uploaded. + Run "${picocolors_1.default.magenta(command)}" with valid S3 credentials to upload skipped & failed artifacts`); } }) .catch(err => console.log(constants_js_1.APP_PREFIX, err)); diff --git a/lib/package.json b/lib/package.json new file mode 100644 index 00000000..c9a44226 --- /dev/null +++ b/lib/package.json @@ -0,0 +1,3 @@ +{ + "type": "commonjs" +} \ No newline at end of file diff --git a/lib/reporter-functions.d.ts b/lib/reporter-functions.d.ts index baebe3f9..1c87f811 100644 --- a/lib/reporter-functions.d.ts +++ b/lib/reporter-functions.d.ts @@ -1,31 +1,34 @@ +declare namespace _default { + export { saveArtifact as artifact }; + export { logMessage as log }; + export { addStep as step }; + export { setKeyValue as keyValue }; +} +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 */ -export function saveArtifact(data: string | { +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 + * @param string */ -export function logMessage(...args: any[]): void; +declare function logMessage(...args: any[]): void; /** * Similar to "log" function but marks message in report as a step - * @param {*} message + * @param {string} message */ -export function addStep(message: any): void; +declare function addStep(message: string): void; /** * Add key-value pair(s) to the test report - * @param {*} keyValue + * @param {{[key: string]: string} | string} keyValue object { key: value } (multiple props allowed) or key (string) + * @param {string?} value */ -export function setKeyValue(keyValue: any): void; -declare namespace _default { - export { saveArtifact as artifact }; - export { logMessage as log }; - export { addStep as step }; - export { setKeyValue as keyValue }; -} -export default _default; +declare function setKeyValue(keyValue: { + [key: string]: string; +} | string, value?: string | null): void; diff --git a/lib/reporter-functions.js b/lib/reporter-functions.js index ec99726a..ecef153c 100644 --- a/lib/reporter-functions.js +++ b/lib/reporter-functions.js @@ -1,43 +1,47 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.saveArtifact = saveArtifact; -exports.logMessage = logMessage; -exports.addStep = addStep; -exports.setKeyValue = setKeyValue; const index_js_1 = require("./services/index.js"); -const playwright_js_1 = require("./adapter/playwright.js"); -(async () => { - if (process.env.PLAYWRIGHT_TEST_BASE_URL) - (0, playwright_js_1.initPlaywrightForStorage)(); -})(); /** * 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 */ function saveArtifact(data, context = null) { + if (process.env.IS_PLAYWRIGHT) + throw new Error(`This function is not available in Playwright framework. + /Playwright supports artifacts out of the box`); if (!data) return; index_js_1.services.artifacts.put(data, context); } /** * Attach log message(s) to the test report - * @param {...any} args + * @param string */ function logMessage(...args) { + if (process.env.IS_PLAYWRIGHT) + throw new Error('This function is not available in Playwright framework'); index_js_1.services.logger._templateLiteralLog(...args); } /** * Similar to "log" function but marks message in report as a step - * @param {*} message + * @param {string} message */ function addStep(message) { + if (process.env.IS_PLAYWRIGHT) + throw new Error('This function is not available in Playwright framework. Use playwright steps'); index_js_1.services.logger.step(message); } /** * Add key-value pair(s) to the test report - * @param {*} keyValue + * @param {{[key: string]: string} | string} keyValue object { key: value } (multiple props allowed) or key (string) + * @param {string?} value */ -function setKeyValue(keyValue) { +function setKeyValue(keyValue, value = null) { + if (process.env.IS_PLAYWRIGHT) + throw new Error('This function is not available in Playwright framework. Use test tag instead.'); + if (typeof keyValue === 'string') { + keyValue = { [keyValue]: value }; + } index_js_1.services.keyValues.put(keyValue); } module.exports = { @@ -46,11 +50,3 @@ module.exports = { step: addStep, keyValue: setKeyValue, }; - -module.exports.saveArtifact = saveArtifact; - -module.exports.logMessage = logMessage; - -module.exports.addStep = addStep; - -module.exports.setKeyValue = setKeyValue; diff --git a/lib/reporter.d.ts b/lib/reporter.d.ts index b696febe..f141323a 100644 --- a/lib/reporter.d.ts +++ b/lib/reporter.d.ts @@ -1,5 +1,88 @@ +export type artifact = typeof import("./reporter-functions.js"); +export const artifact: (data: string | { + path: string; + type: string; + name: string; +}, context?: any) => void; +export type log = typeof import("./reporter-functions.js"); +export const log: (...args: any[]) => void; +export type logger = typeof import("./services/index.js"); +export const logger: { + "__#12@#originalUserLogger": { + assert(condition?: boolean, ...data: any[]): void; + assert(value: any, message?: string, ...optionalParams: any[]): void; + clear(): void; + clear(): void; + count(label?: string): void; + count(label?: string): void; + countReset(label?: string): void; + countReset(label?: string): void; + debug(...data: any[]): void; + debug(message?: any, ...optionalParams: any[]): void; + dir(item?: any, options?: any): void; + dir(obj: any, options?: import("util").InspectOptions): void; + dirxml(...data: any[]): void; + dirxml(...data: any[]): void; + error(...data: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + group(...data: any[]): void; + group(...label: any[]): void; + groupCollapsed(...data: any[]): void; + groupCollapsed(...label: any[]): void; + groupEnd(): void; + groupEnd(): void; + info(...data: any[]): void; + info(message?: any, ...optionalParams: any[]): void; + log(...data: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + table(tabularData?: any, properties?: string[]): void; + table(tabularData: any, properties?: readonly string[]): void; + time(label?: string): void; + time(label?: string): void; + timeEnd(label?: string): void; + timeEnd(label?: string): void; + timeLog(label?: string, ...data: any[]): void; + timeLog(label?: string, ...data: any[]): void; + timeStamp(label?: string): void; + timeStamp(label?: string): void; + trace(...data: any[]): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(...data: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; + Console: console.ConsoleConstructor; + profile(label?: string): void; + profileEnd(label?: string): void; + }; + "__#12@#userLoggerWithOverridenMethods": any; + logLevel: string; + step(strings: any, ...values: any[]): void; + getLogs(context: string): string[]; + "__#12@#stringifyLogs"(...args: any[]): string; + _templateLiteralLog(strings: any, ...args: any[]): void; + "__#12@#logWrapper"(argsArray: any, level: any): void; + assert(...args: any[]): void; + debug(...args: any[]): void; + error(...args: any[]): void; + info(...args: any[]): void; + log(...args: any[]): void; + trace(...args: any[]): void; + warn(...args: any[]): void; + intercept(userLogger: any): void; + stopInterception(): void; + configure(config?: { + logLevel?: string; + prettyObjects?: boolean; + }): void; + prettyObjects: boolean; +}; +export type meta = typeof import("./reporter-functions.js"); +export const meta: (keyValue: { + [key: string]: string; +} | string, value?: string | null) => void; +export type step = typeof import("./reporter-functions.js"); +export const step: (message: string) => void; declare namespace _default { - export let testomatioLogger: { + let testomatioLogger: { "__#12@#originalUserLogger": { assert(condition?: boolean, ...data: any[]): void; assert(value: any, message?: string, ...optionalParams: any[]): void; @@ -67,9 +150,13 @@ declare namespace _default { }): void; prettyObjects: boolean; }; - export let artifact: typeof import("./reporter-functions.js").saveArtifact; - export let log: typeof import("./reporter-functions.js").logMessage; - export let logger: { + let artifact: (data: string | { + path: string; + type: string; + name: string; + }, context?: any) => void; + let log: (...args: any[]) => void; + let logger: { "__#12@#originalUserLogger": { assert(condition?: boolean, ...data: any[]): void; assert(value: any, message?: string, ...optionalParams: any[]): void; @@ -137,83 +224,9 @@ declare namespace _default { }): void; prettyObjects: boolean; }; - export let meta: typeof import("./reporter-functions.js").setKeyValue; - export let step: typeof import("./reporter-functions.js").addStep; - export { TestomatClient }; - export { TRConstants }; + let meta: (keyValue: { + [key: string]: string; + } | string, value?: string | null) => void; + let step: (message: string) => void; } export default _default; -export const artifact: typeof import("./reporter-functions.js").saveArtifact; -export const log: typeof import("./reporter-functions.js").logMessage; -export const logger: { - "__#12@#originalUserLogger": { - assert(condition?: boolean, ...data: any[]): void; - assert(value: any, message?: string, ...optionalParams: any[]): void; - clear(): void; - clear(): void; - count(label?: string): void; - count(label?: string): void; - countReset(label?: string): void; - countReset(label?: string): void; - debug(...data: any[]): void; - debug(message?: any, ...optionalParams: any[]): void; - dir(item?: any, options?: any): void; - dir(obj: any, options?: import("util").InspectOptions): void; - dirxml(...data: any[]): void; - dirxml(...data: any[]): void; - error(...data: any[]): void; - error(message?: any, ...optionalParams: any[]): void; - group(...data: any[]): void; - group(...label: any[]): void; - groupCollapsed(...data: any[]): void; - groupCollapsed(...label: any[]): void; - groupEnd(): void; - groupEnd(): void; - info(...data: any[]): void; - info(message?: any, ...optionalParams: any[]): void; - log(...data: any[]): void; - log(message?: any, ...optionalParams: any[]): void; - table(tabularData?: any, properties?: string[]): void; - table(tabularData: any, properties?: readonly string[]): void; - time(label?: string): void; - time(label?: string): void; - timeEnd(label?: string): void; - timeEnd(label?: string): void; - timeLog(label?: string, ...data: any[]): void; - timeLog(label?: string, ...data: any[]): void; - timeStamp(label?: string): void; - timeStamp(label?: string): void; - trace(...data: any[]): void; - trace(message?: any, ...optionalParams: any[]): void; - warn(...data: any[]): void; - warn(message?: any, ...optionalParams: any[]): void; - Console: console.ConsoleConstructor; - profile(label?: string): void; - profileEnd(label?: string): void; - }; - "__#12@#userLoggerWithOverridenMethods": any; - logLevel: string; - step(strings: any, ...values: any[]): void; - getLogs(context: string): string[]; - "__#12@#stringifyLogs"(...args: any[]): string; - _templateLiteralLog(strings: any, ...args: any[]): void; - "__#12@#logWrapper"(argsArray: any, level: any): void; - assert(...args: any[]): void; - debug(...args: any[]): void; - error(...args: any[]): void; - info(...args: any[]): void; - log(...args: any[]): void; - trace(...args: any[]): void; - warn(...args: any[]): void; - intercept(userLogger: any): void; - stopInterception(): void; - configure(config?: { - logLevel?: string; - prettyObjects?: boolean; - }): void; - prettyObjects: boolean; -}; -export const meta: typeof import("./reporter-functions.js").setKeyValue; -export const step: typeof import("./reporter-functions.js").addStep; -import TestomatClient from './client.js'; -import * as TRConstants from './constants.js'; diff --git a/lib/reporter.js b/lib/reporter.js index 6fa52a69..8fe2ca49 100644 --- a/lib/reporter.js +++ b/lib/reporter.js @@ -1,36 +1,25 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.step = exports.meta = exports.logger = exports.log = exports.artifact = void 0; -const client_js_1 = __importDefault(require("./client.js")); -const TRConstants = __importStar(require("./constants.js")); +// import TestomatClient from './client.js'; +// import * as TRConstants from './constants.js'; const index_js_1 = require("./services/index.js"); const reporter_functions_js_1 = __importDefault(require("./reporter-functions.js")); +exports.artifact = reporter_functions_js_1.default.artifact; +exports.log = reporter_functions_js_1.default.log; +exports.logger = index_js_1.services.logger; +exports.meta = reporter_functions_js_1.default.keyValue; +exports.step = reporter_functions_js_1.default.step; +/** + * @typedef {import('./reporter-functions.js')} artifact + * @typedef {import('./reporter-functions.js')} log + * @typedef {import('./services/index.js')} logger + * @typedef {import('./reporter-functions.js')} meta + * @typedef {import('./reporter-functions.js')} step + */ module.exports = { /** * @deprecated Use `log` or `testomat.log` @@ -41,11 +30,6 @@ module.exports = { logger: index_js_1.services.logger, meta: reporter_functions_js_1.default.keyValue, step: reporter_functions_js_1.default.step, - TestomatClient: client_js_1.default, - TRConstants, + // TestomatClient, + // TRConstants, }; -exports.artifact = reporter_functions_js_1.default.artifact; -exports.log = reporter_functions_js_1.default.log; -exports.logger = index_js_1.services.logger; -exports.meta = reporter_functions_js_1.default.keyValue; -exports.step = reporter_functions_js_1.default.step; diff --git a/lib/services/key-values.d.ts b/lib/services/key-values.d.ts index cc85dee4..1e6ac5d2 100644 --- a/lib/services/key-values.d.ts +++ b/lib/services/key-values.d.ts @@ -8,11 +8,11 @@ declare class KeyValueStorage { static getInstance(): KeyValueStorage; /** * Stores key-value pair and passes it to reporter - * @param {{key: string}} keyValue - key-value pair(s) as object + * @param {{[key: string]: string}} keyValue - key-value pair(s) as object * @param {*} context - full test title */ put(keyValue: { - key: string; + [key: string]: string; }, context?: any): void; /** * Returns key-values pairs for the test as object diff --git a/lib/services/key-values.js b/lib/services/key-values.js index f7a3c4d0..742986cd 100644 --- a/lib/services/key-values.js +++ b/lib/services/key-values.js @@ -21,7 +21,7 @@ class KeyValueStorage { } /** * Stores key-value pair and passes it to reporter - * @param {{key: string}} keyValue - key-value pair(s) as object + * @param {{[key: string]: string}} keyValue - key-value pair(s) as object * @param {*} context - full test title */ put(keyValue, context = null) { diff --git a/lib/xmlReader.d.ts b/lib/xmlReader.d.ts index db06a89e..84ba2d01 100644 --- a/lib/xmlReader.d.ts +++ b/lib/xmlReader.d.ts @@ -7,7 +7,7 @@ declare class XmlReader { title: string; env: string; group_title: string; - detach: boolean; + detach: string; isBatchEnabled: boolean; }; runId: any; diff --git a/lib/xmlReader.js b/lib/xmlReader.js index 5bbdc88e..53790a8d 100644 --- a/lib/xmlReader.js +++ b/lib/xmlReader.js @@ -37,7 +37,7 @@ class XmlReader { title: TESTOMATIO_TITLE, env: TESTOMATIO_ENV, group_title: TESTOMATIO_RUNGROUP_TITLE, - detach: !!TESTOMATIO_MARK_DETACHED, + detach: TESTOMATIO_MARK_DETACHED, // batch uploading is implemented for xml already isBatchEnabled: false, };