Added cucumber test for skip_waypoint feature

This commit is contained in:
Denis Chaplygin 2019-09-23 11:38:33 +03:00
parent a6097cdc01
commit d25a530942
3 changed files with 32 additions and 3 deletions

View File

@ -12,4 +12,9 @@ module.exports = function () {
q.awaitAll(callback);
});
this.Given(/^skip waypoints$/, (callback) => {
this.queryParams['skip_waypoints'] = true;
callback();
});
};

View File

@ -155,6 +155,13 @@ module.exports = function () {
if (headers.has('locations')){
got.locations = (locations || '').trim();
}
if (headers.has('waypoints_count')) {
if ('waypoints' in json) {
got.waypoints_count = json.waypoints.length;
} else{
got.waypoints_count = 0;
}
}
/*
if (headers.has('approaches')){
got.approaches = (approaches || '').trim();

View File

@ -17,9 +17,9 @@ Feature: Basic Routing
| ab |
When I route I should get
| from | to | route | data_version |
| a | b | ab,ab | |
| b | a | ab,ab | |
| from | to | route | data_version | waypoints_count |
| a | b | ab,ab | | 2 |
| b | a | ab,ab | | 2 |
Scenario: Data_version test
Given the node map
@ -38,6 +38,23 @@ Feature: Basic Routing
| a | b | ab,ab | cucumber_data_version |
| b | a | ab,ab | cucumber_data_version |
Scenario: Skip_waypoints test
Given the node map
"""
a b
"""
And skip waypoints
And the ways
| nodes |
| ab |
When I route I should get
| from | to | route | waypoints_count |
| a | b | ab,ab | 0 |
| b | a | ab,ab | 0 |
Scenario: Routing in between two nodes of way
Given the node map
"""