testhelpers

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthFlowTriggered = fmt.Errorf("flow triggered")

Functions

func Cmd added in v1.0.0

func CreateClient added in v0.1.41

func CreateClient(ctx context.Context, t testing.TB, project string) gjson.Result

func CreateDefaultAssetsBrowser added in v1.0.0

func CreateDefaultAssetsBrowser() (ctx context.Context, defaultConfig, defaultWorkspaceID string, extraProject, defaultProject *cloud.Project, defaultCmd *cmdx.CommandExecuter)

func CreateProject

func CreateProject(ctx context.Context, t testing.TB, workspace string) *cloud.Project

func CreateWorkspace added in v1.0.0

func CreateWorkspace(ctx context.Context, t testing.TB) string

func FakeAccount added in v1.0.0

func FakeAccount() (email string, password string, name string)

func FakeEmail

func FakeEmail() string

func FakeName

func FakeName() string

func FakePassword

func FakePassword() string

func GetDefaultProjectID added in v1.0.0

func GetDefaultProjectID(ctx context.Context, t testing.TB) string

func ImportIdentity

func ImportIdentity(ctx context.Context, t testing.TB, project string, stdin io.Reader) string

func ListClients added in v1.0.0

func ListClients(ctx context.Context, t testing.TB, project string) gjson.Result

func ListIdentities added in v1.0.0

func ListIdentities(ctx context.Context, t testing.TB, project string) gjson.Result

func ListRelationTuples added in v1.0.0

func ListRelationTuples(ctx context.Context, t testing.TB, project string) gjson.Result

func MakeRandomClient added in v0.1.41

func MakeRandomClient(t testing.TB, name string) string

func MakeRandomIdentity

func MakeRandomIdentity(t testing.TB, email string) string

func NewConfigFile added in v1.0.0

func NewConfigFile(t testing.TB) string

func NewPage added in v1.0.0

func NewPage(t testing.TB, browser playwright.Browser) playwright.Page

func PlaywrightAcceptConsentBrowserHook added in v1.0.0

func PlaywrightAcceptConsentBrowserHook(t testing.TB, page playwright.Page, email, password string) func(uri string) error

func ReadConfig

func ReadConfig(t testing.TB, configDir string) *client.Config

func RegisterAccount

func RegisterAccount(ctx context.Context, t testing.TB) (email, password, name string)

func SetDefaultProject added in v0.2.2

func SetDefaultProject(ctx context.Context, t testing.TB, projectID string)

func SetupPlaywright added in v1.0.0

func SetupPlaywright(t testing.TB) (playwright.Browser, playwright.Page, func())

func TestName added in v1.0.0

func TestName() string

func UseStaging

func UseStaging()

func WithCleanConfigFile added in v1.0.0

func WithCleanConfigFile(ctx context.Context, t testing.TB) context.Context

func WithDuplicatedConfigFile added in v1.0.0

func WithDuplicatedConfigFile(ctx context.Context, t testing.TB, originalFile string) (context.Context, string)

func WithEmitAuthFlowTriggeredErr added in v1.0.0

func WithEmitAuthFlowTriggeredErr(ctx context.Context, t testing.TB) context.Context

Types

type MockTestingTForMain added in v1.0.0

type MockTestingTForMain struct {
	testing.TB
}

MockTestingTForMain is a mock testing.TB implementation that is used in TestMain. Always defer t.ExitOnFailure() in the TestMain function.

func (MockTestingTForMain) Errorf added in v1.0.0

func (MockTestingTForMain) Errorf(format string, args ...interface{})

func (MockTestingTForMain) ExitOnFailure added in v1.0.0

func (MockTestingTForMain) ExitOnFailure()

func (MockTestingTForMain) FailNow added in v1.0.0

func (MockTestingTForMain) FailNow()

func (MockTestingTForMain) Helper added in v1.0.0

func (MockTestingTForMain) Helper()

func (MockTestingTForMain) Log added in v1.0.0

func (MockTestingTForMain) Log(args ...interface{})

func (MockTestingTForMain) Logf added in v1.0.0

func (MockTestingTForMain) Logf(format string, args ...interface{})

func (MockTestingTForMain) Name added in v1.0.0

func (MockTestingTForMain) Name() string

func (MockTestingTForMain) TempDir added in v1.0.0

func (MockTestingTForMain) TempDir() string

Jump to

Keyboard shortcuts

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