Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org).
This document is formatted according to the principles of [Keep A CHANGELOG](http://keepachangelog.com).

## 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]
### Added
- Support for reading feature files from an `fs.FS` ([550](https://github.com/cucumber/godog/pull/550) - [tigh-latte](https://github.com/tigh-latte))
Expand Down
4 changes: 2 additions & 2 deletions features/formatter/cucumber.feature
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Feature: cucumber json formatter
{
"keyword": "Given ",
"name": "passing step",
"line": 11,
"line": 7,
"match": {
"location": "suite_context.go:64"
},
Expand All @@ -345,7 +345,7 @@ Feature: cucumber json formatter
{
"keyword": "Given ",
"name": "failing step",
"line": 12,
"line": 7,
"match": {
"location": "suite_context.go:47"
},
Expand Down
4 changes: 0 additions & 4 deletions internal/formatters/fmt_cucumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,6 @@ func (f *Cuke) buildCukeStep(pickle *messages.Pickle, stepResult models.PickleSt
step := feature.FindStep(pickleStep.AstNodeIds[0])

line := step.Location.Line
if len(pickle.AstNodeIds) == 2 {
_, row := feature.FindExample(pickle.AstNodeIds[1])
line = row.Location.Line
}

cukeStep.Name = pickleStep.Text
cukeStep.Line = int(line)
Expand Down
30 changes: 15 additions & 15 deletions internal/formatters/formatter-tests/cucumber/scenario_outline
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
{
"keyword": "Given ",
"name": "passing step",
"line": 13,
"line": 6,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -58,7 +58,7 @@
{
"keyword": "When ",
"name": "passing step",
"line": 13,
"line": 7,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -70,7 +70,7 @@
{
"keyword": "Then ",
"name": "odd 1 and even 2 number",
"line": 13,
"line": 8,
"match": {
"location": "fmt_output_test.go:103"
},
Expand Down Expand Up @@ -110,7 +110,7 @@
{
"keyword": "Given ",
"name": "passing step",
"line": 14,
"line": 6,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -122,7 +122,7 @@
{
"keyword": "When ",
"name": "passing step",
"line": 14,
"line": 7,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -134,7 +134,7 @@
{
"keyword": "Then ",
"name": "odd 2 and even 0 number",
"line": 14,
"line": 8,
"match": {
"location": "fmt_output_test.go:103"
},
Expand Down Expand Up @@ -175,7 +175,7 @@
{
"keyword": "Given ",
"name": "passing step",
"line": 15,
"line": 6,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -187,7 +187,7 @@
{
"keyword": "When ",
"name": "passing step",
"line": 15,
"line": 7,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -199,7 +199,7 @@
{
"keyword": "Then ",
"name": "odd 3 and even 11 number",
"line": 15,
"line": 8,
"match": {
"location": "fmt_output_test.go:103"
},
Expand Down Expand Up @@ -240,7 +240,7 @@
{
"keyword": "Given ",
"name": "passing step",
"line": 20,
"line": 6,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -252,7 +252,7 @@
{
"keyword": "When ",
"name": "passing step",
"line": 20,
"line": 7,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -264,7 +264,7 @@
{
"keyword": "Then ",
"name": "odd 1 and even 14 number",
"line": 20,
"line": 8,
"match": {
"location": "fmt_output_test.go:103"
},
Expand Down Expand Up @@ -304,7 +304,7 @@
{
"keyword": "Given ",
"name": "passing step",
"line": 21,
"line": 6,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -316,7 +316,7 @@
{
"keyword": "When ",
"name": "passing step",
"line": 21,
"line": 7,
"match": {
"location": "fmt_output_test.go:101"
},
Expand All @@ -328,7 +328,7 @@
{
"keyword": "Then ",
"name": "odd 3 and even 9 number",
"line": 21,
"line": 8,
"match": {
"location": "fmt_output_test.go:103"
},
Expand Down
Loading