Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateServiceAccount(org, token_label string) (bool, string, error)
- func (c *Client) DeleteFileFixture(fileFixtureUID string, organization string) (bool, string, error)
- func (c *Client) DownloadFileFixture(organization string, fileFixtureUID string, version string) (bool, []byte, error)
- func (c *Client) DownloadTestCaseDefinition(uid string) (bool, []byte, error)
- func (c *Client) FetchResource(path string) (bool, []byte, error)
- func (c *Client) FetchTestRun(uid string) (bool, []byte, error)
- func (c *Client) Har(fileName string, data io.Reader) (string, error)
- func (c *Client) ListFileFixture(organization string) (bool, []byte, error)
- func (c *Client) ListOrganisations() (bool, []byte, error)
- func (c *Client) ListServiceAccounts(org string) (bool, []byte, error)
- func (c *Client) ListTestCases(organization string, filter string) (bool, []byte, error)
- func (c *Client) Login(email string, password string) (string, error)
- func (c *Client) LookupAndFetchResource(resourceType, input string) (bool, []byte, error)
- func (c *Client) MoveFileFixture(organization string, fileFixtureUID string, newName string) (bool, string, error)
- func (c *Client) Ping() (bool, []byte, error)
- func (c *Client) PingUnauthenticated() (bool, []byte, error)
- func (c *Client) PushFileFixture(fileName string, data io.Reader, organization string, ...) (bool, []byte, error)
- func (c *Client) TestCaseArchive(uid string) (bool, []byte, error)
- func (c *Client) TestCaseCreate(organization string, testCaseName string, fileName string, data io.Reader) (bool, string, error)
- func (c *Client) TestCaseUnArchive(uid string) (bool, []byte, error)
- func (c *Client) TestCaseUpdate(testCaseUID string, fileName string, data io.Reader) (bool, string, error)
- func (c *Client) TestCaseValidate(organization string, fileName string, data io.Reader) (bool, string, error)
- func (c *Client) TestRunAbort(testRunUID string) (bool, string, error)
- func (c *Client) TestRunAbortAll(organisationUID string) (bool, string, error)
- func (c *Client) TestRunArchive(testRunUID string) (bool, []byte, error)
- func (c *Client) TestRunCallLog(pathID string, preview bool) (io.ReadCloser, error)
- func (c *Client) TestRunCreate(testCaseUID string, options TestRunLaunchOptions) (bool, string, error)
- func (c *Client) TestRunDump(pathID string) (io.ReadCloser, error)
- func (c *Client) TestRunList(testCaseUID string, filter string) (bool, []byte, error)
- func (c *Client) TestRunLogs(path string) (io.ReadCloser, error)
- func (c *Client) TestRunNfrCheck(uid string, fileName string, data io.Reader) (bool, []byte, error)
- func (c *Client) TestRunShareURL(ctx context.Context, testRunUID string, expireDuration time.Duration) (*testrun.TestRunShareUrlResponse, error)
- func (c *Client) TestRunUnArchive(testRunUID string) (bool, []byte, error)
- func (c *Client) TestRunUserLog(pathID string) (io.ReadCloser, error)
- func (c *Client) TestRunWatch(uid string) (testrun.TestRun, string, error)
- type ErrorDecoder
- type ErrorDetail
- type ErrorPayload
- type EvaluationErrorMeta
- type EvaluationStackFrame
- type FileFixtureParams
- type Links
- type Meta
- type TestRunLaunchOptions
- type TestRunResources
- type User
Constants ¶
const ( UserTypeServiceAccount = "service-account" UserTypeUser = "user" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents the API client
func (*Client) CreateServiceAccount ¶ added in v0.44.0
func (*Client) DeleteFileFixture ¶ added in v0.3.0
func (c *Client) DeleteFileFixture(fileFixtureUID string, organization string) (bool, string, error)
DeleteFileFixture deletes a file fixture
func (*Client) DownloadFileFixture ¶ added in v0.3.0
func (c *Client) DownloadFileFixture(organization string, fileFixtureUID string, version string) (bool, []byte, error)
DownloadFileFixture retrieves the originally uploaded file
func (*Client) DownloadTestCaseDefinition ¶ added in v0.14.0
DownloadTestCaseDefinition returns the JS definition of a given test case
func (*Client) FetchResource ¶ added in v0.17.0
FetchResource tries to download a given resource from the API
func (*Client) FetchTestRun ¶ added in v0.17.0
FetchTestRun will show some basic information on a given test run
func (*Client) Har ¶
Har converts the given HAR archive file into a StormForger test case definition
func (*Client) ListFileFixture ¶ added in v0.3.0
ListFileFixture returns a list of the organizations fixtures
func (*Client) ListOrganisations ¶ added in v0.3.0
ListOrganisations returns a list of organisations
func (*Client) ListServiceAccounts ¶ added in v0.44.0
ListServiceAccounts returns a list of organisations
func (*Client) ListTestCases ¶ added in v0.6.0
ListTestCases returns a list of test cases
func (*Client) Login ¶ added in v0.0.2
Login acquires a JWT access token for the given email/password
func (*Client) LookupAndFetchResource ¶ added in v0.17.0
LookupAndFetchResource tries to download a given resource from the API
func (*Client) MoveFileFixture ¶ added in v0.3.0
func (c *Client) MoveFileFixture(organization string, fileFixtureUID string, newName string) (bool, string, error)
MoveFileFixture renames a filefixtures
func (*Client) Ping ¶
Ping performs an authenticated ping to check if the API is working and the user is properly authenticated.
func (*Client) PingUnauthenticated ¶ added in v0.29.0
PingUnauthenticated performs an unauthenticated ping. This can be used to see if a connection is possible and/or the API is up in general.
func (*Client) PushFileFixture ¶ added in v0.3.0
func (c *Client) PushFileFixture(fileName string, data io.Reader, organization string, params *FileFixtureParams) (bool, []byte, error)
PushFileFixture uploads (insert or update) a file fixture
func (*Client) TestCaseArchive ¶ added in v0.48.0
TestCaseArchive will mark a test case as archived
func (*Client) TestCaseCreate ¶ added in v0.6.0
func (c *Client) TestCaseCreate(organization string, testCaseName string, fileName string, data io.Reader) (bool, string, error)
TestCaseCreate will send a test case definition (JS) to the API to create it.
func (*Client) TestCaseUnArchive ¶ added in v0.48.0
TestCaseUnArchive will mark a test case as not archived
func (*Client) TestCaseUpdate ¶ added in v0.6.0
func (c *Client) TestCaseUpdate(testCaseUID string, fileName string, data io.Reader) (bool, string, error)
TestCaseUpdate will send a test case definition (JS) to the API to update an existing test case it.
func (*Client) TestCaseValidate ¶ added in v0.4.0
func (c *Client) TestCaseValidate(organization string, fileName string, data io.Reader) (bool, string, error)
TestCaseValidate will send a test case definition (JS) to the API to validate.
func (*Client) TestRunAbort ¶ added in v0.6.0
TestRunAbort will send a test case definition (JS) to the API to update an existing test case it.
func (*Client) TestRunAbortAll ¶ added in v0.46.0
TestRunAbortAll sends a request to abort all running test cases.
func (*Client) TestRunArchive ¶ added in v0.48.0
TestRunArchive marks a given test run as archived.
func (*Client) TestRunCallLog ¶ added in v0.2.0
TestRunCallLog will download the first 10k lines of the test run's call log
func (*Client) TestRunCreate ¶ added in v0.6.0
func (c *Client) TestRunCreate(testCaseUID string, options TestRunLaunchOptions) (bool, string, error)
TestRunCreate will send a test case definition (JS) to the API to update an existing test case it.
func (*Client) TestRunDump ¶ added in v0.20.0
func (c *Client) TestRunDump(pathID string) (io.ReadCloser, error)
TestRunDump will fetch a traffic dump for a given test run if it is available.
func (*Client) TestRunList ¶ added in v0.6.0
TestRunList will list all test runs for a given test case
func (*Client) TestRunLogs ¶ added in v0.29.0
func (c *Client) TestRunLogs(path string) (io.ReadCloser, error)
TestRunLogs will download logs from the given path. It will also handle compression accordingly.
func (*Client) TestRunNfrCheck ¶ added in v0.21.0
TestRunNfrCheck will upload requirements definition and checks if the given test run matches them.
func (*Client) TestRunShareURL ¶ added in v0.51.0
func (c *Client) TestRunShareURL(ctx context.Context, testRunUID string, expireDuration time.Duration) (*testrun.TestRunShareUrlResponse, error)
TestRunShareURL requests a shareable URL. A positive expireDuration is passed to the remote server.
func (*Client) TestRunUnArchive ¶ added in v0.48.0
TestRunUnArchive marks a given test run as not archived.
func (*Client) TestRunUserLog ¶ added in v0.29.0
func (c *Client) TestRunUserLog(pathID string) (io.ReadCloser, error)
TestRunUserLog will download the user logs
type ErrorDecoder ¶ added in v0.42.0
type ErrorDecoder struct {
SourceMapper esbundle.SourceMapper
}
func (ErrorDecoder) UnmarshalErrorMeta ¶ added in v0.42.0
func (dec ErrorDecoder) UnmarshalErrorMeta(input io.Reader) (ErrorPayload, error)
UnmarshalErrorMeta will take the response (io.Reader) and will extract JSONAPI errors.
type ErrorDetail ¶ added in v0.33.0
type ErrorDetail struct { Code string `json:"code"` Title string `json:"title"` Detail string `json:"detail"` MetaRaw json.RawMessage `json:"meta"` FormattedError string }
ErrorDetail holds data on a specific JSONAPI error
type ErrorPayload ¶ added in v0.31.0
type ErrorPayload struct { Message string `json:"message"` Errors []ErrorDetail `json:"errors"` }
ErrorPayload holds the list of returned JSONAPI errors
type EvaluationErrorMeta ¶ added in v0.31.0
type EvaluationErrorMeta struct { Message string `json:"message"` RawStack string `json:"raw_stack"` Name string `json:"name"` Stack []EvaluationStackFrame `json:"stack"` }
EvaluationErrorMeta holds meta data on JS Evaluation errors
func (EvaluationErrorMeta) String ¶ added in v0.31.0
func (e EvaluationErrorMeta) String() string
type EvaluationStackFrame ¶ added in v0.31.0
type EvaluationStackFrame struct { Context string `json:"context"` File string `json:"file"` Line int `json:"line"` Column int `json:"column"` Eval bool `json:"eval"` Anonymous bool `json:"anonymous"` Internal bool `json:"internal"` }
EvaluationStackFrame represents a stack frame returned by evaluation errors
type FileFixtureParams ¶ added in v0.3.0
type FileFixtureParams struct { Name string Type string FieldNames string Delimiter string FirstRowHeaders bool }
FileFixtureParams represents params BLA TODO
type Links ¶ added in v0.28.0
type Links struct { Self string `json:"self"` SelfWeb string `json:"self_web"` TestCase string `json:"test_case"` }
Links holds JSONAPI links
type Meta ¶ added in v0.28.0
type Meta struct {
Links *Links `json:"links"`
}
Meta holds meta data of a JSONApi response. Currently only "links" are extracted.
type TestRunLaunchOptions ¶ added in v0.24.0
type TestRunLaunchOptions struct { Title string Notes string JavascriptDefinition struct { Filename string Reader io.Reader } ClusterRegion string ClusterSizing string DisableGzip bool SkipWait bool DumpTraffic bool SessionValidationMode bool Labels map[string]string }
TestRunLaunchOptions represents a single TestRunLaunchOptions
type TestRunResources ¶ added in v0.17.0
TestRunResources describes infos on a test run
func ExtractTestRunResources ¶ added in v0.17.0
func ExtractTestRunResources(ref string) TestRunResources
ExtractTestRunResources will try to extract information to the given test run based on a "reference".
Currently as "reference" a part of the forge URL is used. This contains the organisation, test case and the sequence id of the test run. Example: "foo/demo/test_runs/19"