@testomatio/reporter 0.6.8-beta.1 → 0.6.9

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/Changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 0.6.9
2
+
3
+ * Fixed pending tests reports for Cypress
4
+
5
+ # 0.6.8
6
+ # 0.6.7
7
+
8
+ * Pytest: fixed creating suites from reports
9
+
1
10
  # 0.6.6
2
11
 
3
12
  * JUnit reporter: prefer suite title over testcase classname in a report
@@ -55,7 +55,12 @@ const testomatioReporter = on => {
55
55
 
56
56
  const files = [...videos, ...screenshots];
57
57
 
58
- const state = test.state === 'passed' ? TRConstants.PASSED : TRConstants.FAILED;
58
+ switch (test.state) {
59
+ case 'passed': state = TRConstants.PASSED; break;
60
+ case 'failed': state = TRConstants.FAILED; break;
61
+ case 'skipped':
62
+ case 'pending': state = TRConstants.SKIPPED;
63
+ }
59
64
 
60
65
  addSpecTestsPromises.push(client.addTestRun(testId, state, {
61
66
  title, time, example, error, files, suite_title: suiteTitle, suite_id: suiteId
@@ -5,7 +5,8 @@ const Adapter = require('./adapter');
5
5
  class PythonAdapter extends Adapter {
6
6
 
7
7
  getFilePath(t) {
8
- const fileName = namespaceToFileName(t.suite_title)
8
+ let fileName = namespaceToFileName(t.suite_title, { checkFile: true });
9
+ if (!fileName) fileName = namespaceToFileName(t.suite_title, { checkFile: false });
9
10
  return fileName;
10
11
  }
11
12
 
@@ -26,11 +27,12 @@ class PythonAdapter extends Adapter {
26
27
 
27
28
  }
28
29
 
29
- function namespaceToFileName(fileName) {
30
+ function namespaceToFileName(fileName, opts = {}) {
30
31
  const fileParts = fileName.split('.')
31
32
 
32
33
  while (fileParts.length > 0) {
33
34
  const file = `${fileParts.join(path.sep) }.py`;
35
+ if (!opts.checkFile) return file;
34
36
  if (fs.existsSync(`${fileParts.join(path.sep) }.py`)) {
35
37
  return file;
36
38
  }
package/lib/xmlReader.js CHANGED
@@ -310,10 +310,7 @@ function reduceTestCases(prev, item) {
310
310
  testCases = [testCases]
311
311
  }
312
312
  testCases.filter(t => !!t).forEach(testCaseItem => {
313
- let file = testCaseItem.file || item.filepath || '';
314
- if (!file && testCaseItem.classname) {
315
- file = testCaseItem.classname.replace(/\./g, '/');
316
- }
313
+ const file = testCaseItem.file || item.filepath || '';
317
314
 
318
315
  let stack = '';
319
316
  let message = '';
@@ -338,7 +335,7 @@ function reduceTestCases(prev, item) {
338
335
  run_time: testCaseItem.time,
339
336
  status: (testCaseItem.failure || testCaseItem.error) ? 'failed' : 'passed',
340
337
  title: testCaseItem.name,
341
- suite_title: reduceOptions.preferClassname ? testCaseItem.classname : item.name || testCaseItem.classname,
338
+ suite_title: reduceOptions.preferClassname ? testCaseItem.classname : (item.name || testCaseItem.classname),
342
339
  })
343
340
  });
344
341
  return prev;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testomatio/reporter",
3
- "version": "0.6.8-beta.1",
3
+ "version": "0.6.9",
4
4
  "description": "Testomatio Reporter Client",
5
5
  "main": "./lib/reporter.js",
6
6
  "repository": "git@github.com:testomatio/reporter.git",