Help us shape the future of Go! Take the 2026 Go Developer Survey

gobdd

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2019 License: MIT Imports: 16 Imported by: 3

README

GOBDD

GoDoc Coverage Status

This is a BDD testing framework. Uses gherkin for the test's syntax. Project is under active development.

More detailed documentation can be found on the docs page: https://go-bdd.github.io/doc/

Contributing

All contributions are very much welcome. If you'd like to help with GoBDD development, please see open issues and submit your pull request via GitHub.

Support

If you didn't find the answer to your question in the documentation, feel free to ask us directly!

Please join us on the #go-bdd-library channel on the Gophers slack: You can get an invite here. You can find updates about the progress on Twiter: GoBdd.

Documentation

Overview

This project is created as the alternative to https://github.com/DATA-DOG/godog and is inspirited by it. There are a few differences between both solutions:

- GoBDD uses the built-in testing framework

- GoBDD is run as standard test case (not a separate program)

- you can use every Go native feature like build tags, pprof and so on

- the context in every test case contains all the required information to run (values passed from previous steps or step parameters). More information can be found in the readme file https://github.com/go-bdd/gobdd/blob/master/README.md

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Suite

type Suite struct {
	// contains filtered or unexported fields
}

Holds all the information about the suite (options, steps to execute etc)

func NewSuite

func NewSuite(t *testing.T, options SuiteOptions) *Suite

Creates a new suites with given configuration and empty steps defined

func (*Suite) AddStep

func (s *Suite) AddStep(step interface{}, f step.Func) error

Adds a step to the suite The first parameter is the step definition which can be:

* string which will be converted to a regexp * [] byte which will be converted to a regexp as well * regexp

No other types are supported

The second parameter is a function which will be executed when while running a scenario one of the steps will match the given pattern

func (*Suite) Run

func (s *Suite) Run()

Executes the suite with given options and defined steps

type SuiteOptions

type SuiteOptions struct {
	// contains filtered or unexported fields
}

Holds all the information about how the suite or features/steps should be configured

func NewSuiteOptions

func NewSuiteOptions() SuiteOptions

NewSuiteOptions creates a new suite configuration with default values

func (SuiteOptions) WithFeaturesPath

func (options SuiteOptions) WithFeaturesPath(path string) SuiteOptions

Configures a pattern (regexp) where feature can be found. The default value is "features/*.feature"

func (SuiteOptions) WithIgnoredTags

func (options SuiteOptions) WithIgnoredTags(tags []string) SuiteOptions

Configures which tags should be skipped while executing a suite Every tag has to start with @

func (SuiteOptions) WithTags

func (options SuiteOptions) WithTags(tags []string) SuiteOptions

Configures which tags should be skipped while executing a suite Every tag has to start with @

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL