v1.0.0
Initial port of github.com/jaypipes/gdt-core
and github.com/jaypipes/gdt
merged into a single package.
To use gdt
, define your tests in a YAML file or a directory containing YAML files, use the gdt.From()
method to create a runnable test suite or scenario and then Run()
it:
package mypackage_test
import (
"context"
"path/filepath"
"testing"
"github.com/gdt-dev/gdt"
"github.com/stretchr/testify/require"
)
func TestRunASuite(t *testing.T) {
require := assert.New(t)
fp := filepath.Join("suite", "testdata", "exec")
s, err := gdt.From(fp)
require.Nil(err)
s.Run(context.TODO(), t)
}
func TestRunOneScenario(t *testing.T) {
require := require.New(t)
fp := filepath.Join("suite", "testdata", "exec", "ls.yaml")
s, err := gdt.From(fp)
require.Nil(err)
s.Run(context.TODO(), t)
}