@dev-blinq/cucumber-js 1.0.10 → 1.0.11

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.
@@ -24,7 +24,7 @@ class BVTFormatter extends _1.default {
24
24
  this.reportGenerator.handleMessage(envelope);
25
25
  if (envelope.testRunFinished) {
26
26
  const report = this.reportGenerator.getReport();
27
- this.log(JSON.stringify(report, null, 2));
27
+ // this.log(JSON.stringify(report, null, 2))
28
28
  await this.uploadRun(report);
29
29
  }
30
30
  });
@@ -47,7 +47,7 @@ class BVTFormatter extends _1.default {
47
47
  const zip = new jszip_1.default();
48
48
  zip.file("report.json", JSON.stringify(report, null, 2));
49
49
  const folder = zip.folder("screenshots");
50
- const files = fs_1.default.readdirSync(reportFolder);
50
+ const files = fs_1.default.readdirSync(path_1.default.join(reportFolder, 'screenshots'));
51
51
  files.forEach((file) => {
52
52
  folder.file(file, fs_1.default.readFileSync(path_1.default.join(reportFolder, file)));
53
53
  });
@@ -1 +1 @@
1
- {"version":3,"file":"bvt_formatter.js","sourceRoot":"","sources":["../../src/formatter/bvt_formatter.ts"],"names":[],"mappings":";;;;;AACA,yCAAgD;AAChD,kFAAwE;AACxE,gDAAuB;AACvB,4CAAmB;AACnB,kDAAyB;AACzB,0DAAiC;AACjC,6DAA2D;AAE3D,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAE;AAC3D,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;AAC9D,IAAG,CAAC,kBAAkB,IAAI,CAAC,oBAAoB,EAAC;IAC5C,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;CAC7E;AAED,MAAqB,YAAa,SAAQ,UAAS;IAGjD,YAAY,OAA0B;QACpC,KAAK,CAAC,OAAO,CAAC,CAAA;QAHR,oBAAe,GAAG,IAAI,0BAAe,EAAE,CAAA;QACvC,kBAAa,GAAI,IAAI,iCAAgB,CAA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AC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,KAAK,CAAC,SAAS,CAAC,YAAwB,EAAE,MAAiB;QACzD,MAAM,GAAG,GAAG,IAAI,eAAK,EAAE,CAAC;QACxB,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,YAAE,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC3C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QACH,MAAM,SAAS,GAAI,MAAM,GAAG,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QACnE,gBAAgB;QAChB,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,YAAY,EAAC,YAAY,CAAC,CAAC;QACrD,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACrC,YAAE,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,YAAY,EAAC,aAAa,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACzF,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA3CD,+BA2CC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport Formatter, { IFormatterOptions } from '.'\nimport ReportGenerator, { JsonReport } from './helpers/report_generator'\nimport path from 'path'\nimport fs from 'fs'\nimport JSZip from 'jszip'\nimport FormData from \"form-data\";\nimport { RunUploadService } from './helpers/upload_serivce'\n\nconst REPORT_SERVICE_URL = process.env.REPORT_SERVICE_URL ;\nconst REPORT_SERVICE_TOKEN = process.env.REPORT_SERVICE_TOKEN;\nif(!REPORT_SERVICE_URL || !REPORT_SERVICE_TOKEN){\n throw new Error(\"REPORT_SERVICE_URL and REPORT_SERVICE_TOKEN must be set\")\n}\n\nexport default class BVTFormatter extends Formatter {\n private reportGenerator = new ReportGenerator()\n private uploadService = new RunUploadService(REPORT_SERVICE_URL, REPORT_SERVICE_TOKEN);\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', async (envelope: messages.Envelope) => {\n this.reportGenerator.handleMessage(envelope)\n if(envelope.testRunFinished){\n const report = this.reportGenerator.getReport();\n this.log(JSON.stringify(report, null, 2))\n await this.uploadRun(report);\n }\n })\n }\n async uploadRun(report:JsonReport){\n const runDoc = await this.uploadService.createRunDocument(\"test\");\n const runDocId = runDoc._id;\n const formData = new FormData();\n const reportFolder = this.reportGenerator.reportFolder;\n if(!fs.existsSync(reportFolder)){\n fs.mkdirSync(reportFolder);\n }\n const zipPath = await this.createZip(reportFolder, report);\n console.log(zipPath);\n formData.append(runDocId, fs.readFileSync(zipPath), \"report.zip\");\n await this.uploadService.upload(formData);\n process.exit(0);\n }\n async createZip(reportFolder:string|null, report:JsonReport){\n const zip = new JSZip();\n zip.file(\"report.json\", JSON.stringify(report, null, 2));\n const folder = zip.folder(\"screenshots\");\n const files = fs.readdirSync(reportFolder);\n files.forEach((file) => {\n folder.file(file, fs.readFileSync(path.join(reportFolder, file)));\n });\n const zipBuffer = await zip.generateAsync({ type: \"nodebuffer\" });\n // save zip file\n const zipPath = path.join(reportFolder,'report.zip');\n fs.writeFileSync(zipPath, zipBuffer);\n fs.writeFileSync(path.join(reportFolder,'report.json'), JSON.stringify(report, null, 2));\n return zipPath\n }\n}"]}
1
+ {"version":3,"file":"bvt_formatter.js","sourceRoot":"","sources":["../../src/formatter/bvt_formatter.ts"],"names":[],"mappings":";;;;;AACA,yC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,CAAC;QACrD,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QACrC,YAAE,CAAC,aAAa,CAAC,cAAI,CAAC,IAAI,CAAC,YAAY,EAAC,aAAa,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACzF,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA3CD,+BA2CC","sourcesContent":["import * as messages from '@cucumber/messages'\nimport Formatter, { IFormatterOptions } from '.'\nimport ReportGenerator, { JsonReport } from './helpers/report_generator'\nimport path from 'path'\nimport fs from 'fs'\nimport JSZip from 'jszip'\nimport FormData from \"form-data\";\nimport { RunUploadService } from './helpers/upload_serivce'\n\nconst REPORT_SERVICE_URL = process.env.REPORT_SERVICE_URL ;\nconst REPORT_SERVICE_TOKEN = process.env.REPORT_SERVICE_TOKEN;\nif(!REPORT_SERVICE_URL || !REPORT_SERVICE_TOKEN){\n throw new Error(\"REPORT_SERVICE_URL and REPORT_SERVICE_TOKEN must be set\")\n}\n\nexport default class BVTFormatter extends Formatter {\n private reportGenerator = new ReportGenerator()\n private uploadService = new RunUploadService(REPORT_SERVICE_URL, REPORT_SERVICE_TOKEN);\n constructor(options: IFormatterOptions) {\n super(options)\n options.eventBroadcaster.on('envelope', async (envelope: messages.Envelope) => {\n this.reportGenerator.handleMessage(envelope)\n if(envelope.testRunFinished){\n const report = this.reportGenerator.getReport();\n // this.log(JSON.stringify(report, null, 2))\n await this.uploadRun(report);\n }\n })\n }\n async uploadRun(report:JsonReport){\n const runDoc = await this.uploadService.createRunDocument(\"test\");\n const runDocId = runDoc._id;\n const formData = new FormData();\n const reportFolder = this.reportGenerator.reportFolder;\n if(!fs.existsSync(reportFolder)){\n fs.mkdirSync(reportFolder);\n }\n const zipPath = await this.createZip(reportFolder, report);\n console.log(zipPath);\n formData.append(runDocId, fs.readFileSync(zipPath), \"report.zip\");\n await this.uploadService.upload(formData);\n process.exit(0);\n }\n async createZip(reportFolder:string|null, report:JsonReport){\n const zip = new JSZip();\n zip.file(\"report.json\", JSON.stringify(report, null, 2));\n const folder = zip.folder(\"screenshots\");\n const files = fs.readdirSync(path.join(reportFolder, 'screenshots'));\n files.forEach((file) => {\n folder.file(file, fs.readFileSync(path.join(reportFolder, file)));\n });\n const zipBuffer = await zip.generateAsync({ type: \"nodebuffer\" });\n // save zip file\n const zipPath = path.join(reportFolder,'report.zip');\n fs.writeFileSync(zipPath, zipBuffer);\n fs.writeFileSync(path.join(reportFolder,'report.json'), JSON.stringify(report, null, 2));\n return zipPath\n }\n}"]}
@@ -41,7 +41,7 @@ type JsonCommand = {
41
41
  type: string;
42
42
  value?: string;
43
43
  text: string;
44
- screenshotPath?: string;
44
+ screenshotId?: string;
45
45
  result: JsonCommandResult;
46
46
  };
