framework

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2020 License: MIT Imports: 50 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootUserId = "root@e2e.f110.dev"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

func (*Agent) FollowRedirect added in v0.10.0

func (a *Agent) FollowRedirect(m *Matcher) error

func (*Agent) Get

func (a *Agent) Get(m *Matcher, u string)

func (*Agent) ParseLastResponseBody added in v0.10.0

func (a *Agent) ParseLastResponseBody(in interface{}) error

func (*Agent) Post added in v0.10.0

func (a *Agent) Post(m *Matcher, u, body string)

func (*Agent) SaveCookie added in v0.10.0

func (a *Agent) SaveCookie()

type Agents

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

func NewAgents

func NewAgents(domain string, ca *x509.Certificate, sessionStore *session.SecureCookieStore) *Agents

func (*Agents) Authorized

func (a *Agents) Authorized(id string) *Agent

Authorized returns the agent for authorized user. This agent uses the cookie secret.

func (*Agents) DecodeCookieValue added in v0.10.0

func (a *Agents) DecodeCookieValue(name, value string) (*session.Session, error)

func (*Agents) Unauthorized

func (a *Agents) Unauthorized() *Agent

func (*Agents) User added in v0.10.0

func (a *Agents) User(id string) *Agent

User returns the agent for user. This agent is not authorized initially. If called by same id, then returns the same agent. User is caching the agent, Authorized creates the agent by each call.

type AuthResponse added in v0.10.0

type AuthResponse struct {
	Query    string
	LoginURL string
}

type Case

type Case struct {
	Name string
	// contains filtered or unexported fields
}

func NewCase

func NewCase(t *testing.T, s *Scenario, name string, depth int, fn func(m *Matcher), before, after func(*Matcher), route string) *Case

type Connector added in v0.11.0

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

func NewConnector added in v0.11.0

func NewConnector(name string, m *MockServer, proxyCACert *x509.Certificate) (*Connector, error)

func (*Connector) Start added in v0.11.0

func (c *Connector) Start(client *rpcclient.ClientWithUserToken, host, serverName string) error

func (*Connector) Stop added in v0.11.0

func (c *Connector) Stop() error

type Framework

type Framework struct {
	Proxy  *Proxy
	Agents *Agents
	// contains filtered or unexported fields
}

func New

func New(t *testing.T) *Framework

func (*Framework) Describe

func (f *Framework) Describe(name string, fn func(s *Scenario))

func (*Framework) Execute

func (f *Framework) Execute()

type HttpResponse added in v0.10.0

type HttpResponse struct {
	*http.Response
}

func (*HttpResponse) FindCookie added in v0.10.0

func (h *HttpResponse) FindCookie(name string) *http.Cookie

type IdentityProvider

type IdentityProvider struct {
	*http.Server
	Issuer     string
	PrivateKey *rsa.PrivateKey
	// contains filtered or unexported fields
}

func NewIdentityProvider

func NewIdentityProvider() (*IdentityProvider, error)

type Matcher

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

func NewMatcher

func NewMatcher(t *testing.T, route string) *Matcher

func (*Matcher) Contains added in v0.10.0

func (m *Matcher) Contains(s, contains interface{}, msgAndArgs ...interface{})

func (*Matcher) Empty added in v0.10.0

func (m *Matcher) Empty(object interface{}, msgAndArgs ...interface{})

func (*Matcher) Equal

func (m *Matcher) Equal(expected, actual interface{}, msgAndArgs ...interface{})

func (*Matcher) Fail

func (m *Matcher) Fail(msg ...string)

func (*Matcher) Failf

func (m *Matcher) Failf(format string, args ...interface{})

func (*Matcher) False added in v0.10.0

func (m *Matcher) False(value bool, msgAndArgs ...interface{})

func (*Matcher) LastResponse

func (m *Matcher) LastResponse() *HttpResponse

func (*Matcher) Len added in v0.11.0

func (m *Matcher) Len(object interface{}, len int, msgAndArgs ...interface{})

