Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an authenticated client for a Sourcegraph user for doing e2e testing. The user may or may not be a site admin depends on how the client is instantiated. It works by simulating how the browser would send HTTP requests to the server.
func NewClient ¶
NewClient instantiates a new client by performing a GET request then obtains the CSRF token and cookie from its response, if there is one (old versions of Sourcegraph only). If request- or responseLogger are provided, the request and response bodies, respectively, will be written to them for any GraphQL requests only.
func SiteAdminInit ¶
SiteAdminInit initializes the instance with given admin account. It returns an authenticated client as the admin for doing testing.
func (*Client) CreateAccessToken ¶
CreateAccessToken creates an access token for the current user. An optional token can be passed to impersonate other users.
func (*Client) CurrentUserID ¶
CurrentUserID returns the current authenticated user's GraphQL node ID. An optional token can be passed to impersonate other users.