api

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient  *http.Client
	APIEndpoint string
	JWT         string
	UserAgent   string
}

Client represents the API client

func NewClient

func NewClient(apiEndpoint string, jwtToken string) *Client

NewClient returns a new initialized API client

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

func (c *Client) DownloadTestCaseDefinition(uid string) (bool, []byte, error)

DownloadTestCaseDefinition returns the JS definition of a given test case

func (*Client) FetchResource added in v0.17.0

func (c *Client) FetchResource(path string) (bool, []byte, error)

FetchResource tries to download a given resource from the API

func (*Client) FetchTestRun added in v0.17.0

func (c *Client) FetchTestRun(uid string) (bool, []byte, error)

FetchTestRun will show some basic information on a given test run

func (*Client) Har

func (c *Client) Har(fileName string, data io.Reader) (string, error)

Har converts the given HAR archive file into a StormForger test case definition

func (*Client) ListFileFixture added in v0.3.0

func (c *Client) ListFileFixture(organization string) (bool, []byte, error)

ListFileFixture returns a list of the organizations fixtures

func (*Client) ListOrganisations added in v0.3.0

func (c *Client) ListOrganisations() ([]byte, error)

ListOrganisations returns a list of organisations

func (*Client) ListTestCases added in v0.6.0

func (c *Client) ListTestCases(organization string) (bool, []byte, error)

ListTestCases returns a list of test cases

func (*Client) Login added in v0.0.2

func (c *Client) Login(email string, password string) (string, error)

Login acquires a JWT access token for the given email/password

func (*Client) LookupAndFetchResource added in v0.17.0

func (c *Client) LookupAndFetchResource(resourceType string, input string) (bool, []byte, error)

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

func (c *Client) Ping() (bool, error)

Ping performs an authenticated ping to check if the API is working and the user is properly authenticated.

FIXME would be nice to return a struct

where we see the status and in case of
success also the email address of the
authenticated user (useful) to check
if we are authenticated as the correct user

func (*Client) PushFileFixture added in v0.3.0

func (c *Client) PushFileFixture(fileName string, data io.Reader, organization string, params *FileFixtureParams) (bool, string, error)

PushFileFixture uploads (insert or update) a file fixture

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) 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

func (c *Client) TestRunAbort(testRunUID string) (bool, string, error)

TestRunAbort will send a test case definition (JS) to the API to update an existing test case it.

func (*Client) TestRunCallLog added in v0.2.0

func (c *Client) TestRunCallLog(pathID string, preview bool) (io.ReadCloser, error)

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

func (c *Client) TestRunList(testCaseUID string) (bool, []byte, error)

TestRunList will list all test runs for a given test case

func (*Client) TestRunNfrCheck added in v0.21.0

func (c *Client) TestRunNfrCheck(uid string, fileName string, data io.Reader) (bool, []byte, error)

TestRunNfrCheck will upload requirements definition and checks if the given test run matches them.

func (*Client) TestRunWatch added in v0.6.0

func (c *Client) TestRunWatch(uid string) (testrun.TestRun, string, error)

TestRunWatch will show some basic information on a given test run

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 TestRunLaunchOptions added in v0.24.0

type TestRunLaunchOptions struct {
	Title       string
	Notes       string
	DisableGzip bool
	SkipWait    bool
	DumpTraffic bool
}

TestRunLaunchOptions represents a single TestRunLaunchOptions

type TestRunResources added in v0.17.0

type TestRunResources struct {
	UID          string
	Organisation string
	TestCase     string
	SequenceID   string
}

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"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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