From 977e2f0337b788e776aa1e70dfcf4ce553e97556 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Wed, 31 Jul 2019 15:50:14 +0300 Subject: [PATCH] version check for the trip plugin --- features/step_definitions/trip.js | 4 +++ features/testbot/trip.feature | 48 +++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/features/step_definitions/trip.js b/features/step_definitions/trip.js index e7204401890..5943c066362 100644 --- a/features/step_definitions/trip.js +++ b/features/step_definitions/trip.js @@ -43,6 +43,10 @@ module.exports = function () { got.message = json.message; } + if (headers.has('data_version')) { + got.data_version = json.data_version || ''; + } + if (headers.has('geometry')) { if (this.queryParams['geometries'] === 'polyline') { got.geometry = polyline.decode(json.trips[0].geometry).toString(); diff --git a/features/testbot/trip.feature b/features/testbot/trip.feature index 62d2cabd684..bd3fe2cc361 100644 --- a/features/testbot/trip.feature +++ b/features/testbot/trip.feature @@ -5,6 +5,24 @@ Feature: Basic trip planning Given the profile "testbot" Given a grid size of 10 meters + Scenario: Testbot - Trip: Invalid options (like was in test suite for a long time) + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | + | ab | + | bc | + | cb | + | da | + + When I plan a trip I should get + | waypoints | trips | code | + | a | aa | InvalidOptions | + Scenario: Testbot - Trip: Roundtrip with one waypoint Given the node map """ @@ -20,8 +38,28 @@ Feature: Basic trip planning | da | When I plan a trip I should get - | waypoints | trips | - | a | aa | + | waypoints | trips | code | + | a,a | aa | Ok | + + Scenario: Testbot - Trip: data version check + Given the node map + """ + a b + c d + """ + + And the ways + | nodes | + | ab | + | bc | + | cb | + | da | + + And the extract extra arguments "--data_version cucumber_data_version" + + When I plan a trip I should get + | waypoints | trips | data_version | code | + | a,a | aa | cucumber_data_version | Ok | Scenario: Testbot - Trip: Roundtrip with waypoints (less than 10) Given the node map @@ -38,9 +76,9 @@ Feature: Basic trip planning | da | When I plan a trip I should get - | waypoints | trips | durations | - | a,b,c,d | abcda | 7.6 | - | d,b,c,a | dbcad | 7.6 | + | waypoints | trips | durations | code | + | a,b,c,d | abcda | 7.6 | Ok | + | d,b,c,a | dbcad | 7.6 | Ok | Scenario: Testbot - Trip: Roundtrip waypoints (more than 10) Given the node map