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

Unexpected step line values in cucumber report generated by Godog for scenario outlines #604

Closed
katyaaronov opened this issue Jan 24, 2024 Discussed in #603 · 0 comments

Comments

@katyaaronov
Copy link

katyaaronov commented Jan 24, 2024

Discussed in #603

Originally posted by katyaaronov January 24, 2024
The below code from cucumber/godog/fmt_cucumber.go overwrites the line property values of steps in cucumber reports (for Scenario Outlines only, regular Scenarios reports look good).

As a result, the step line property corresponds to the line in the Examples section rather than to the actual location of step within the feature file.

Due to the above, external tools that process the reports and use the line property for sorting the steps, display the steps out of order.

Other officially supported cucumber implementations (java, js, python, etc.) are generating reports correctly for Scenario Outline - line property corresponds to the actual location of step within the file rather than the line in Examples section.

Please advice.

Regards, Katya.

func (f *Cuke) buildCukeStep(pickle *messages.Pickle, stepResult models.PickleStepResult) (cukeStep cukeStep) {

    ...

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

    ...

    cukeStep.Line = int(line)

    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant