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

Before and After scenario not in proper order #1003

Open
msche opened this issue Nov 1, 2023 · 1 comment
Open

Before and After scenario not in proper order #1003

msche opened this issue Nov 1, 2023 · 1 comment

Comments

@msche
Copy link

msche commented Nov 1, 2023

When I execute the following example in Intelij:

import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.gherkin.Feature

object Spek2Test : Spek({

    Feature("Test before and after each scenario") {
        beforeFeature {
            println("Before Feature")
        }

        afterFeature {
            println("After feature")
        }

        beforeEachScenario {
            println("before scenario")
        }

        afterEachScenario {
            println("after scenario")
        }

        Scenario("Do something") {
            println("Scenario")
        }

        Scenario("Do something else") {
            println("Other Scenario")
        }
    }
})

I see the following output in my console:

Testing started at 06:48 ...
Scenario
Other Scenario


Before Feature
before scenario

before scenario
after scenario


before scenario
after scenario

After feature
after scenario



Process finished with exit code 0

This doesn't seem correct, I would have expected something like:

Before Feature

before scenario
Scenario
after scenario

before scenario
Other Scenario
after scenario

After feature

What am I doing wrong?

@msche
Copy link
Author

msche commented Nov 4, 2023

Any update on this?

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

No branches or pull requests

1 participant