@wopee-io/wopee.pw 4.13.0 → 4.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/shared/metadata/versionMetadata.js +2 -2
- package/build/tools/wopee-reporter/helpers/parseNestedSteps.js +2 -0
- package/build/tools/wopee-reporter/helpers/parseNestedSteps.js.map +1 -1
- package/build/tools/wopee-reporter/wopeeReporter.js +2 -0
- package/build/tools/wopee-reporter/wopeeReporter.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.logVersionMetadata = void 0;
|
|
4
4
|
const child_process_1 = require("child_process");
|
|
5
5
|
const logVersionMetadata = () => {
|
|
6
|
-
let version = "4.
|
|
7
|
-
let hash = "
|
|
6
|
+
let version = "4.14.0"
|
|
7
|
+
let hash = "d56ffdd6b138b6839632803a7ca77e193299a158"
|
|
8
8
|
if (version === '__LOCAL__') {
|
|
9
9
|
version = process.env.npm_package_version || '__LOCAL__';
|
|
10
10
|
}
|
|
@@ -13,6 +13,8 @@ function parseNestedSteps(steps) {
|
|
|
13
13
|
error: step.error ? (0, parseError_1.parseError)(step.error) : step.error,
|
|
14
14
|
category: step.category,
|
|
15
15
|
location: step.location,
|
|
16
|
+
duration: step.duration,
|
|
17
|
+
startTime: step.startTime,
|
|
16
18
|
steps: parseNestedSteps(step.steps),
|
|
17
19
|
}));
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseNestedSteps.js","sourceRoot":"","sources":["../../../../lib/tools/wopee-reporter/helpers/parseNestedSteps.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAa1C,SAAgB,gBAAgB,CAAC,KAA0B;IACzD,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,KAAK,CAAC,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AAC,QAAQ;QACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;KACpC,CAAC,CAAC,CAAC;AACN,CAAC;AAhBD,4CAgBC","sourcesContent":["import { parseError } from './parseError';\nimport { TestResult, TestStep } from '@playwright/test/reporter';\n\ntype NestedStepT = {\n number: number;\n title: string;\n status: 'passed' | 'failed';\n error: TestStep['error'];\n category: string;\n location: TestStep['location'];\n steps: NestedStepT[];\n};\n\nexport function parseNestedSteps(steps: TestResult['steps']): NestedStepT[] {\n if (!steps || steps.length === 0) {\n return [];\n }\n\n return steps.map((step: TestStep, index: number) => ({\n number: index + 1,\n title: step.title,\n status: step.error ? 'failed' : 'passed',\n error: step.error ? parseError(step.error) : step.error,\n category: step.category,\n location: step.location,\n duration: step.duration,\n startTime: step.startTime,\n steps: parseNestedSteps(step.steps),\n }));\n}\n"]}
|
|
@@ -55,6 +55,8 @@ class WopeeReporter {
|
|
|
55
55
|
error: step.error ? (0, helpers_1.parseError)(step.error) : step.error,
|
|
56
56
|
category: step.category,
|
|
57
57
|
location: step.location,
|
|
58
|
+
duration: step.duration,
|
|
59
|
+
startTime: step.startTime,
|
|
58
60
|
steps: (0, helpers_1.parseNestedSteps)(step.steps),
|
|
59
61
|
screenshotBase64: step === failedStep ? screenshotBase64 : null,
|
|
60
62
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wopeeReporter.js","sourceRoot":"","sources":["../../../lib/tools/wopee-reporter/wopeeReporter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAAsF;AACtF,mFAG4C;AAE5C,kDAA0B;AAC1B,yBAAuB;AACvB,sDAAyB;AAEzB,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;AAEzE,MAAa,aAAa;IAClB,SAAS,C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;gBACzB,KAAK,EAAE,IAAA,0BAAgB,EAAC,IAAI,CAAC,KAAK,CAAC;gBACnC,gBAAgB,EAAE,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI;aAChE,CAAC,CAAC,CAAC;YAEJ,MAAM,KAAK,GAAG;;;MAGZ,CAAC;YAEH,MAAM,gCAAgC,GAAqC;gBACzE,KAAK,EAAE;oBACL,WAAW,EAAE,kBAAkB;oBAC/B,YAAY,EAAE,iBAAiB;oBAC/B,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,kBAAQ,CAAC;iBACzC;aACF,CAAC;YACF,MAAM,SAAS,GAAG,mEAAsC,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;YAEjG,IAAI,CAAC;gBACH,OAAO,MAAM,eAAK,CAAC,IAAI,CACrB,aAAa,EACb,EAAE,KAAK,EAAE,SAAS,EAAE,EACpB;oBACE,OAAO,EAAE;wBACP,OAAO,EAAE,aAAa;qBACvB;iBACF,CACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC9B,MAAM,MAAM,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,MAAM,CAAC;oBACtC,MAAM,SAAS,GAAG,MAAA,KAAK,CAAC,QAAQ,0CAAE,IAAI,CAAC;oBACvC,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;oBACnD,MAAM,IAAI,KAAK,CAAC,wCAAwC,MAAM,GAAG,CAAC,CAAC;gBACrE,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;QACH,CAAC;KAAA;CACF;AAjFD,sCAiFC","sourcesContent":["import { generateTestRunId, parseError, parseNestedSteps, replacer } from './helpers';\nimport {\n ExtendIntegrationScenarioPayload,\n ExtendIntegrationScenarioPayloadSchema,\n} from './types/wopeeReporter.interface.js';\nimport type { Reporter, TestCase, TestResult } from '@playwright/test/reporter';\nimport axios from 'axios';\nimport 'dotenv/config';\nimport fs from 'node:fs';\n\nconst { WOPEE_API_KEY, WOPEE_API_URL, WOPEE_PROJECT_UUID } = process.env;\n\nexport class WopeeReporter implements Reporter {\n async onTestEnd(test: TestCase, result: TestResult) {\n const testRunId = generateTestRunId();\n\n const wopeeScenarioUuid = result.attachments\n .find((a) => a?.name === 'wopee-scenario-uuid')\n ?.body?.toString('utf-8');\n\n const failedStep = [...result.steps].reverse().find((step) => step.error);\n\n let screenshotBase64: string | null = null;\n for (const attachment of result.attachments) {\n if (attachment.name === 'screenshot' && attachment.contentType === 'image/png') {\n const filePath = attachment.path;\n if (filePath) {\n try {\n const imageBuffer = fs.readFileSync(filePath);\n screenshotBase64 = imageBuffer.toString('base64');\n break;\n } catch (error) {\n console.error('Error reading screenshot:', error);\n }\n }\n }\n }\n\n if (!wopeeScenarioUuid) {\n return console.error(\n '[WOPEE_REPORTER_ERROR]: Scenario UUID is required, please propagate \"testInfo\" as second argument in \"test.beforeEach\" hook and pass it to \"wopee.startScenario(\"scenarioTitle\", testInfo)\" method as second argument if you want to use features of Wopee reporter',\n );\n }\n\n const steps = result.steps.map((step, index) => ({\n testRunId,\n number: index + 1,\n testTitle: test.title,\n title: step.title,\n status: step.error ? 'failed' : 'passed',\n error: step.error ? parseError(step.error) : step.error,\n category: step.category,\n location: step.location,\n duration: step.duration,\n startTime: step.startTime,\n steps: parseNestedSteps(step.steps),\n screenshotBase64: step === failedStep ? screenshotBase64 : null,\n }));\n\n const query = `\n mutation ExtendIntegrationScenario($input: ExtendIntegrationScenarioInput!) {\n extendIntegrationScenario(input: $input)\n }`;\n\n const extendIntegrationScenarioPayload: ExtendIntegrationScenarioPayload = {\n input: {\n projectUuid: WOPEE_PROJECT_UUID,\n scenarioUuid: wopeeScenarioUuid,\n pwSteps: JSON.stringify(steps, replacer),\n },\n };\n const variables = ExtendIntegrationScenarioPayloadSchema.parse(extendIntegrationScenarioPayload);\n\n try {\n return await axios.post(\n WOPEE_API_URL,\n { query, variables },\n {\n headers: {\n api_key: WOPEE_API_KEY,\n },\n },\n );\n } catch (error) {\n if (axios.isAxiosError(error)) {\n const status = error.response?.status;\n const errorData = error.response?.data;\n console.error('[WOPEE_REPORTER_ERROR]', errorData);\n throw new Error(`API request failed with status code: ${status}.`);\n }\n throw new Error('Unexpected error occurred during API call.');\n }\n }\n}\n"]}
|