diff --git a/features/support/shared_steps.js b/features/support/shared_steps.js index 253be94fd..d6b55b188 100644 --- a/features/support/shared_steps.js +++ b/features/support/shared_steps.js @@ -81,20 +81,6 @@ module.exports = function () { approaches = this.approachList(route); - var resultdata = { - feature: this.feature.getName(), - scenario: this.scenario.getName(), - row: rowIndex, - expected: { - route: table.hashes()[rowIndex]["route"], - turns: table.hashes()[rowIndex]["turns"], - }, - got: { - route: instructions, - turns: turns - } - } - fs.writeFileSync(`${this.scenarioCacheFile}_${rowIndex}_results.json`,JSON.stringify(resultdata)); fs.writeFileSync(`${this.scenarioCacheFile}_${rowIndex}_response.json`,body); var geojson = { @@ -268,6 +254,16 @@ module.exports = function () { putValue('driving_side', driving_sides); } + var resultdata = { + feature: this.feature.getName(), + scenario: this.scenario.getName(), + row: rowIndex, + expected: table.hashes()[rowIndex], + got: got + } + console.log(resultdata); + fs.writeFileSync(`${this.scenarioCacheFile}_${rowIndex}_results.json`,JSON.stringify(resultdata)); + for (var key in row) { if (this.FuzzyMatch.match(got[key], row[key])) { got[key] = row[key]; diff --git a/scripts/tests2doc.js b/scripts/tests2doc.js index 6cfb6d027..b6f859207 100644 --- a/scripts/tests2doc.js +++ b/scripts/tests2doc.js @@ -179,7 +179,7 @@ find('test/cache').filter((f) => f.match(/[0-9]+_results.json$/)).forEach((f) => results.got.turns = results.got.turns.replace(/slight /g,'').replace(/sharp /g, ''); report += `
| Route | Turns | |
|---|---|---|
| OSRM | ${results.expected.route} | ${results.expected.turns} |
| Valhalla | ${results.got.route} | ${results.got.turns} |
| `; +Object.keys(results.expected).forEach((k) => { + report += ` | ${k} | `; +}); +report += `|
| OSRM | `; +Object.keys(results.expected).forEach((k) => { + report += `${results.expected[k]} | `; +}); +report += `|
| Valhalla | `; +Object.keys(results.expected).forEach((k) => { + report += `${results.got[k]} | `; +}); +report += `