Skip to content

Commit

Permalink
Adding table param in step for backward compatibility | Can be remove…
Browse files Browse the repository at this point in the history
…d in next release
  • Loading branch information
apoorvam committed Mar 5, 2019
1 parent a338e91 commit be2347b
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 8 deletions.
57 changes: 49 additions & 8 deletions _testdata/sample.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"projectName": "sample",
"timestamp": "Mar 5, 2019 at 2:28pm",
"timestamp": "Mar 5, 2019 at 6:27pm",
"successRate": 100,
"environment": "default",
"tags": "",
"executionTime": 359,
"executionTime": 381,
"executionStatus": "pass",
"specResults": [
{
"specHeading": "Specification Heading",
"fileName": "/Users/apoorva/Projects/gopath/src/github.com/apoorvam/sample/specs/example.spec",
"tags": [],
"executionTime": 63,
"executionTime": 59,
"executionStatus": "pass",
"scenarios": [
{
"scenarioHeading": "Vowel counts in single word",
"tags": [
"single word"
],
"executionTime": 63,
"executionTime": 58,
"executionStatus": "pass",
"contexts": [
{
Expand All @@ -33,14 +33,15 @@
"table": null
}
],
"table": null,
"beforeStepHookFailure": null,
"afterStepHookFailure": null,
"result": {
"status": "pass",
"stackTrace": "",
"screenshot": "",
"errorMessage": "",
"executionTime": 1,
"executionTime": 0,
"skippedReason": "",
"messages": [],
"errorType": "assertion"
Expand All @@ -66,14 +67,15 @@
"table": null
}
],
"table": null,
"beforeStepHookFailure": null,
"afterStepHookFailure": null,
"result": {
"status": "pass",
"stackTrace": "",
"screenshot": "",
"errorMessage": "",
"executionTime": 62,
"executionTime": 58,
"skippedReason": "",
"messages": [],
"errorType": "assertion"
Expand All @@ -88,7 +90,7 @@
{
"scenarioHeading": "Vowel counts in multiple word",
"tags": [],
"executionTime": 0,
"executionTime": 1,
"executionStatus": "pass",
"contexts": [
{
Expand All @@ -102,14 +104,15 @@
"table": null
}
],
"table": null,
"beforeStepHookFailure": null,
"afterStepHookFailure": null,
"result": {
"status": "pass",
"stackTrace": "",
"screenshot": "",
"errorMessage": "",
"executionTime": 0,
"executionTime": 1,
"skippedReason": "",
"messages": [],
"errorType": "assertion"
Expand Down Expand Up @@ -166,6 +169,44 @@
}
}
],
"table": {
"headers": [
"Word",
"Vowel Count"
],
"rows": [
{
"cells": [
"Gauge",
"3"
]
},
{
"cells": [
"Mingle",
"2"
]
},
{
"cells": [
"Snap",
"1"
]
},
{
"cells": [
"GoCD",
"1"
]
},
{
"cells": [
"Rhythm",
"0"
]
}
]
},
"beforeStepHookFailure": null,
"afterStepHookFailure": null,
"result": {
Expand Down
3 changes: 3 additions & 0 deletions generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type step struct {
ItemType tokenKind `json:"itemType"`
StepText string `json:"stepText"`
Parameters []Parameter `json:"parameters"`
Table *table `json:"table"`
BeforeStepHookFailure *hookFailure `json:"beforeStepHookFailure"`
AfterStepHookFailure *hookFailure `json:"afterStepHookFailure"`
Result *result `json:"result"`
Expand Down Expand Up @@ -305,10 +306,12 @@ func toStep(protoStep *gauge_messages.ProtoStep) *step {
switch p.GetParameterType() {
case gauge_messages.Parameter_Table:
table := toTable(p.GetTable())
step.Table = table
params = append(params, Parameter{ParameterType: tableParameter, Name: p.GetName(), Table: table})
break
case gauge_messages.Parameter_Special_Table:
table := toTable(p.GetTable())
step.Table = table
params = append(params, Parameter{ParameterType: specialTableParameter, Name: p.GetName(), Table: table})
break
case gauge_messages.Parameter_Dynamic:
Expand Down

0 comments on commit be2347b

Please sign in to comment.