add failing tests for travel mode

This commit is contained in:
Emil Tin 2014-08-09 11:44:35 +02:00
parent 3e6f27d173
commit d09394ed52
2 changed files with 273 additions and 91 deletions

View File

@ -1,89 +1,151 @@
@routing @bicycle @mode routing @bicycle @mode
Feature: Bike - Mode flag Feature: Bike - Mode flag
Background: # bicycle modes:
Given the profile "bicycle" # 1 bike
# 2 pushing
# 3 ferry
# 4 train
Background:
Given the profile "bicycle"
@todo
Scenario: Bike - Mode when using a ferry Scenario: Bike - Mode when using a ferry
Given the node map Given the node map
| a | b | | | a | b | |
| | c | d | | | c | d |
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | route | duration |
| ab | primary | | | | ab | primary | | |
| bc | | ferry | 0:01 | | bc | | ferry | 0:01 |
| cd | primary | | | | cd | primary | | |
When I route I should get When I route I should get
| from | to | route | turns | modes | | from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left, destination | bike,ferry,bike | | a | d | ab,bc,cd | head,right,left,destination | 1,3,1 |
| d | a | cd,bc,ab | head,right,left, destination | bike,ferry,bike | | d | a | cd,bc,ab | head,right,left,destination | 1,3,1 |
| c | a | bc,ab | head,left,destination | ferry,bike | | c | a | bc,ab | head,left,destination | 3,1 |
| d | b | cd,bc | head,right,destination | bike,ferry | | d | b | cd,bc | head,right,destination | 1,3 |
| a | c | ab,bc | head,right,destination | bike,ferry | | a | c | ab,bc | head,right,destination | 1,3 |
| b | d | bc,cd | head,left,destination | ferry,bike | | b | d | bc,cd | head,left,destination | 3,1 |
@todo Scenario: Bike - Mode when using a train
Scenario: Bike - Mode when pushing bike against oneways Given the node map
Given the node map | a | b | |
| a | b | | | | c | d |
| | c | d |
And the ways And the ways
| nodes | highway | oneway | | nodes | highway | railway | bicycle |
| ab | primary | | | ab | primary | | |
| bc | primary | yes | | bc | | train | yes |
| cd | primary | | | cd | primary | | |
When I route I should get When I route I should get
| from | to | route | turns | modes | | from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | bike,push,bike | | a | d | ab,bc,cd | head,right,left,destination | 1,4,1 |
| d | a | cd,bc,ab | head,right,left,destination | bike,push,bike | | d | a | cd,bc,ab | head,right,left,destination | 1,4,1 |
| c | a | bc,ab | head,left,destination | push,bike | | c | a | bc,ab | head,left,destination | 4,1 |
| d | b | cd,bc | head,right,destination | bike,push | | d | b | cd,bc | head,right,destination | 1,4 |
| a | c | ab,bc | head,right,destination | bike,push | | a | c | ab,bc | head,right,destination | 1,4 |
| b | d | bc,cd | head,left,destination | push,bike | | b | d | bc,cd | head,left,destination | 4,1 |
@todo Scenario: Bike - Mode when pushing bike against oneways
Scenario: Bike - Mode when pushing on pedestrain streets Given the node map
Given the node map | a | b | |
| a | b | | | | c | d |
| | c | d |
And the ways And the ways
| nodes | highway | | nodes | highway | oneway |
| ab | primary | | ab | primary | |
| bc | pedestrian | | bc | primary | yes |
| cd | primary | | cd | primary | |
When I route I should get When I route I should get
| from | to | route | turns | modes | | from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | bike,push,bike | | a | d | ab,bc,cd | head,right,left,destination | 1,1,1 |
| d | a | cd,bc,ab | head,right,left,destination | bike,push,bike | | d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | push,bike | | c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | bike,push | | d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | bike,push | | a | c | ab,bc | head,right,destination | 1,1 |
| b | d | bc,cd | head,left,destination | push,bike | | b | d | bc,cd | head,left,destination | 1,1 |
@todo Scenario: Bike - Mode when pushing on pedestrain streets
Scenario: Bike - Mode when pushing on pedestrain areas Given the node map
Given the node map | a | b | |
| a | b | | | | | c | d |
| | c | d | f |
And the ways And the ways
| nodes | highway | area | | nodes | highway |
| ab | primary | | | ab | primary |
| bcd | pedestrian | yes | | bc | pedestrian |
| df | primary | | | cd | primary |
When I route I should get When I route I should get
| from | to | route | modes | | from | to | route | turns | modes |
| a | f | ab,bcd,df | bike,push,bike | | a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| f | a | df,bcd,ab | bike,push,bike | | d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| d | a | bcd,ab | push,bike | | c | a | bc,ab | head,left,destination | 2,1 |
| f | b | df,bcd | bike,push | | d | b | cd,bc | head,right,destination | 1,2 |
| a | d | ab,bcd | bike,push | | a | c | ab,bc | head,right,destination | 1,2 |
| b | f | bcd,df | push,bike | | b | d | bc,cd | head,left,destination | 2,1 |
Scenario: Bike - Mode when pushing on pedestrain areas
Given the node map
| a | b | | |
| | c | d | f |
And the ways
| nodes | highway | area |
| ab | primary | |
| bcd | pedestrian | yes |
| df | primary | |
When I route I should get
| from | to | route | modes |
| a | f | ab,bcd,df | 1,2,1 |
| f | a | df,bcd,ab | 1,2,1 |
| d | a | bcd,ab | 2,1 |
| f | b | df,bcd | 1,2 |
| a | d | ab,bcd | 1,2 |
| b | f | bcd,df | 2,1 |
Scenario: Bike - Mode when pushing on steps
Given the node map
| a | b | | |
| | c | d | f |
And the ways
| nodes | highway |
| ab | primary |
| bc | steps |
| cd | primary |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
Scenario: Bike - Mode when bicycle=dismount
Given the node map
| a | b | | |
| | c | d | f |
And the ways
| nodes | highway | bicycle |
| ab | primary | |
| bc | primary | dismount |
| cd | primary | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |

