Skip to content

Commit

Permalink
some statistics fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Schüler committed Mar 1, 2024
1 parent ac5e589 commit 2e63d66
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions new/src/components/Scenarios/ScenarioOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,21 @@ export function ScenarioOverview(props: {
}

function createStatistics(scenarios: ScenarioModel[]): ReportStatistics {
const allCases = scenarios.flatMap((scenario) => scenario.scenarioCases);
const allSteps = allCases.flatMap((scenarioCase) => {scenarioCase.steps});
const failedCases = allCases.filter((scenarioCase) => scenarioCase.status === "FAILED" );

const failedScenarios = scenarios.filter((scenario) => scenario.scenarioCases.some((scenarioCase) => scenarioCase.status === "FAILED"));
const pendingScenarios = scenarios.filter((scenario) => scenario.scenarioCases.some((scenarioCase) => scenarioCase.status === "SOME_STEPS_PENDING" || scenarioCase.status === "SCENARIO_PENDING"));
return {
numClasses: 1,
numScenarios: 1,
// numFailedScenarios: Math.sign(
// findNumberOfCasesWithStatus(scenario.scenarioCases, "FAILED")
// ),
numFailedScenarios: 1,
numCases: 1, //scenario.scenarioCases.length,
numFailedCases: 1, //findNumberOfCasesWithStatus(scenario.scenarioCases, "FAILED"),
numSteps: 1, //scenario.scenarioCases.map(value => value.steps.length).reduce(sum),
numScenarios: scenarios.length,
numFailedScenarios: failedScenarios.length,
numCases: allCases.length,
numFailedCases: failedCases.length,
numSteps: allSteps.length,
durationInNanos: 1, //scenario.durationInNanos,
numPendingScenarios: 1,
numPendingScenarios: pendingScenarios.length,
//Math.sign(
// findNumberOfCasesWithStatus(scenario.scenarioCases, "SCENARIO_PENDING")
//),
Expand Down

0 comments on commit 2e63d66

Please sign in to comment.