Skip to content

Function .After() is called before fuction StepContext().After() #434

@leonbergr

Description

@leonbergr

What version of godog are you using?

> Godog version is: v0.12.1

What version of Go are you using?

> go version go1.17 linux/amd64

What did you do?

I have this setup (pseudo code):

s.After(func(){ fmt.Println("After scenario") })
s.Stepcontext().After(func() { fmt.Println("After step") })

What did you expect to see?

...
After step
After step
After step
After scenario

What did you see instead?

...
After step
After step
After scenario
After step

Additional context

It is probably caused by this:

godog/suite.go

Lines 108 to 110 in 239a424

if (err == nil && isLast) || err != nil {
rctx, err = s.runAfterScenarioHooks(rctx, pickle, err)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions