Fixes #604 - remove line overwriting for scenario outlines in cucumber formatter (#605)

Этот коммит содержится в:
Glib Briia 2024-01-31 07:04:29 +00:00 коммит произвёл GitHub
родитель 5a5631a758
коммит 250d69ab63
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
4 изменённых файлов: 20 добавлений и 22 удалений

Просмотреть файл

@ -7,6 +7,8 @@ This project adheres to [Semantic Versioning](http://semver.org).
This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com). This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com).
## Unreleased ## Unreleased
### Fixed
- Remove line overwriting for scenario outlines in cucumber formatter ([605](https://github.com/cucumber/godog/pull/605) - [glibas](https://github.com/glibas))
## [v0.13.0] ## [v0.13.0]
### Added ### Added

Просмотреть файл

@ -323,7 +323,7 @@ Feature: cucumber json formatter
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "passing step", "name": "passing step",
"line": 11, "line": 7,
"match": { "match": {
"location": "suite_context.go:64" "location": "suite_context.go:64"
}, },
@ -345,7 +345,7 @@ Feature: cucumber json formatter
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "failing step", "name": "failing step",
"line": 12, "line": 7,
"match": { "match": {
"location": "suite_context.go:47" "location": "suite_context.go:47"
}, },

Просмотреть файл

@ -252,10 +252,6 @@ func (f *Cuke) buildCukeStep(pickle *messages.Pickle, stepResult models.PickleSt
step := feature.FindStep(pickleStep.AstNodeIds[0]) step := feature.FindStep(pickleStep.AstNodeIds[0])
line := step.Location.Line line := step.Location.Line
if len(pickle.AstNodeIds) == 2 {
_, row := feature.FindExample(pickle.AstNodeIds[1])
line = row.Location.Line
}
cukeStep.Name = pickleStep.Text cukeStep.Name = pickleStep.Text
cukeStep.Line = int(line) cukeStep.Line = int(line)

Просмотреть файл

@ -46,7 +46,7 @@
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "passing step", "name": "passing step",
"line": 13, "line": 6,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -58,7 +58,7 @@
{ {
"keyword": "When ", "keyword": "When ",
"name": "passing step", "name": "passing step",
"line": 13, "line": 7,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -70,7 +70,7 @@
{ {
"keyword": "Then ", "keyword": "Then ",
"name": "odd 1 and even 2 number", "name": "odd 1 and even 2 number",
"line": 13, "line": 8,
"match": { "match": {
"location": "fmt_output_test.go:103" "location": "fmt_output_test.go:103"
}, },
@ -110,7 +110,7 @@
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "passing step", "name": "passing step",
"line": 14, "line": 6,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -122,7 +122,7 @@
{ {
"keyword": "When ", "keyword": "When ",
"name": "passing step", "name": "passing step",
"line": 14, "line": 7,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -134,7 +134,7 @@
{ {
"keyword": "Then ", "keyword": "Then ",
"name": "odd 2 and even 0 number", "name": "odd 2 and even 0 number",
"line": 14, "line": 8,
"match": { "match": {
"location": "fmt_output_test.go:103" "location": "fmt_output_test.go:103"
}, },
@ -175,7 +175,7 @@
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "passing step", "name": "passing step",
"line": 15, "line": 6,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -187,7 +187,7 @@
{ {
"keyword": "When ", "keyword": "When ",
"name": "passing step", "name": "passing step",
"line": 15, "line": 7,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -199,7 +199,7 @@
{ {
"keyword": "Then ", "keyword": "Then ",
"name": "odd 3 and even 11 number", "name": "odd 3 and even 11 number",
"line": 15, "line": 8,
"match": { "match": {
"location": "fmt_output_test.go:103" "location": "fmt_output_test.go:103"
}, },
@ -240,7 +240,7 @@
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "passing step", "name": "passing step",
"line": 20, "line": 6,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -252,7 +252,7 @@
{ {
"keyword": "When ", "keyword": "When ",
"name": "passing step", "name": "passing step",
"line": 20, "line": 7,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -264,7 +264,7 @@
{ {
"keyword": "Then ", "keyword": "Then ",
"name": "odd 1 and even 14 number", "name": "odd 1 and even 14 number",
"line": 20, "line": 8,
"match": { "match": {
"location": "fmt_output_test.go:103" "location": "fmt_output_test.go:103"
}, },
@ -304,7 +304,7 @@
{ {
"keyword": "Given ", "keyword": "Given ",
"name": "passing step", "name": "passing step",
"line": 21, "line": 6,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -316,7 +316,7 @@
{ {
"keyword": "When ", "keyword": "When ",
"name": "passing step", "name": "passing step",
"line": 21, "line": 7,
"match": { "match": {
"location": "fmt_output_test.go:101" "location": "fmt_output_test.go:101"
}, },
@ -328,7 +328,7 @@
{ {
"keyword": "Then ", "keyword": "Then ",
"name": "odd 3 and even 9 number", "name": "odd 3 and even 9 number",
"line": 21, "line": 8,
"match": { "match": {
"location": "fmt_output_test.go:103" "location": "fmt_output_test.go:103"
}, },