package steps import ( "DanceLessonsCoach/pkg/bdd/testserver" "fmt" "github.com/cucumber/godog" ) // StepContext holds the test client and implements all step definitions type StepContext struct { client *testserver.Client } // NewStepContext creates a new step context func NewStepContext(client *testserver.Client) *StepContext { return &StepContext{client: client} } // InitializeAllSteps registers all step definitions for the BDD tests func InitializeAllSteps(ctx *godog.ScenarioContext, client *testserver.Client) { sc := NewStepContext(client) fmt.Println("DEBUG: InitializeAllSteps called") ctx.Step(`^I request a greeting for "([^"]*)"$`, sc.iRequestAGreetingFor) ctx.Step(`^I request the default greeting$`, sc.iRequestTheDefaultGreeting) ctx.Step(`^I request the health endpoint$`, sc.iRequestTheHealthEndpoint) ctx.Step(`^the response should be "{\\"([^"]*)":\\"([^"]*)"}"$`, sc.theResponseShouldBe) ctx.Step(`^the server is running$`, sc.theServerIsRunning) } func (sc *StepContext) iRequestAGreetingFor(arg1 string) error { return godog.ErrPending } func (sc *StepContext) iRequestTheDefaultGreeting() error { return godog.ErrPending } func (sc *StepContext) iRequestTheHealthEndpoint() error { return godog.ErrPending } func (sc *StepContext) theResponseShouldBe(arg1, arg2 string) error { expected := fmt.Sprintf(`{"%s":"%s"}`, arg1, arg2) return sc.client.ExpectResponseBody(expected) } func (sc *StepContext) theServerIsRunning() error { return godog.ErrPending }