@wdio/allure-reporter
Advanced tools
Comparing version 5.11.7 to 5.11.14
@@ -11,8 +11,3 @@ "use strict"; | ||
} | ||
/** | ||
* An error that encapsulates more than one error, to support soft-assertions from Jasmine | ||
* even though Allure's API assumes one error-per test | ||
*/ | ||
class CompoundError extends Error { | ||
@@ -19,0 +14,0 @@ constructor(...innerErrors) { |
@@ -63,7 +63,5 @@ "use strict"; | ||
if (suite.type === 'feature') { | ||
// handle cucumber features as allure "suite" | ||
return this.allure.startSuite(suite.title); | ||
} // handle cucumber scenarii as allure "case" instead of "suite" | ||
} | ||
this.allure.startCase(suite.title); | ||
@@ -83,4 +81,2 @@ return this.setCaseParameters(suite.cid); | ||
if (isPassed) { | ||
// Only close passing tests because | ||
// non passing tests are closed in onTestFailed event | ||
return this.allure.endCase(_constants.testStatuses.PASSED); | ||
@@ -119,5 +115,4 @@ } | ||
currentTest.addParameter('argument', 'isMultiremote', 'true'); | ||
} // Allure analytics labels. See https://github.com/allure-framework/allure2/blob/master/Analytics.md | ||
} | ||
currentTest.addLabel('language', 'javascript'); | ||
@@ -146,3 +141,2 @@ currentTest.addLabel('framework', 'wdio'); | ||
if (!this.isAnyTestRunning()) { | ||
// is any CASE running | ||
this.allure.startCase(test.title); | ||
@@ -221,8 +215,6 @@ } else { | ||
onHookStart(hook) { | ||
// ignore global hooks | ||
if (!hook.parent || !this.allure.getCurrentSuite()) { | ||
return false; | ||
} // add beforeEach / afterEach hook as step to test | ||
} | ||
if ((0, _utils.isMochaEachHooks)(hook.title)) { | ||
@@ -234,5 +226,4 @@ if (this.allure.getCurrentTest()) { | ||
return; | ||
} // add hook as test to suite | ||
} | ||
this.onTestStart(hook); | ||
@@ -242,8 +233,6 @@ } | ||
onHookEnd(hook) { | ||
// ignore global hooks | ||
if (!hook.parent || !this.allure.getCurrentSuite() || !this.allure.getCurrentTest()) { | ||
return false; | ||
} // set beforeEach / afterEach hook (step) status | ||
} | ||
if ((0, _utils.isMochaEachHooks)(hook.title)) { | ||
@@ -257,12 +246,19 @@ if (hook.error) { | ||
return; | ||
} // set hook (test) status | ||
} | ||
if (hook.error) { | ||
this.onTestFail(hook); | ||
} else { | ||
this.onTestPass(); // remove hook from suite if it has no steps | ||
this.onTestPass(); | ||
if (this.allure.getCurrentTest().steps.length === 0 && !this.options.useCucumberStepReporter) { | ||
this.allure.getCurrentSuite().testcases.pop(); | ||
} else if (this.options.useCucumberStepReporter) { | ||
const step = this.allure.getCurrentTest().steps.pop(); | ||
if (step && step.attachments.length >= 1) { | ||
step.attachments.forEach(attachment => { | ||
this.allure.getCurrentTest().addAttachment(attachment); | ||
}); | ||
} | ||
} | ||
@@ -423,9 +419,3 @@ } | ||
} | ||
/** | ||
* Assign feature to test | ||
* @name addFeature | ||
* @param {(string)} featureName - feature name or an array of names | ||
*/ | ||
} | ||
@@ -432,0 +422,0 @@ |
@@ -16,8 +16,2 @@ "use strict"; | ||
/** | ||
* Get allure test status by TestStat object | ||
* @param test {Object} - TestStat object | ||
* @param config {Object} - wdio config object | ||
* @private | ||
*/ | ||
const getTestStatus = (test, config) => { | ||
@@ -35,31 +29,11 @@ if (config.framework === 'jasmine') { | ||
}; | ||
/** | ||
* Check is object is empty | ||
* @param object {Object} | ||
* @private | ||
*/ | ||
exports.getTestStatus = getTestStatus; | ||
const isEmpty = object => !object || Object.keys(object).length === 0; | ||
/** | ||
* Is mocha beforeEach / afterEach hook | ||
* @param title {String} - hook title | ||
* @returns {boolean} | ||
* @private | ||
*/ | ||
exports.isEmpty = isEmpty; | ||
const isMochaEachHooks = title => _constants.mochaEachHooks.some(hook => title.includes(hook)); | ||
/** | ||
* Call reporter | ||
* @param {string} event - event name | ||
* @param {Object} msg - event payload | ||
* @private | ||
*/ | ||
exports.isMochaEachHooks = isMochaEachHooks; | ||
@@ -70,10 +44,3 @@ | ||
}; | ||
/** | ||
* Properly format error from different test runners | ||
* @param {Object} test - TestStat object | ||
* @returns {Object} - error object | ||
* @private | ||
*/ | ||
exports.tellReporter = tellReporter; | ||
@@ -80,0 +47,0 @@ |
{ | ||
"name": "@wdio/allure-reporter", | ||
"version": "5.11.7", | ||
"version": "5.11.14", | ||
"description": "A WebdriverIO reporter plugin to create Allure Test Reports", | ||
@@ -44,3 +44,3 @@ "author": "Boris Osipov <osipov.boris@gmail.com>", | ||
}, | ||
"gitHead": "945feb83efec8431cb448293bb2cc0f3b7fc1c16" | ||
"gitHead": "e92b2b6f4b508adc24acd1f68a7131f4314074d2" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23485
553