diff --git a/steps/common/steps.go b/steps/common/steps.go index 944e9511..b4a6afb8 100755 --- a/steps/common/steps.go +++ b/steps/common/steps.go @@ -68,10 +68,11 @@ func (cs Steps) InitializeSteps(ctx context.Context, scenCtx *godog.ScenarioCont golium.GetContext(ctx).Put(golium.ValueAsString(ctx, key), ip) return nil }) - scenCtx.Step(`^I store domain "([^"]*)" ip in context "([^"]*)"$`, func(domain, key string) error { - if domain == "" { + scenCtx.Step(`^I store domain "([^"]*)" ip in context "([^"]*)"$`, func(domainParam, key string) error { + if domainParam == "" { return nil } + domain := golium.ValueAsString(ctx, domainParam) command := fmt.Sprintf("ping -c 1 %s | head -1 | grep -oe '[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]'", domain) cmd := exec.Command("/bin/sh", "-c", command) stdoutStderr, err := cmd.CombinedOutput()