func (*Matcher) Log

func (m *Matcher) Log(msg string)

func (*Matcher) Logf

func (m *Matcher) Logf(format string, args ...interface{})

func (*Matcher) MockServer added in v0.11.0

func (m *Matcher) MockServer(name string) *MockServer

func (*Matcher) Must

func (m *Matcher) Must(err error)

func (*Matcher) NoError

func (m *Matcher) NoError(err error, msg ...string)

func (*Matcher) NotEmpty added in v0.10.0

func (m *Matcher) NotEmpty(object interface{}, msgAndArgs ...interface{})

func (*Matcher) NotNil added in v0.10.0

func (m *Matcher) NotNil(object interface{}, msg ...string)

func (*Matcher) ResetConnection

func (m *Matcher) ResetConnection()

func (*Matcher) StatusCode added in v0.10.0

func (m *Matcher) StatusCode(code int, msgAndArgs ...interface{})

func (*Matcher) True added in v0.10.0

func (m *Matcher) True(value bool, msgAndArgs ...interface{})

type MockServer added in v0.11.0

type MockServer struct {
	Port int
	// contains filtered or unexported fields
}

func NewMockServer added in v0.11.0

func NewMockServer() (*MockServer, error)

func (*MockServer) Requests added in v0.11.0

func (s *MockServer) Requests() []*http.Request

func (*MockServer) Start added in v0.11.0

func (s *MockServer) Start() error

func (*MockServer) Stop added in v0.11.0

func (s *MockServer) Stop() error

type Proxy

type Proxy struct {
	Domain     string
	DomainHost string
	CA         *x509.Certificate
	// contains filtered or unexported fields
}

func NewProxy

func NewProxy(t *testing.T) (*Proxy, error)

func (*Proxy) Backend

func (p *Proxy) Backend(b *configv2.Backend)

func (*Proxy) Cleanup

func (p *Proxy) Cleanup() error

func (*Proxy) ClearConf added in v0.11.0

func (p *Proxy) ClearConf()

func (*Proxy) Connector added in v0.11.0

func (p *Proxy) Connector(name string, m *MockServer)

func (*Proxy) DashboardBackend added in v0.11.0

func (p *Proxy) DashboardBackend() *configv2.Backend

func (*Proxy) MockServer added in v0.11.0

func (p *Proxy) MockServer(m *Matcher, name string) *MockServer

func (*Proxy) RPCPermission added in v0.11.0

func (p *Proxy) RPCPermission(v *configv2.RPCPermission)

func (*Proxy) Reload

func (p *Proxy) Reload() error

func (*Proxy) Role

func (p *Proxy) Role(r *configv2.Role)

func (*Proxy) URL added in v0.10.0

func (p *Proxy) URL(subdomain string, pathAnd ...string) string

func (*Proxy) User

func (p *Proxy) User(u *database.User)

type Scenario

type Scenario struct {
	Name string
	// contains filtered or unexported fields
}

func NewScenario

func NewScenario(t *testing.T, parent *Scenario, name string, depth int, fn func(s *Scenario), route string) *Scenario

func (*Scenario) AfterAll

func (f *Scenario) AfterAll(fn func(m *Matcher))

func (*Scenario) AfterEach

func (f *Scenario) AfterEach(fn func(m *Matcher))

func (*Scenario) BeforeAll

func (f *Scenario) BeforeAll(fn func(m *Matcher))

func (*Scenario) BeforeEach

func (f *Scenario) BeforeEach(fn func(m *Matcher))

func (*Scenario) Context

func (f *Scenario) Context(name string, fn func(s *Scenario))

func (*Scenario) Defer

func (f *Scenario) Defer(fn func())

func (*Scenario) It

func (f *Scenario) It(name string, fn func(m *Matcher))

func (*Scenario) Step added in v0.10.0

func (f *Scenario) Step(name string, fn func(s *Scenario))

func (*Scenario) Subject

func (f *Scenario) Subject(fn func(m *Matcher))

Jump to

Keyboard shortcuts

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