Skip to content

Commit be2347b

Browse files
committed
Adding table param in step for backward compatibility | Can be removed in next release
1 parent a338e91 commit be2347b

File tree

2 files changed

+52
-8
lines changed

2 files changed

+52
-8
lines changed

_testdata/sample.json

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"projectName": "sample",
3-
"timestamp": "Mar 5, 2019 at 2:28pm",
3+
"timestamp": "Mar 5, 2019 at 6:27pm",
44
"successRate": 100,
55
"environment": "default",
66
"tags": "",
7-
"executionTime": 359,
7+
"executionTime": 381,
88
"executionStatus": "pass",
99
"specResults": [
1010
{
1111
"specHeading": "Specification Heading",
1212
"fileName": "/Users/apoorva/Projects/gopath/src/github.com/apoorvam/sample/specs/example.spec",
1313
"tags": [],
14-
"executionTime": 63,
14+
"executionTime": 59,
1515
"executionStatus": "pass",
1616
"scenarios": [
1717
{
1818
"scenarioHeading": "Vowel counts in single word",
1919
"tags": [
2020
"single word"
2121
],
22-
"executionTime": 63,
22+
"executionTime": 58,
2323
"executionStatus": "pass",
2424
"contexts": [
2525
{
@@ -33,14 +33,15 @@
3333
"table": null
3434
}
3535
],
36+
"table": null,
3637
"beforeStepHookFailure": null,
3738
"afterStepHookFailure": null,
3839
"result": {
3940
"status": "pass",
4041
"stackTrace": "",
4142
"screenshot": "",
4243
"errorMessage": "",
43-
"executionTime": 1,
44+
"executionTime": 0,
4445
"skippedReason": "",
4546
"messages": [],
4647
"errorType": "assertion"
@@ -66,14 +67,15 @@
6667
"table": null
6768
}
6869
],
70+
"table": null,
6971
"beforeStepHookFailure": null,
7072
"afterStepHookFailure": null,
7173
"result": {
7274
"status": "pass",
7375
"stackTrace": "",
7476
"screenshot": "",
7577
"errorMessage": "",
76-
"executionTime": 62,
78+
"executionTime": 58,
7779
"skippedReason": "",
7880
"messages": [],
7981
"errorType": "assertion"
@@ -88,7 +90,7 @@
8890
{
8991
"scenarioHeading": "Vowel counts in multiple word",
9092
"tags": [],
91-
"executionTime": 0,
93+
"executionTime": 1,
9294
"executionStatus": "pass",
9395
"contexts": [
9496
{
@@ -102,14 +104,15 @@
102104
"table": null
103105
}
104106
],
107+
"table": null,
105108
"beforeStepHookFailure": null,
106109
"afterStepHookFailure": null,
107110
"result": {
108111
"status": "pass",
109112
"stackTrace": "",
110113
"screenshot": "",
111114
"errorMessage": "",
112-
"executionTime": 0,
115+
"executionTime": 1,
113116
"skippedReason": "",
114117
"messages": [],
115118
"errorType": "assertion"
@@ -166,6 +169,44 @@
166169
}
167170
}
168171
],
172+
"table": {
173+
"headers": [
174+
"Word",
175+
"Vowel Count"
176+
],
177+
"rows": [
178+
{
179+
"cells": [
180+
"Gauge",
181+
"3"
182+
]
183+
},
184+
{
185+
"cells": [
186+
"Mingle",
187+
"2"
188+
]
189+
},
190+
{
191+
"cells": [
192+
"Snap",
193+
"1"
194+
]
195+
},
196+
{
197+
"cells": [
198+
"GoCD",
199+
"1"
200+
]
201+
},
202+
{
203+
"cells": [
204+
"Rhythm",
205+
"0"
206+
]
207+
}
208+
]
209+
},
169210
"beforeStepHookFailure": null,
170211
"afterStepHookFailure": null,
171212
"result": {

generate.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ type step struct {
8484
ItemType tokenKind `json:"itemType"`
8585
StepText string `json:"stepText"`
8686
Parameters []Parameter `json:"parameters"`
87+
Table *table `json:"table"`
8788
BeforeStepHookFailure *hookFailure `json:"beforeStepHookFailure"`
8889
AfterStepHookFailure *hookFailure `json:"afterStepHookFailure"`
8990
Result *result `json:"result"`
@@ -305,10 +306,12 @@ func toStep(protoStep *gauge_messages.ProtoStep) *step {
305306
switch p.GetParameterType() {
306307
case gauge_messages.Parameter_Table:
307308
table := toTable(p.GetTable())
309+
step.Table = table
308310
params = append(params, Parameter{ParameterType: tableParameter, Name: p.GetName(), Table: table})
309311
break
310312
case gauge_messages.Parameter_Special_Table:
311313
table := toTable(p.GetTable())
314+
step.Table = table
312315
params = append(params, Parameter{ParameterType: specialTableParameter, Name: p.GetName(), Table: table})
313316
break
314317
case gauge_messages.Parameter_Dynamic:

0 commit comments

Comments
 (0)