Refactor cucumber tests

This commit is contained in:
Patrick Niklaus
2015-12-08 23:00:11 +01:00
parent 7e722db3ee
commit 4ec3102df2
19 changed files with 211 additions and 341 deletions
+33 -33
View File
@@ -14,12 +14,12 @@ Feature: Bearing parameter
| ad |
When I route I should get
| from | to | param:b | route | bearing |
| b | c | 90&b=90 | ad | 90 |
| b | c | 180&b=90 | | |
| b | c | 80&b=100 | ad | 90 |
| b | c | 79&b=100 | | |
| b | c | 79,11&b=100 | ad | 90 |
| from | to | bearings | route | bearing |
| b | c | 90 90 | ad | 90 |
| b | c | 180 90 | | |
| b | c | 80 100 | ad | 90 |
| b | c | 79 100 | | |
| b | c | 79,11 100 | ad | 90 |
Scenario: Testbot - Intial bearing in simple case
Given the node map
@@ -33,13 +33,13 @@ Feature: Bearing parameter
| bc |
When I route I should get
| from | to | param:b | route | bearing |
| 0 | c | 0&b=0 | | |
| 0 | c | 45&b=45 | bc | 45 ~3% |
| 0 | c | 85&b=85 | | |
| 0 | c | 95&b=95 | | |
| 0 | c | 135&b=135 | ac | 135 ~1% |
| 0 | c | 180&b=180 | | |
| from | to | bearings | route | bearing |
| 0 | c | 0 0 | | |
| 0 | c | 45 45 | bc | 45 ~3% |
| 0 | c | 85 85 | | |
| 0 | c | 95 95 | | |
| 0 | c | 135 135 | ac | 135 ~1% |
| 0 | c | 180 180 | | |
Scenario: Testbot - Initial bearing on split way
Given the node map
@@ -54,21 +54,21 @@ Feature: Bearing parameter
| da | yes |
When I route I should get
| from | to | param:b | route | bearing |
| 0 | b | 10&b=10 | bc | 0 |
| 0 | b | 90&b=90 | ab | 90 |
| from | to | bearings | route | bearing |
| 0 | b | 10 10 | bc | 0 |
| 0 | b | 90 90 | ab | 90 |
# The returned bearing is wrong here, it's based on the snapped
# coordinates, not the acutal edge bearing. This should be
# fixed one day, but it's only a problem when we snap too vias
# to the same point - DP
#| 0 | b | 170&b=170 | da | 180 |
#| 0 | b | 189&b=189 | da | 180 |
| 0 | 1 | 90&b=270 | ab,bc,cd | 90,0,270 |
| 1 | d | 10&b=10 | bc | 0 |
| 1 | d | 90&b=90 | ab,bc,cd,da | 90,0,270,180 |
| 1 | 0 | 189&b=189 | da | 180 |
| 1 | d | 270&b=270 | cd | 270 |
| 1 | d | 349&b=349 | | |
#| 0 | b | 170 170 | da | 180 |
#| 0 | b | 189 189 | da | 180 |
| 0 | 1 | 90 270 | ab,bc,cd | 90,0,270 |
| 1 | d | 10 10 | bc | 0 |
| 1 | d | 90 90 | ab,bc,cd,da | 90,0,270,180 |
| 1 | 0 | 189 189 | da | 180 |
| 1 | d | 270 270 | cd | 270 |
| 1 | d | 349 349 | | |
Scenario: Testbot - Initial bearing in all direction
Given the node map
@@ -100,12 +100,12 @@ Feature: Bearing parameter
| ha | yes |
When I route I should get
| from | to | param:b | route | bearing |
| 0 | q | 0&b=90 | ia,ab,bc,cd,de,ef,fg,gh,ha | 0,90,180,180,270,270,0,0,90 |
| 0 | a | 45&b=90 | jb,bc,cd,de,ef,fg,gh,ha | 45,180,180,270,270,0,0,90 |
| 0 | q | 90&b=90 | kc,cd,de,ef,fg,gh,ha | 90,180,270,270,0,0,90 |
| 0 | a | 135&b=90 | ld,de,ef,fg,gh,ha | 135,270,270,0,0,90 |
| 0 | a | 180&b=90 | me,ef,fg,gh,ha | 180,270,0,0,90 |
| 0 | a | 225&b=90 | nf,fg,gh,ha | 225,0,0,90 |
| 0 | a | 270&b=90 | og,gh,ha | 270,0,90 |
| 0 | a | 315&b=90 | ph,ha | 315,90 |
| from | to | bearings | route | bearing |
| 0 | q | 0 90 | ia,ab,bc,cd,de,ef,fg,gh,ha | 0,90,180,180,270,270,0,0,90 |
| 0 | a | 45 90 | jb,bc,cd,de,ef,fg,gh,ha | 45,180,180,270,270,0,0,90 |
| 0 | q | 90 90 | kc,cd,de,ef,fg,gh,ha | 90,180,270,270,0,0,90 |
| 0 | a | 135 90 | ld,de,ef,fg,gh,ha | 135,270,270,0,0,90 |
| 0 | a | 180 90 | me,ef,fg,gh,ha | 180,270,0,0,90 |
| 0 | a | 225 90 | nf,fg,gh,ha | 225,0,0,90 |
| 0 | a | 270 90 | og,gh,ha | 270,0,90 |
| 0 | a | 315 90 | ph,ha | 315,90 |
+1 -4
View File
@@ -101,7 +101,7 @@ Feature: Basic Distance Matrix
| d | 200 | 300 | 0 | 300 |
| e | 300 | 400 | 100 | 0 |
Scenario: Testbot - Travel time matrix and mapped coordinates with only one source
Scenario: Testbot - Travel time matrix and with only one source
Given the node map
| a | b | c |
| d | e | f |
@@ -114,9 +114,6 @@ Feature: Basic Distance Matrix
| be |
| cf |
And the query options
| mapped_points | true |
When I request a travel time matrix I should get
| | a | b | e | f |
| a | 0 | 100 | 200 | 300 |
+6 -2
View File
@@ -5,6 +5,8 @@ Feature: Turn directions/codes
Given the profile "testbot"
Scenario: Turn directions
Given the query options
| instructions | true |
Given the node map
| o | p | a | b | c |
| n | | | | d |
@@ -31,7 +33,7 @@ Feature: Turn directions/codes
| xo |
| xp |
When I match with turns I should get
When I match I should get
| trace | route | turns | matchings |
| im | xi,xm | head,left,destination | im |
| io | xi,xo | head,slight_left,destination | io |
@@ -82,6 +84,8 @@ Feature: Turn directions/codes
| gc | xg,xc | head,right,destination | gc |
Scenario: Turn directions
Given the query options
| instructions | true |
Given the node map
| o | p | a | b | c |
| n | | | | d |
@@ -108,7 +112,7 @@ Feature: Turn directions/codes
| xo |
| xp |
When I match with turns I should get
When I match I should get
| trace | route | turns | matchings | duration |
| im | xi,xm | head,left,destination | im | 80 |
| io | xi,xo | head,slight_left,destination | io | 88 |