Skip to content

Using godog flags with TestMain and Subtests #495

Answered by vearutop
lburgazzoli asked this question in Q&A
Discussion options

You must be logged in to vote

Based on the example https://github.com/cucumber/godog/blob/v0.12.5/_examples/godogs/godogs_test.go the test could be as follows.

godogs_test.go

package main // Package does not have to be main, these tests can live in other package as well.

import (
	"github.com/cucumber/godog"
	"github.com/cucumber/godog/colors"
)

// This example shows how to set up test suite runner with Go subtests and godog command line parameters.
// Sample commands:
// * run all scenarios from default directory (features): go test -test.run "^TestFeatures/"
// * run all scenarios and list subtest names: go test -test.v -test.run "^TestFeatures/"
// * run all scenarios from one feature file: go test -test.v -godog…

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
8 replies
@vearutop
Comment options

@lburgazzoli
Comment options

@vearutop
Comment options

@lburgazzoli
Comment options

@vearutop
Comment options

Answer selected by lburgazzoli
Comment options

You must be logged in to vote
2 replies
@vearutop
Comment options

@lburgazzoli
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants