@testomatio/reporter 2.3.8-rc.1 → 2.3.8

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.
@@ -217,6 +217,16 @@ export class NUnitXmlParser {
217
217
 
218
218
  const files = [];
219
219
 
220
+ // Extract attachments (NUnit format)
221
+ if (testCase.attachments) {
222
+ const attachments = Array.isArray(testCase.attachments.attachment)
223
+ ? testCase.attachments.attachment
224
+ : [testCase.attachments.attachment];
225
+
226
+ const attachmentFiles = attachments.filter(a => a && a.filePath).map(a => a.filePath);
227
+ files.push(...attachmentFiles);
228
+ }
229
+
220
230
  if (testCase.failure) {
221
231
  message = testCase.failure.message || '';
222
232
  stack = testCase.failure['stack-trace'] || testCase.failure['#text'] || '';
@@ -382,14 +392,14 @@ export class NUnitXmlParser {
382
392
  parameters.push(current.trim());
383
393
  }
384
394
 
385
- // Clean up parameters - remove quotes if they wrap the entire parameter
395
+ // Clean up parameters - remove quotes if they wrap the entire parameter and filter empty ones
386
396
  return parameters.map(param => {
387
397
  param = param.trim();
388
398
  if ((param.startsWith('"') && param.endsWith('"')) || (param.startsWith("'") && param.endsWith("'"))) {
389
399
  return param.slice(1, -1);
390
400
  }
391
401
  return param;
392
- });
402
+ }).filter(p => !!p);
393
403
  }
394
404
 
395
405
  /**
@@ -163,7 +163,7 @@ class TestomatioPipe {
163
163
 
164
164
  /**
165
165
  * Creates a new run on Testomat.io
166
- * @param {{isBatchEnabled?: boolean}} params
166
+ * @param {{isBatchEnabled?: boolean, kind?: string}} params
167
167
  * @returns Promise<void>
168
168
  */
169
169
  async createRun(params = {}) {
@@ -204,6 +204,7 @@ class TestomatioPipe {
204
204
  label: this.label,
205
205
  shared_run: this.sharedRun,
206
206
  shared_run_timeout: this.sharedRunTimeout,
207
+ kind: params.kind,
207
208
  }).filter(([, value]) => !!value),
208
209
  );
209
210
  debug(' >>>>>> Run params', JSON.stringify(runParams, null, 2));
@@ -390,17 +390,6 @@ const fetchSourceCode = (contents, opts = {}) => {
390
390
  break;
391
391
  // Stop at class declaration
392
392
  if (trimmed.includes(' class ') && trimmed.includes('public')) break;
393
- // Stop at helper method calls (like ProcessBooleanValue, AddNumbers) - these are private methods
394
- if (methodStartFound && trimmed.match(/^\s*\/\/\s*Helper methods for testing/)) break;
395
- }
396
- }
397
-
398
- // For C# tests, stop if we encounter helper method calls in the method body
399
- if (opts.lang === 'csharp' && methodStartFound && braceDepth > 0) {
400
- const trimmed = lines[i].trim();
401
- // Stop at comment indicating helper methods section
402
- if (trimmed.match(/^\s*\/\/\s*Helper methods for testing/)) {
403
- break;
404
393
  }
405
394
  }
406
395
 
package/src/xmlReader.js CHANGED
@@ -80,7 +80,7 @@ class XmlReader {
80
80
 
81
81
  // Enhanced NUnit parsing - enabled by default for NUnit XML
82
82
  // Can be disabled via opts.enhancedNunit = false or TESTOMATIO_LEGACY_NUNIT=1
83
- this.enhancedNunit = opts.enhancedNunit !== false && !transformEnvVarToBoolean(TESTOMATIO_LEGACY_NUNIT); // Default true, can be disabled
83
+ this.enhancedNunit = !transformEnvVarToBoolean(TESTOMATIO_LEGACY_NUNIT);
84
84
  this.groupParameterized = opts.groupParameterized !== false; // Default true, can be disabled
85
85
 
86
86
  // @ts-ignore
@@ -274,7 +274,9 @@ class XmlReader {
274
274
  _parseTRXTestDefinition(td) {
275
275
  const title = td.name.replace(/\(.*?\)/, '').trim();
276
276
  const exampleMatch = td.name.match(/\((.*?)\)/);
277
- const example = exampleMatch ? { ...exampleMatch[1].split(',') } : null;
277
+ const example = exampleMatch ? {
278
+ ...exampleMatch[1].split(',').map(p => p.trim()).filter(p => p !== '')
279
+ } : null;
278
280
 
279
281
  const suite = td.TestMethod.className.split(', ')[0].split('.');
280
282
  const suite_title = suite.pop();
@@ -598,7 +600,7 @@ function reduceTestCases(prev, item) {
598
600
 
599
601
  const exampleMatches = testCaseItem.name?.match(/\S\((.*?)\)/);
600
602
  if (exampleMatches) {
601
- example = { ...exampleMatches[1].split(',').map(v => v.trim().replace(/[^\w\s-]/g, '')) };
603
+ example = { ...exampleMatches[1].split(',').map(v => v.trim().replace(/[^\w\s-]/g, '')).filter(v => v !== '') };
602
604
  title = title.replace(/\(.*?\)/, '').trim();
603
605
  }
604
606