osrm-backend/features/testbot/mode.feature

241 lines
7.6 KiB
Gherkin
Raw Normal View History

2013-03-18 10:37:10 -04:00
@routing @testbot @mode
Feature: Testbot - Mode flag
2014-08-09 05:44:35 -04:00
# testbot modes:
# 1 normal
# 2 route
# 3 river downstream
# 4 river upstream
# 5 steps down
# 6 steps up
2013-08-29 13:29:13 -04:00
Background:
2014-08-09 05:44:35 -04:00
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 |
2014-08-16 06:27:26 -04:00
Scenario: Testbot - Different modes in each direction, start between nodes
Given the node map
| a | 1 | b |
And the ways
| nodes | highway |
| ab | river |
When I route I should get
| from | to | route | modes |
| 1 | b | ab | 3 |
| 1 | a | ab | 4 |
2014-08-09 05:44:35 -04:00
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
| | 0 | 1 | |
| a | | | b |
And the ways
| nodes | highway | oneway |
| ab | river | |
When I route I should get
| from | to | route | modes |
| 0 | 1 | ab | 3 |
| 1 | 0 | ab | 4 |
Scenario: Testbot - Modes in each direction (same speed in both direction)
Given the node map
| | 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 |
2014-08-11 08:08:00 -04:00
Scenario: Testbot - Modes for oneway
2014-08-09 05:44:35 -04:00
Given the node map
2014-08-11 08:08:00 -04:00
| a | b |
And the ways
| nodes | highway | oneway |
| ab | steps | yes |
When I route I should get
| from | to | route | modes |
| a | b | ab | 5 |
| b | a | | |
Scenario: Testbot - Modes for reverse oneway
Given the node map
| a | b |
2014-08-09 05:44:35 -04:00
And the ways
| nodes | highway | oneway |
| ab | steps | -1 |
When I route I should get
| from | to | route | modes |
2014-08-11 08:08:00 -04:00
| b | a | ab | 6 |
| a | b | | |
2014-08-16 06:27:26 -04:00
@via
Scenario: Testbot - Mode should be set at via points
Given the node map
| a | 1 | b |
And the ways
| nodes | highway |
| ab | river |
When I route I should get
| waypoints | route | modes | turns |
| a,1,b | ab,ab | 3,3 | head,via,destination |
| b,1,a | ab,ab | 4,4 | head,via,destination |
2014-08-09 05:44:35 -04:00
@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
2014-08-16 06:27:26 -04:00
| waypoints | route | modes |
| a,d,c | abc,bd,bd,bd,abc | 1,5,5,6,1 |
| c,d,a | abc,bd,bd,bd,abc | 1,5,5,6,1 |
2013-08-29 13:29:13 -04:00
2014-08-09 05:44:35 -04:00
@via
Scenario: Testbot - Modes and via point at river
2013-08-29 13:29:13 -04:00
Given the node map
2014-08-09 05:44:35 -04:00
| | | 0 | | |
| a | b | | c | d |
2013-03-18 10:37:10 -04:00
2013-08-29 13:29:13 -04:00
And the ways
2014-08-09 05:44:35 -04:00
| nodes | highway |
| ab | primary |
| bc | river |
| cd | primary |
2013-03-18 10:37:10 -04:00
2013-08-29 13:29:13 -04:00
When I route I should get
| waypoints | route | modes | turns |
| a,0,d | ab,bc,bc,cd | 1,3,3,1 | head,straight,via,straight,destination |
| d,0,a | cd,bc,bc,ab | 1,4,4,1 | head,straight,via,straight,destination |
2014-08-12 04:02:29 -04:00
2014-08-12 08:18:02 -04:00
Scenario: Testbot - Modes when starting on forward oneway
Given the node map
| a | b |
And the ways
| nodes | highway | oneway |
| ab | river | yes |
When I route I should get
| from | to | route | modes |
| a | b | ab | 3 |
| b | a | | |
Scenario: Testbot - Modes when starting on reverse oneway
2014-08-12 04:02:29 -04:00
Given the node map
| a | b |
And the ways
| nodes | highway | oneway |
| ab | river | -1 |
When I route I should get
| from | to | route | modes |
2014-08-12 08:18:02 -04:00
| a | b | | |
2014-08-12 04:02:29 -04:00
| b | a | ab | 4 |
2014-08-16 06:27:26 -04:00
Scenario: Testbot - Starting at a tricky node
Given the node map
2014-08-16 06:27:26 -04:00
| | a | | | |
| | | | b | c |
2014-08-14 04:51:24 -04:00
And the ways
| nodes | highway |
| ab | river |
| bc | primary |
When I route I should get
| from | to | route | modes |
| b | a | ab | 4 |
2014-08-16 06:27:26 -04:00
Scenario: Testbot - Mode changes on straight way without name change
2014-08-14 04:51:24 -04:00
Given the node map
2014-08-16 06:27:26 -04:00
| a | 1 | b | 2 | c |
2014-08-14 04:51:24 -04:00
And the ways
2014-08-16 06:27:26 -04:00
| nodes | highway | name |
| ab | primary | Avenue |
| bc | river | Avenue |
2014-08-14 04:51:24 -04:00
When I route I should get
| from | to | route | modes | turns |
2014-08-16 06:27:26 -04:00
| a | c | Avenue,Avenue | 1,3 | head,straight,destination |
| c | a | Avenue,Avenue | 3,1 | head,straight,destination |
| 1 | 2 | Avenue,Avenue | 1,3 | head,straight,destination |
| 2 | 1 | Avenue,Avenue | 3,1 | head,straight,destination |