View File

@ -1,26 +1,146 @@
@routing @testbot @mode @routing @testbot @mode
Feature: Testbot - Mode flag Feature: Testbot - Mode flag
Background: # testbot modes:
Given the profile "testbot" # 1 normal
# 2 route
# 3 river downstream
# 4 river upstream
# 5 steps down
# 6 steps up
@todo Background:
Scenario: Bike - Mode Given the profile "testbot"
Scenario: Testbot - Mode for routes
Given the node map
| a | b | | | |
| | c | d | e | f |
And the ways
| nodes | highway | route | duration |
| ab | primary | | |
| bc | | ferry | 0:01 |
| cd | primary | | |
| de | primary | | |
| ef | primary | | |
When I route I should get
| from | to | route | turns | modes |
| a | d | ab,bc,cd | head,right,left,destination | 1,2,1 |
| d | a | cd,bc,ab | head,right,left,destination | 1,2,1 |
| c | a | bc,ab | head,left,destination | 2,1 |
| d | b | cd,bc | head,right,destination | 1,2 |
| a | c | ab,bc | head,right,destination | 1,2 |
| b | d | bc,cd | head,left,destination | 2,1 |
| a | f | ab,bc,cd,de,ef | head,right,left,straight,straight,destination | 1,2,1,1,1 |
Scenario: Testbot - Modes for each direction
Given the node map
| | | | | | | d |
| | | | | | 2 | |
| | | | | 6 | | 5 |
| a | 0 | b | c | | | |
| | | | | 4 | | 1 |
| | | | | | 3 | |
| | | | | | | e |
And the ways
| nodes | highway | oneway |
| abc | primary | |
| cd | primary | yes |
| ce | river | |
| de | primary | |
When I route I should get
| from | to | route | modes |
| 0 | 1 | abc,ce,de | 1,3,1 |
| 1 | 0 | de,ce,abc | 1,4,1 |
| 0 | 2 | abc,cd | 1,1 |
| 2 | 0 | cd,de,ce,abc | 1,1,4,1 |
| 0 | 3 | abc,ce | 1,3 |
| 3 | 0 | ce,abc | 4,1 |
| 4 | 3 | ce | 3 |
| 3 | 4 | ce | 4 |
| 3 | 1 | ce,de | 3,1 |
| 1 | 3 | de,ce | 1,4 |
| a | e | abc,ce | 1,3 |
| e | a | ce,abc | 4,1 |
| a | d | abc,cd | 1,1 |
| d | a | de,ce,abc | 1,4,1 |
Scenario: Testbot - Modes in each direction (simple)
Given the node map Given the node map
| a | b | | | | 0 | 1 | |
| | c | d | | a | | | b |
And the ways And the ways
| nodes | highway | route | duration | | nodes | highway | oneway |
| ab | primary | | | | ab | river | |
| bc | | ferry | 0:01 |
| cd | primary | | |
When I route I should get When I route I should get
| from | to | route | turns | modes | | from | to | route | modes |
| a | d | ab,bc,cd | head,right,left,destination | bot,ferry,bot | | 0 | 1 | ab | 3 |
| d | a | cd,bc,ab | head,right left,destination | bot,ferry,bot | | 1 | 0 | ab | 4 |
| c | a | bc,ab | head,left,destination | ferry,bot |
| d | b | cd,bc | head,right,destination | bot,ferry | Scenario: Testbot - Modes in each direction (same speed in both direction)
| a | c | ab,bc | head,right,destination | bot,ferry | Given the node map
| b | d | bc,cd | head,left,destination | ferry,bot | | | 0 | 1 | |
| a | | | b |
And the ways
| nodes | highway |
| ab | steps |
When I route I should get
| from | to | route | modes | time |
| 0 | 1 | ab | 5 | 60s +-1 |
| 1 | 0 | ab | 6 | 60s +-1 |
Scenario: Testbot - Modes for opposite direction
Given the node map
| | 0 | 1 | |
| a | | | b |
And the ways
| nodes | highway | oneway |
| ab | steps | -1 |
When I route I should get
| from | to | route | modes |
| 0 | 1 | | |
| 1 | 0 | ab | 6 |
@via
Scenario: Testbot - Modes and via point at dead end
Given the node map
| a | b | c |
| | d | |
And the ways
| nodes | highway |
| abc | primary |
| bd | steps |
When I route I should get
| waypoints | route | modes |
| a,d,c | abc,bd,bd,abc | 1,5,6,1 |
| c,d,a | abc,bd,bd,abc | 1,5,6,1 |
@via
Scenario: Testbot - Modes and via point at river
Given the node map
| | | 0 | | |
| a | b | | c | d |
And the ways
| nodes | highway |
| ab | primary |
| bc | river |
| cd | primary |
When I route I should get
| waypoints | route | modes |
| a,0,d | ab,bc,cd | 1,3,1 |
| d,0,a | cd,bc,ab | 1,4,1 |