Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateDuration(cases []Case) (int, int)
- func CalculateSUTVersion(cases []Case, upperBound, lowerBound, sutType string) (string, error)
- type Case
- type CaseExecutionRecord
- func (rec CaseExecutionRecord) DeepCopy() CaseExecutionRecord
- func (rec CaseExecutionRecord) Equals(in interface{}) bool
- func (rec *CaseExecutionRecord) Finish(result Result, comment string, neededTime time.Duration)
- func (rec *CaseExecutionRecord) GetNeededTime() time.Duration
- func (rec *CaseExecutionRecord) IsFinished() bool
- func (rec *CaseExecutionRecord) SaveStep(stepNr int, observedBehavior string, result Result, comment string, ...)
- type CaseExecutionRecordID
- type CaseVersion
- type Result
- type Sequence
- type SequenceExecutionRecord
- type SequenceInfo
- type SequenceVersion
- type Step
- type StepExecutionRecord
Constants ¶
const ( MinSUT = "Oldest Version" MaxSUT = "Current Version" )
Variables ¶
var ExampleSteps = []([]Step){{ Step{"Open the application", NotAssessed, "The application should display the start screen", "", 1}, Step{"Click on login", NotAssessed, "The application should display the login modal", "", 2}, Step{"Enter user name and password", NotAssessed, "The user can see that he entered symbols into input fields", "", 3}, }, { Step{"The user uses the application", NotAssessed, "The application appropriately responses to the user input", "", 1}, }}
ExampleSteps is slice of exemplary Step-slices for use in tests and initialization
Functions ¶
func CalculateDuration ¶
CalculateDuration calculates the durationHours and durationMin for testsequences
Types ¶
type Case ¶
type Case struct { ID string Name string Labels []string TestCaseVersions []CaseVersion CreationDate time.Time }
The Case struct contains the information needed for describing a test case
type CaseExecutionRecord ¶
type CaseExecutionRecord struct { ID int TestCaseID string TestCaseVersionNr int ProjectID string SUTVersion string Environment string ExecutionDate time.Time StepRecords []StepExecutionRecord Result Result Comment string OtherNeededTime time.Duration }
CaseExecutionRecord contains all information relating to an execution of a test case
func NewCaseExecutionRecord ¶
func NewCaseExecutionRecord(TestCase Case, TestCaseVersionNr int, projectID string, SUTVersion string, Environment string) CaseExecutionRecord
NewCaseExecutionRecord creates a new execution record of a test case execution with the given information
func (CaseExecutionRecord) DeepCopy ¶
func (rec CaseExecutionRecord) DeepCopy() CaseExecutionRecord
DeepCopy returns a copy, that is completely independent of its original.
func (CaseExecutionRecord) Equals ¶
func (rec CaseExecutionRecord) Equals(in interface{}) bool
Equals compares two CaseExecutionRecords and returns true, if these two are equal. If in is nil, Equals will return false.
func (*CaseExecutionRecord) Finish ¶
func (rec *CaseExecutionRecord) Finish(result Result, comment string, neededTime time.Duration)
Finish will finish the Record and saves over all Data.
func (*CaseExecutionRecord) GetNeededTime ¶
func (rec *CaseExecutionRecord) GetNeededTime() time.Duration
GetNeededTime returns the summed up time, needed for this execution so far.
func (*CaseExecutionRecord) IsFinished ¶
func (rec *CaseExecutionRecord) IsFinished() bool
IsFinished checks, if the TestCase was executed till end or was interrupted and isn't completed yet.
func (*CaseExecutionRecord) SaveStep ¶
func (rec *CaseExecutionRecord) SaveStep(stepNr int, observedBehavior string, result Result, comment string, neededTime time.Duration)
SaveStep will be called, if the user executed one test step. The results of the execution will be saved to the record. stepNr starts with step 1
type CaseExecutionRecordID ¶
CaseExecutionRecordID embraces all values needed to identify a case record
type CaseVersion ¶
type CaseVersion struct { VersionNr int Message string IsMinor bool Description string Preconditions string SUTVersionFrom string SUTVersionTo string DurationHours int DurationMin int Steps []Step CreationDate time.Time }
CaseVersion contains the information needed for describing a version of a test case
func NewTestCaseVersion ¶
func NewTestCaseVersion(version int, isMinor bool, message, description, preconditions, sutVerFrom, sutVerTo string, dur time.Duration) CaseVersion
NewTestCaseVersion creates a new version for a test case Returns the created test case version
type Result ¶
type Result int
Result is the type to describe the actual outcome of a test step execution
Pass, PassWithComment, Fail and NotAssessed are possible values of the type Result
type Sequence ¶
type Sequence struct { ID string Name string Labels []string CreationDate time.Time SequenceVersions []SequenceVersion }
The Sequence struct contains information for describing a test sequence
func NewTestSequence ¶
NewTestSequence creates a new test sequence with the given information
type SequenceExecutionRecord ¶
type SequenceExecutionRecord struct { ID int TestSequenceID string TestSequenceVersionNr int ProjectID string SUTVersion string Environment string CaseExecutionRecords []CaseExecutionRecordID }
SequenceExecutionRecord contains all information relating to an execution of a test sequence itself. Data referring to the single test cases are saved in the corresponding CaseExecutionRecord
func NewSequenceExecutionRecord ¶
func NewSequenceExecutionRecord(testSequence Sequence, testSequenceVersionNr int, projectID string, sutVersion string, environment string) SequenceExecutionRecord
NewSequenceExecutionRecord creates a new execution record of a test sequence execution with the given information
func (*SequenceExecutionRecord) AddCaseExecutionRecord ¶
func (s *SequenceExecutionRecord) AddCaseExecutionRecord(id int, testCaseID string, projectID string)
AddCaseExecutionRecord adds an case record to the sequence record
func (SequenceExecutionRecord) Equals ¶
func (s SequenceExecutionRecord) Equals(in interface{}) bool
Equals compares two SequenceExecutionRecord and returns true, if these two are equal. The contained CaseExecutionRecords will be compared too. If in is nil, Equals will return false.
type SequenceInfo ¶
type SequenceInfo struct { SUTVersionFrom string SUTVersionTo string DurationHours int DurationMin int }
SequenceInfo contains meta information for a SequenceVersion
type SequenceVersion ¶
type SequenceVersion struct { VersionNr int Message string IsMinor bool Description string Preconditions string CreationDate time.Time Cases []Case SequenceInfos SequenceInfo }
SequenceVersion contains information for describing a version of a test sequence
func NewTestSequenceVersion ¶
func NewTestSequenceVersion(version int, isMinor bool, message, description string, preconditions string, cases []Case) (SequenceVersion, error)
NewTestSequenceVersion creates a new version for a test case Returns the test case the version belongs to
func (SequenceVersion) CountIncludedSteps ¶
func (tsv SequenceVersion) CountIncludedSteps() int
CountIncludedSteps returns the total number of steps summed over all included cases
func (SequenceVersion) CountIncludedStepsUpTo ¶
func (tsv SequenceVersion) CountIncludedStepsUpTo(maxCaseNr int) int
CountIncludedStepsUpTo returns the total number of steps summed over all included cases up to maxCaseNr the numeration starts with 0 and maxCaseNr itself will be included
func (SequenceVersion) ItemEstimatedDuration ¶
func (tsv SequenceVersion) ItemEstimatedDuration() (minutes int, hours int)
ItemEstimatedDuration returns the estimated Duration for the sequence
type Step ¶
type Step struct { Action string ActualResult Result ExpectedResult string Assessment string ID int }
The Step struct contains information for describing a single step of a test case
func NewTestStep ¶
NewTestStep creates a new Step with action and expected result from parameters
type StepExecutionRecord ¶
type StepExecutionRecord struct { NeededTime time.Duration ObservedBehavior string Result Result Comment string Visited bool }
StepExecutionRecord contains all information relating to an execution of a test step
func (StepExecutionRecord) DeepCopy ¶
func (s StepExecutionRecord) DeepCopy() StepExecutionRecord
DeepCopy returns a copy, that is completely independent of its original, but equal.