systelab-components-wdio-test
Version:
Widgets to be use in the E2E Tests based in WDIO
25 lines (24 loc) • 782 B
JavaScript
import { ReportUtility } from "./report.util.js";
export class TraceabilityUtility {
static registerCoveredSpecs(specList) {
this.addCoveredSpecs(specList);
this.dumpCoveredSpecs();
this.clearCoveredSpecs();
}
static addCoveredSpecs(specsList) {
specsList.forEach(spec => this.coveredSpecs.add(spec));
}
static clearCoveredSpecs() {
this.coveredSpecs.clear();
}
static dumpCoveredSpecs() {
ReportUtility.addLabel("coveredSpecs", this.getCoveredSpecsPrettyString());
}
static getCoveredSpecsPrettyString() {
return [...this.coveredSpecs].sort().join(', ');
}
static hasCoveredSpecs() {
return this.coveredSpecs.size > 0;
}
}
TraceabilityUtility.coveredSpecs = new Set();