yachr
Version:
Yet another cucumber html reporter
60 lines • 2.56 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FeatureSuiteSummary = void 0;
/**
* A high level summary of used for dashboard reporting.
* Represents the total number of passing/failing features
* in the entire Cucumber Test Report
*/
class FeatureSuiteSummary {
constructor() {
this.passingFeatures = [];
this.failingFeatures = [];
this.ambiguousFeatures = [];
this.pendingFeatures = [];
this.undefinedFeatures = [];
}
/** The total number of Scenarios that are ambiguously defined for the Feature */
get ambiguous() { return this.ambiguousFeatures.length; }
/** The total number of features that have failed */
get failed() { return this.failingFeatures.length; }
/** The total number of features that are not implemented (and thus marked as undefined) */
get undefined() { return this.undefinedFeatures.length; }
/** The total number of features that have passed */
get pending() { return this.pendingFeatures.length; }
/** The total number of features that have passed */
get passed() { return this.passingFeatures.length; }
/** All features in this group */
get total() {
return this.ambiguous + this.failed + this.undefined + this.pending + this.passed;
}
/** Whether the Suite or Feature has failed due to a failed Feature or Scenario */
get isFailed() { return this.failed > 0; }
/** Whether the Suite or Feature has passed due to all steps passing */
get isPassed() { return this.passed === this.total; }
/** Whether the entire Suite or Feature is undefined */
get isUndefined() { return this.undefined === this.total; }
/** Updates the aggregated summary using information gathered in the Element Summary */
aggregateFeature(feature) {
if (feature.hasAmbiguous) {
this.ambiguousFeatures.push(feature);
}
else if (feature.hasFailed) {
this.failingFeatures.push(feature);
}
else if (feature.hasUndefined) {
this.undefinedFeatures.push(feature);
}
else if (feature.hasPending) {
this.pendingFeatures.push(feature);
}
else if (feature.isPassed) {
this.passingFeatures.push(feature);
}
else {
throw new Error('Scenario cannot be aggregated. Please raise a GitHub issue with the Yachr Team');
}
}
}
exports.FeatureSuiteSummary = FeatureSuiteSummary;
//# sourceMappingURL=featureSuiteSummary.js.map