Skip to content

Commit

Permalink
Oops
Browse files Browse the repository at this point in the history
  • Loading branch information
DonJayamanne committed Aug 14, 2019
1 parent cc00ea1 commit e62e7fc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions uitests/src/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,18 @@ async function findScenario(
scenarioId: string,
line: number
): Promise<Scenario> {
const featureFound = report.find(feature => feature.id === featureId);
if (!featureFound) {
throw new Error(`Feature not found. Id = ${featureId}, ScenarioId = ${scenarioId}, line = ${line}`);
}
const found = featureFound.elements.find(scenario => scenario.id === scenarioId && scenario.line === line);
if (!found) {
throw new Error(`Scenario not found. Id = ${featureId}, ScenarioId = ${scenarioId}, line = ${line}`);
for (const feature of report) {
if (feature.id !== featureId) {
continue;
}
const found = feature.elements.find(scenario => scenario.id === scenarioId && scenario.line === line);
if (found) {
return found;
}
}
return found;
throw new Error(
`Feature & Scenario not found. FeatureId = ${featureId}, ScenarioId = ${scenarioId}, line = ${line}`
);
}

async function getCucumberResultStats(json: CucumberReport): Promise<CucumberReportStats> {
Expand Down

0 comments on commit e62e7fc

Please sign in to comment.