47
47
  type JsonStep = {
@@ -180,9 +180,6 @@ class ReportGenerator {
180
180
  const stepProgess = this.stepProgressMap.get(testStep.pickleStepId);
181
181
  if (mediaType === 'application/json') {
182
182
  const command = JSON.parse(body);
183
- command.screenshotPath = command.screenshotPath
184
- .replaceAll('\\', '/')
185
- .replace(this.reportFolder, '');
186
183
  stepProgess.commands.push(command);
187
184
  }
188
185
  }
@@ -1 +1 @@
1
- {"version":3,"file":"report_generator.js","sourceRoot":"","sources":["../../../src/formatter/helpers/report_generator.ts"],"names":[],"mappings":";;AAsFA,MAAqB,eAAe;IAApC;QACU,WAAM,GAAe;YAC3B,MAAM,EAAE;gBACN,MAAM,EAAE,SAAS;aAClB;YACD,SAAS,EAAE,EAAwB;SACpC,CAAA;QACO,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAA;QAChE,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAA;QAC9C,gBAAW,GAAG,IAAI,GAAG,EAA6B,CAAA;QAClD,gBAAW,GAAG,IAAI,GAAG,EAA6B,CAAA;QAClD,oBAAe,GAAG,IAAI,GAAG,EAAoB,CAAA;QAC7C,oBAAe,GAAG,IAAI,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AAC,MAAM,EAAE;qBAC/C,CAAA;aACb;SACF;QACD,OAAO;YACL,MAAM,EAAE,QAAQ;SACR,CAAA;IACZ,CAAC;IACO,kBAAkB,CAAC,gBAA2C;QACpE,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAA;QACzD,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAChE,MAAM,UAAU,GAAG,YAAY,CAAC,MAG/B,CAAA;QACD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;QAC5C,YAAY,CAAC,MAAM,GAAG;YACpB,GAAG,MAAM;YACT,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;SACtC,CAAA;IACH,CAAC;IACO,iBAAiB,CAAC,eAAyC;QACjE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,eAAe,CAAA;QAClE,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,MAG9B,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG;YACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;YACrC,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;YACrC,OAAO;YACP,aAAa;SACd,CAAA;IACH,CAAC;CACF;AA1QD,kCA0QC","sourcesContent":["import * as messages from '@cucumber/messages'\n\n// type JsonException = messages.Exception\ntype JsonTimestamp = number //messages.Timestamp\ntype JsonStepType = 'Unknown' | 'Context' | 'Action' | 'Outcome'\n\ntype JsonResultUnknown = {\n status: 'UNKNOWN'\n}\ntype JsonResultSkipped = {\n status: 'SKIPPED'\n}\ntype JsonResultUndefined = {\n status: 'UNDEFINED'\n}\ntype JsonResultAmbiguous = {\n status: 'AMBIGUOUS'\n}\ntype JsonResultStarted = {\n status: 'STARTED'\n startTime: JsonTimestamp\n}\ntype JsonResultPending = {\n status: 'PENDING'\n startTime: JsonTimestamp\n endTime: JsonTimestamp\n}\ntype JsonResultPassed = {\n status: 'PASSED'\n startTime: JsonTimestamp\n endTime: JsonTimestamp\n}\ntype JsonResultFailed = {\n status: 'FAILED'\n startTime: JsonTimestamp\n endTime: JsonTimestamp\n message?: string\n // exception?: JsonException\n}\n\ntype JsonCommandResult = JsonResultPassed | JsonResultFailed\ntype JsonStepResult =\n | JsonResultUnknown\n | JsonResultSkipped\n | JsonResultUndefined\n | JsonResultAmbiguous\n | JsonResultStarted\n | JsonResultPending\n | JsonResultPassed\n | JsonResultFailed\ntype JsonTestResult =\n | JsonResultUnknown\n | JsonResultStarted\n | JsonResultPassed\n | JsonResultFailed\ntype JsonReportResult = JsonTestResult\n\ntype JsonCommand = {\n type: string\n value?: string\n text: string\n screenshotPath?: string\n result: JsonCommandResult\n}\ntype JsonStep = {\n type: JsonStepType\n text: string\n commands: JsonCommand[]\n result: JsonStepResult\n}\n\ntype JsonTestProgress = {\n id: string\n featureName: string\n uri: string\n scenarioName: string\n parameters: Record<string, string>\n steps: JsonStep[]\n result: JsonTestResult\n}\n\nexport type JsonReport = {\n testCases: JsonTestProgress[]\n result: JsonReportResult\n}\n\nexport default class ReportGenerator {\n private report: JsonReport = {\n result: {\n status: 'UNKNOWN',\n },\n testCases: [] as JsonTestProgress[],\n }\n private gherkinDocumentMap = new Map<string, messages.GherkinDocument>()\n private pickleMap = new Map<string, messages.Pickle>()\n private testCaseMap = new Map<string, messages.TestCase>()\n private testStepMap = new Map<string, messages.TestStep>()\n private stepProgressMap = new Map<string, JsonStep>()\n private testProgressMap = new Map<string, JsonTestProgress>()\n\n reportFolder:null|string = null\n\n handleMessage(envelope: messages.Envelope) {\n const type = Object.keys(envelope)[0] as keyof messages.Envelope\n switch (type) {\n // case \"meta\": { break}\n // case \"source\": { break}\n case 'parseError': {\n const parseError = envelope[type]\n this.handleParseError(parseError)\n break\n }\n case 'gherkinDocument': {\n const doc = envelope[type]\n this.onGherkinDocument(doc)\n break\n }\n case 'pickle': {\n const pickle = envelope[type]\n this.onPickle(pickle)\n break\n }\n // case \"stepDefinition\": { break}\n // case \"hook\": { break} // Before Hook\n case 'testRunStarted': {\n const testRunStarted = envelope[type]\n this.onTestRunStarted(testRunStarted)\n break\n }\n case 'testCase': {\n const testCase = envelope[type]\n this.onTestCase(testCase)\n break\n }\n case 'testCaseStarted': {\n const testCaseStarted = envelope[type]\n this.onTestCaseStarted(testCaseStarted)\n break\n }\n case 'testStepStarted': {\n const testStepStarted = envelope[type]\n this.onTestStepStarted(testStepStarted)\n break\n }\n case 'attachment': {\n const attachment = envelope[type]\n this.onAttachment(attachment)\n break\n }\n case 'testStepFinished': {\n const testStepFinished = envelope[type]\n this.onTestStepFinished(testStepFinished)\n break\n }\n case 'testCaseFinished': {\n const testCaseFinished = envelope[type]\n this.onTestCaseFinished(testCaseFinished)\n break\n }\n // case \"hook\": { break} // After Hook\n case 'testRunFinished': {\n const testRunFinished = envelope[type]\n this.onTestRunFinished(testRunFinished)\n break\n }\n // case \"parameterType\" : { break}\n // case \"undefinedParameterType\": { break}\n }\n }\n getReport() {\n return this.report\n }\n private handleParseError(parseError: messages.ParseError) {\n const { message, source } = parseError\n const timestamp = new Date().getTime()\n this.report.result = {\n status: 'FAILED',\n startTime: timestamp,\n endTime: timestamp,\n message: message,\n }\n }\n private onGherkinDocument(doc: messages.GherkinDocument) {\n this.gherkinDocumentMap.set(doc.uri, doc)\n }\n private onPickle(pickle: messages.Pickle) {\n this.pickleMap.set(pickle.id, pickle)\n }\n private getTimeStamp(timestamp: messages.Timestamp) {\n return timestamp.seconds * 1000 + timestamp.nanos / 1000000\n }\n private onTestRunStarted(testRunStarted: messages.TestRunStarted) {\n this.report.result = {\n status: 'STARTED',\n startTime: this.getTimeStamp(testRunStarted.timestamp),\n }\n }\n private onTestCase(testCase: messages.TestCase) {\n this.testCaseMap.set(testCase.id, testCase)\n testCase.testSteps.forEach((testStep) => {\n this.testStepMap.set(testStep.id, testStep)\n })\n }\n private onTestCaseStarted(testCaseStarted: messages.TestCaseStarted) {\n const { testCaseId, id, timestamp } = testCaseStarted\n const testCase = this.testCaseMap.get(testCaseId)\n if (testCase === undefined)\n throw new Error(`testCase with id ${testCaseId} not found`)\n const pickle = this.pickleMap.get(testCase.pickleId)\n if (pickle === undefined)\n throw new Error(`pickle with id ${testCase.pickleId} not found`)\n\n const doc = this.gherkinDocumentMap.get(pickle.uri)\n if (doc === undefined)\n throw new Error(`gherkinDocument with uri ${pickle.uri} not found`)\n const featureName = doc.feature.name\n\n const scenarioName = pickle.name\n\n const steps: JsonStep[] = pickle.steps.map((step) => {\n this.stepProgressMap.set(step.id, {\n type: step.type,\n text: step.text,\n commands: [],\n result: {\n status: 'UNKNOWN',\n },\n })\n return this.stepProgressMap.get(step.id)\n })\n this.testProgressMap.set(id, {\n id,\n uri: pickle.uri,\n featureName,\n scenarioName,\n // TODO: compute parameters\n parameters: {},\n steps,\n result: {\n status: 'STARTED',\n startTime: this.getTimeStamp(timestamp),\n },\n })\n this.report.testCases.push(this.testProgressMap.get(id))\n }\n private onTestStepStarted(testStepStarted: messages.TestStepStarted) {\n const { testStepId, timestamp, testCaseStartedId } = testStepStarted\n const testStep = this.testStepMap.get(testStepId)\n if (testStep === undefined)\n throw new Error(`testStep with id ${testStepId} not found`)\n if (testStep.pickleStepId === undefined) return\n const stepProgess = this.stepProgressMap.get(testStep.pickleStepId)\n stepProgess.result = {\n status: 'STARTED',\n startTime: this.getTimeStamp(timestamp),\n }\n }\n private onAttachment(attachment: messages.Attachment) {\n const {\n testCaseStartedId,\n testStepId,\n body,\n mediaType,\n contentEncoding,\n fileName,\n source,\n url,\n } = attachment\n if (mediaType === 'text/plain') {\n this.reportFolder = body.replaceAll('\\\\', '/')\n }\n const testStep = this.testStepMap.get(testStepId)\n if (testStep.pickleStepId === undefined) return\n\n const stepProgess = this.stepProgressMap.get(testStep.pickleStepId)\n if (mediaType === 'application/json') {\n const command = JSON.parse(body)\n command.screenshotPath = command.screenshotPath\n .replaceAll('\\\\', '/')\n .replace(this.reportFolder, '')\n stepProgess.commands.push(command)\n }\n }\n private onTestStepFinished(testStepFinished: messages.TestStepFinished) {\n const { testStepId, testCaseStartedId, testStepResult, timestamp } =\n testStepFinished\n const testStep = this.testStepMap.get(testStepId)\n if (testStep.pickleStepId === undefined) return\n const stepProgess = this.stepProgressMap.get(testStep.pickleStepId)\n const prevStepResult = stepProgess.result as {\n status: 'STARTED'\n startTime: JsonTimestamp\n }\n stepProgess.result = {\n status: testStepResult.status,\n startTime: prevStepResult.startTime,\n endTime: this.getTimeStamp(timestamp),\n message: testStepResult.message,\n // exception: testStepResult.exception,\n }\n }\n private getTestCaseResult(steps: JsonStep[]) {\n for (const step of steps) {\n switch (step.result.status) {\n case 'FAILED':\n return {\n status: step.result.status,\n message: step.result.message,\n // exception: step.result.exception,\n } as const\n case 'AMBIGUOUS':\n case 'UNDEFINED':\n case 'PENDING':\n return {\n status: 'FAILED',\n message: `step \"${step.text}\" is ${step.result.status}`,\n } as const\n }\n }\n return {\n status: 'PASSED',\n } as const\n }\n private onTestCaseFinished(testCaseFinished: messages.TestCaseFinished) {\n const { testCaseStartedId, timestamp } = testCaseFinished\n const testProgress = this.testProgressMap.get(testCaseStartedId)\n const prevResult = testProgress.result as {\n status: 'STARTED'\n startTime: JsonTimestamp\n }\n const steps = Object.values(testProgress.steps)\n const result = this.getTestCaseResult(steps)\n testProgress.result = {\n ...result,\n startTime: prevResult.startTime,\n endTime: this.getTimeStamp(timestamp),\n }\n }\n private onTestRunFinished(testRunFinished: messages.TestRunFinished) {\n const { timestamp, success, exception, message } = testRunFinished\n const prevResult = this.report.result as {\n status: 'STARTED'\n startTime: JsonTimestamp\n }\n this.report.result = {\n status: success ? 'PASSED' : 'FAILED',\n startTime: prevResult.startTime,\n endTime: this.getTimeStamp(timestamp),\n message,\n // exception,\n }\n }\n}\n"]}
1
+ {"version":3,"file":"report_generator.js","sourceRoot":"","sources":["../../../src/formatter/helpers/report_generator.ts"],"names":[],"mappings":";;AAsFA,MAAqB,eAAe;IAApC;QACU,WAAM,GAAe;YAC3B,MAAM,EAAE;gBACN,MAAM,EAAE,SAAS;aAClB;YACD,SAAS,EAAE,EAAwB;SACpC,CAAA;QACO,uBAAkB,GAAG,IAAI,GAAG,EAAoC,CAAA;QAChE,cAAS,GAAG,IAAI,GAAG,EAA2B,CAAA;QAC9C,gBAAW,GAAG,IAAI,GAAG,EAA6B,CAAA;QAClD,gBAAW,GAAG,IAAI,GAAG,EAA6B,CAAA;QAClD,oBAAe,GAAG,IAAI,GAAG,EAAoB,CAAA;QAC7C,oBAAe,GAAG,IAAI,GAAG,EAA4B,CAAA;QAE7D,iBAAY,GAAe,IAAI,CAAA;IAyPjC,CAAC;IAvPC,aAAa,CAAC,QAA2B;QACvC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAA4B,CAAA;QAChE,QAAQ,IAAI,EAAE;YACZ,wBAAwB;YACxB,0BAA0B;YAC1B,KAAK,YAAY,CAAC,CAAC;gBACjB,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;gBACjC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAA;gBACjC,MAAK;aACN;YACD,KAAK,iBAAiB,CAAC,CAAC;gBACtB,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;gBAC1B,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;gBAC3B,MAAK;aACN;YACD,KAAK,QAAQ,CAAC,CAAC;gBACb,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,CA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AC,MAG9B,CAAA;QACD,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG;YACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ;YACrC,SAAS,EAAE,UAAU,CAAC,SAAS;YAC/B,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;YACrC,OAAO;YACP,aAAa;SACd,CAAA;IACH,CAAC;CACF;AAvQD,kCAuQC","sourcesContent":["import * as messages from '@cucumber/messages'\n\n// type JsonException = messages.Exception\ntype JsonTimestamp = number //messages.Timestamp\ntype JsonStepType = 'Unknown' | 'Context' | 'Action' | 'Outcome'\n\ntype JsonResultUnknown = {\n status: 'UNKNOWN'\n}\ntype JsonResultSkipped = {\n status: 'SKIPPED'\n}\ntype JsonResultUndefined = {\n status: 'UNDEFINED'\n}\ntype JsonResultAmbiguous = {\n status: 'AMBIGUOUS'\n}\ntype JsonResultStarted = {\n status: 'STARTED'\n startTime: JsonTimestamp\n}\ntype JsonResultPending = {\n status: 'PENDING'\n startTime: JsonTimestamp\n endTime: JsonTimestamp\n}\ntype JsonResultPassed = {\n status: 'PASSED'\n startTime: JsonTimestamp\n endTime: JsonTimestamp\n}\ntype JsonResultFailed = {\n status: 'FAILED'\n startTime: JsonTimestamp\n endTime: JsonTimestamp\n message?: string\n // exception?: JsonException\n}\n\ntype JsonCommandResult = JsonResultPassed | JsonResultFailed\ntype JsonStepResult =\n | JsonResultUnknown\n | JsonResultSkipped\n | JsonResultUndefined\n | JsonResultAmbiguous\n | JsonResultStarted\n | JsonResultPending\n | JsonResultPassed\n | JsonResultFailed\ntype JsonTestResult =\n | JsonResultUnknown\n | JsonResultStarted\n | JsonResultPassed\n | JsonResultFailed\ntype JsonReportResult = JsonTestResult\n\ntype JsonCommand = {\n type: string\n value?: string\n text: string\n screenshotId?: string\n result: JsonCommandResult\n}\ntype JsonStep = {\n type: JsonStepType\n text: string\n commands: JsonCommand[]\n result: JsonStepResult\n}\n\ntype JsonTestProgress = {\n id: string\n featureName: string\n uri: string\n scenarioName: string\n parameters: Record<string, string>\n steps: JsonStep[]\n result: JsonTestResult\n}\n\nexport type JsonReport = {\n testCases: JsonTestProgress[]\n result: JsonReportResult\n}\n\nexport default class ReportGenerator {\n private report: JsonReport = {\n result: {\n status: 'UNKNOWN',\n },\n testCases: [] as JsonTestProgress[],\n }\n private gherkinDocumentMap = new Map<string, messages.GherkinDocument>()\n private pickleMap = new Map<string, messages.Pickle>()\n private testCaseMap = new Map<string, messages.TestCase>()\n private testStepMap = new Map<string, messages.TestStep>()\n private stepProgressMap = new Map<string, JsonStep>()\n private testProgressMap = new Map<string, JsonTestProgress>()\n\n reportFolder:null|string = null\n\n handleMessage(envelope: messages.Envelope) {\n const type = Object.keys(envelope)[0] as keyof messages.Envelope\n switch (type) {\n // case \"meta\": { break}\n // case \"source\": { break}\n case 'parseError': {\n const parseError = envelope[type]\n this.handleParseError(parseError)\n break\n }\n case 'gherkinDocument': {\n const doc = envelope[type]\n this.onGherkinDocument(doc)\n break\n }\n case 'pickle': {\n const pickle = envelope[type]\n this.onPickle(pickle)\n break\n }\n // case \"stepDefinition\": { break}\n // case \"hook\": { break} // Before Hook\n case 'testRunStarted': {\n const testRunStarted = envelope[type]\n this.onTestRunStarted(testRunStarted)\n break\n }\n case 'testCase': {\n const testCase = envelope[type]\n this.onTestCase(testCase)\n break\n }\n case 'testCaseStarted': {\n const testCaseStarted = envelope[type]\n this.onTestCaseStarted(testCaseStarted)\n break\n }\n case 'testStepStarted': {\n const testStepStarted = envelope[type]\n this.onTestStepStarted(testStepStarted)\n break\n }\n case 'attachment': {\n const attachment = envelope[type]\n this.onAttachment(attachment)\n break\n }\n case 'testStepFinished': {\n const testStepFinished = envelope[type]\n this.onTestStepFinished(testStepFinished)\n break\n }\n case 'testCaseFinished': {\n const testCaseFinished = envelope[type]\n this.onTestCaseFinished(testCaseFinished)\n break\n }\n // case \"hook\": { break} // After Hook\n case 'testRunFinished': {\n const testRunFinished = envelope[type]\n this.onTestRunFinished(testRunFinished)\n break\n }\n // case \"parameterType\" : { break}\n // case \"undefinedParameterType\": { break}\n }\n }\n getReport() {\n return this.report\n }\n private handleParseError(parseError: messages.ParseError) {\n const { message, source } = parseError\n const timestamp = new Date().getTime()\n this.report.result = {\n status: 'FAILED',\n startTime: timestamp,\n endTime: timestamp,\n message: message,\n }\n }\n private onGherkinDocument(doc: messages.GherkinDocument) {\n this.gherkinDocumentMap.set(doc.uri, doc)\n }\n private onPickle(pickle: messages.Pickle) {\n this.pickleMap.set(pickle.id, pickle)\n }\n private getTimeStamp(timestamp: messages.Timestamp) {\n return timestamp.seconds * 1000 + timestamp.nanos / 1000000\n }\n private onTestRunStarted(testRunStarted: messages.TestRunStarted) {\n this.report.result = {\n status: 'STARTED',\n startTime: this.getTimeStamp(testRunStarted.timestamp),\n }\n }\n private onTestCase(testCase: messages.TestCase) {\n this.testCaseMap.set(testCase.id, testCase)\n testCase.testSteps.forEach((testStep) => {\n this.testStepMap.set(testStep.id, testStep)\n })\n }\n private onTestCaseStarted(testCaseStarted: messages.TestCaseStarted) {\n const { testCaseId, id, timestamp } = testCaseStarted\n const testCase = this.testCaseMap.get(testCaseId)\n if (testCase === undefined)\n throw new Error(`testCase with id ${testCaseId} not found`)\n const pickle = this.pickleMap.get(testCase.pickleId)\n if (pickle === undefined)\n throw new Error(`pickle with id ${testCase.pickleId} not found`)\n\n const doc = this.gherkinDocumentMap.get(pickle.uri)\n if (doc === undefined)\n throw new Error(`gherkinDocument with uri ${pickle.uri} not found`)\n const featureName = doc.feature.name\n\n const scenarioName = pickle.name\n\n const steps: JsonStep[] = pickle.steps.map((step) => {\n this.stepProgressMap.set(step.id, {\n type: step.type,\n text: step.text,\n commands: [],\n result: {\n status: 'UNKNOWN',\n },\n })\n return this.stepProgressMap.get(step.id)\n })\n this.testProgressMap.set(id, {\n id,\n uri: pickle.uri,\n featureName,\n scenarioName,\n // TODO: compute parameters\n parameters: {},\n steps,\n result: {\n status: 'STARTED',\n startTime: this.getTimeStamp(timestamp),\n },\n })\n this.report.testCases.push(this.testProgressMap.get(id))\n }\n private onTestStepStarted(testStepStarted: messages.TestStepStarted) {\n const { testStepId, timestamp, testCaseStartedId } = testStepStarted\n const testStep = this.testStepMap.get(testStepId)\n if (testStep === undefined)\n throw new Error(`testStep with id ${testStepId} not found`)\n if (testStep.pickleStepId === undefined) return\n const stepProgess = this.stepProgressMap.get(testStep.pickleStepId)\n stepProgess.result = {\n status: 'STARTED',\n startTime: this.getTimeStamp(timestamp),\n }\n }\n private onAttachment(attachment: messages.Attachment) {\n const {\n testCaseStartedId,\n testStepId,\n body,\n mediaType,\n contentEncoding,\n fileName,\n source,\n url,\n } = attachment\n if (mediaType === 'text/plain') {\n this.reportFolder = body.replaceAll('\\\\', '/')\n }\n const testStep = this.testStepMap.get(testStepId)\n if (testStep.pickleStepId === undefined) return\n\n const stepProgess = this.stepProgressMap.get(testStep.pickleStepId)\n if (mediaType === 'application/json') {\n const command:JsonCommand = JSON.parse(body)\n stepProgess.commands.push(command)\n }\n }\n private onTestStepFinished(testStepFinished: messages.TestStepFinished) {\n const { testStepId, testCaseStartedId, testStepResult, timestamp } =\n testStepFinished\n const testStep = this.testStepMap.get(testStepId)\n if (testStep.pickleStepId === undefined) return\n const stepProgess = this.stepProgressMap.get(testStep.pickleStepId)\n const prevStepResult = stepProgess.result as {\n status: 'STARTED'\n startTime: JsonTimestamp\n }\n stepProgess.result = {\n status: testStepResult.status,\n startTime: prevStepResult.startTime,\n endTime: this.getTimeStamp(timestamp),\n message: testStepResult.message,\n // exception: testStepResult.exception,\n }\n }\n private getTestCaseResult(steps: JsonStep[]) {\n for (const step of steps) {\n switch (step.result.status) {\n case 'FAILED':\n return {\n status: step.result.status,\n message: step.result.message,\n // exception: step.result.exception,\n } as const\n case 'AMBIGUOUS':\n case 'UNDEFINED':\n case 'PENDING':\n return {\n status: 'FAILED',\n message: `step \"${step.text}\" is ${step.result.status}`,\n } as const\n }\n }\n return {\n status: 'PASSED',\n } as const\n }\n private onTestCaseFinished(testCaseFinished: messages.TestCaseFinished) {\n const { testCaseStartedId, timestamp } = testCaseFinished\n const testProgress = this.testProgressMap.get(testCaseStartedId)\n const prevResult = testProgress.result as {\n status: 'STARTED'\n startTime: JsonTimestamp\n }\n const steps = Object.values(testProgress.steps)\n const result = this.getTestCaseResult(steps)\n testProgress.result = {\n ...result,\n startTime: prevResult.startTime,\n endTime: this.getTimeStamp(timestamp),\n }\n }\n private onTestRunFinished(testRunFinished: messages.TestRunFinished) {\n const { timestamp, success, exception, message } = testRunFinished\n const prevResult = this.report.result as {\n status: 'STARTED'\n startTime: JsonTimestamp\n }\n this.report.result = {\n status: success ? 'PASSED' : 'FAILED',\n startTime: prevResult.startTime,\n endTime: this.getTimeStamp(timestamp),\n message,\n // exception,\n }\n }\n}\n"]}
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "1.0.10";
1
+ export declare const version = "1.0.11";
package/lib/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = '1.0.10';
5
+ exports.version = '1.0.11';
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '1.0.10'\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AACd,QAAA,OAAO,GAAG,QAAQ,CAAA","sourcesContent":["// Generated by genversion.\nexport const version = '1.0.11'\n"]}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "gherkin",
9
9
  "tests"
10
10
  ],
11
- "version": "1.0.10",
11
+ "version": "1.0.11",
12
12
  "homepage": "https://github.com/blinq-io/cucumber-js",
13
13
  "author": "blinq.io",
14
14
  "contributors": [