Added cucumber test for skip_waypoint feature
This commit is contained in:
parent
a6097cdc01
commit
d25a530942
@ -12,4 +12,9 @@ module.exports = function () {
|
|||||||
|
|
||||||
q.awaitAll(callback);
|
q.awaitAll(callback);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.Given(/^skip waypoints$/, (callback) => {
|
||||||
|
this.queryParams['skip_waypoints'] = true;
|
||||||
|
callback();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
@ -155,6 +155,13 @@ module.exports = function () {
|
|||||||
if (headers.has('locations')){
|
if (headers.has('locations')){
|
||||||
got.locations = (locations || '').trim();
|
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')){
|
if (headers.has('approaches')){
|
||||||
got.approaches = (approaches || '').trim();
|
got.approaches = (approaches || '').trim();
|
||||||
|
@ -17,9 +17,9 @@ Feature: Basic Routing
|
|||||||
| ab |
|
| ab |
|
||||||
|
|
||||||
When I route I should get
|
When I route I should get
|
||||||
| from | to | route | data_version |
|
| from | to | route | data_version | waypoints_count |
|
||||||
| a | b | ab,ab | |
|
| a | b | ab,ab | | 2 |
|
||||||
| b | a | ab,ab | |
|
| b | a | ab,ab | | 2 |
|
||||||
|
|
||||||
Scenario: Data_version test
|
Scenario: Data_version test
|
||||||
Given the node map
|
Given the node map
|
||||||
@ -38,6 +38,23 @@ Feature: Basic Routing
|
|||||||
| a | b | ab,ab | cucumber_data_version |
|
| a | b | ab,ab | cucumber_data_version |
|
||||||
| b | a | 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
|
Scenario: Routing in between two nodes of way
|
||||||
Given the node map
|
Given the node map
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user