Suite’s options

The suite can be confiugred using one of these functions:

Usage

Here are some examples of the usage of those functions:

suite := NewSuite(t, WithFeaturesPath("features/func_types.feature"))
suite := NewSuite(t, WithFeaturesPath("features/tags.feature"), WithTags([]string{"@tag"}))

As of Go 1.16 you can embed feature files into the test binary and use fs.FS as a feature source:

import (
	"embed"
)

//go:embed features/*.feature
var featuresFS embed.FS

// ...

suite := NewSuite(t, WithFeaturesFS(featuresFS, "*.feature"))

While in most cases it doesn’t make any difference, embedding feature files makes your tests more portable.