execution

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: GPL-3.0 Imports: 21 Imported by: 1

Documentation

Overview

Package execution handles the execution of cases and sequences.

This includes showing the templates for the different parts of the execution (start page, step page, summary page), saving the results of a step and the protocol of the completed execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaseExecutionPost

func CaseExecutionPost(protocolLister test.ProtocolLister, caseProtocolStore CaseProtocolStore,

	sequenceProtocolAdder SequenceProtocolAdder,
	progress progressMeter, testSequenceVersion *test.SequenceVersion, testCaseGetter handler.TestCaseGetter,
	testCaseLister handler.TestCaseLister, listAdder handler.TaskListAdder, listGetter handler.TaskListGetter,
	activityStore handler.Activities, issueGetter handler.IssueGetter, issueAdder handler.IssueAdder) http.HandlerFunc

CaseExecutionPost handles all post requests during a testcase execution. It is a meta handler that further calls it's sub handlers.

func CaseStartPageGet

func CaseStartPageGet() http.HandlerFunc

CaseStartPageGet serves the start page for testcase executions.

func GetCurrentSequenceProtocol added in v1.5.0

func GetCurrentSequenceProtocol(r *http.Request) (*test.SequenceExecutionProtocol, error)

GetCurrentSequenceProtocol returns the protocol to the currently running sequence execution to the given request. If there is no sequence execution running, the function will return nil, nil If an error occurs nil and the error will be returned

func SequenceExecutionPost

func SequenceExecutionPost(caseProtocolLister test.ProtocolLister,
	caseProtocolStore CaseProtocolStore, sequenceProtocolAdder SequenceProtocolAdder, tcg handler.TestCaseGetter,
	caseLister handler.TestCaseLister, taskAdder handler.TaskListAdder, taskGetter handler.TaskListGetter,
	activityStore handler.Activities, issueGetter handler.IssueGetter, issueAdder handler.IssueAdder) http.HandlerFunc

SequenceExecutionPost returns a handler capable of handling every request during the execution of a sequence.

func SequenceExecutionPut added in v1.7.0

func SequenceExecutionPut(sequenceProtocolAdder SequenceProtocolAdder,
	protocolLister test.ProtocolLister, testCaseGetter handler.TestCaseGetter, caseProtocolAdder CaseProtocolAdder,
	taskAdder handler.TaskListAdder, taskGetter handler.TaskListGetter, activityStore handler.Activities) http.HandlerFunc

Handler for sequence summary page put it executes the save of a test sequence

func SequenceStartPageGet added in v1.5.0

func SequenceStartPageGet(caseGetter CaseProtocolGetter) http.HandlerFunc

SequenceStartPageGet serves the start page for a testsequence execution.

func Upload added in v1.7.0

func Upload() http.HandlerFunc

Types

type CaseProtocolAdder

type CaseProtocolAdder interface {
	// AddCaseProtocol adds the given protocol to the store
	AddCaseProtocol(r *test.CaseExecutionProtocol, testCaseVersion test.CaseVersion) (err error)
}

CaseProtocolAdder is used to add new testcase protocols to the store.

type CaseProtocolGetter

type CaseProtocolGetter interface {
	// GetCaseExecutionProtocol gets the protocol with the given id for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocol(protocolID id.ProtocolID) (test.CaseExecutionProtocol, error)
}

CaseProtocolGetter is used to get testcase protocols from the store.

type CaseProtocolStore

type CaseProtocolStore interface {
	CaseProtocolAdder
	CaseProtocolGetter
	// GetCaseExecutionProtocols gets the protocols for the testcase with given id,
	// which is part of the project with given id.
	GetCaseExecutionProtocols(testCaseID id.TestID) ([]test.CaseExecutionProtocol, error)
	GetCaseExecutionProtocolsForProject(projectID id.ProjectID) ([]test.CaseExecutionProtocol, error)
}

CaseProtocolStore interface for storing testcase protocols.

type SequenceProtocolAdder

type SequenceProtocolAdder interface {
	// AddSequenceProtocol adds the given protocol to the store
	AddSequenceProtocol(r *test.SequenceExecutionProtocol, sequenceVersion test.SequenceVersion) (err error)
}

SequenceProtocolAdder interface for storing testsequence protocols.

type SequenceProtocolStore

type SequenceProtocolStore interface {
	SequenceProtocolAdder
	// GetSequenceExecutionProtocols gets the protocols for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocols(projectID, sequenceID string) ([]test.SequenceExecutionProtocol, error)
	// GetSequenceExecutionProtocol gets the protocol with the given id for the testsequence with given id,
	// which is part of the project with given id.
	GetSequenceExecutionProtocol(projectID, sequenceID string, protocolID int) (test.SequenceExecutionProtocol, error)
}

SequenceProtocolStore interface for storing testsequence protocols.

type TimeSession

type TimeSession interface {
	//GetDuration returns the duration needed in this execution til now.
	//If there is no sequence execution running, the function will return nil, nil
	//If an error occurs nil and the error will be returned
	GetDuration(r *http.Request) (*duration.Duration, error)
	//SetDuration saves the given duration to the session.
	//After this call, you can get the current duration via the GetDuration-function
	SetDuration(w http.ResponseWriter, r *http.Request, duration *duration.Duration) error
}

TimeSession is used to store time in during requests.

Jump to

Keyboard shortcuts

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