Пример #1
0
func (specInfoGatherer *SpecInfoGatherer) createConceptInfos() []*gauge_messages.ConceptInfo {
	conceptInfos := make([]*gauge_messages.ConceptInfo, 0)
	for _, concept := range specInfoGatherer.getDictionary().ConceptsMap {
		stepValue := parser.CreateStepValue(concept.ConceptStep)
		conceptInfos = append(conceptInfos, &gauge_messages.ConceptInfo{StepValue: parser.ConvertToProtoStepValue(&stepValue), Filepath: proto.String(concept.FileName), LineNumber: proto.Int(concept.ConceptStep.LineNo)})
	}
	return conceptInfos
}
Пример #2
0
func (s *SpecInfoGatherer) getStepsFromConcept(concept *gauge.Concept) []*gauge.StepValue {
	stepValues := make([]*gauge.StepValue, 0)
	for _, step := range concept.ConceptStep.ConceptSteps {
		if !step.IsConcept {
			stepValue := parser.CreateStepValue(step)
			stepValues = append(stepValues, &stepValue)
		}
	}
	return stepValues
}
Пример #3
0
func getParsedStepValues(steps []*gauge.Step) []*gauge.StepValue {
	var stepValues []*gauge.StepValue
	for _, step := range steps {
		if !step.IsConcept {
			stepValue := parser.CreateStepValue(step)
			stepValues = append(stepValues, &stepValue)
		}
	}
	return stepValues
}
Пример #4
0
func (s *SpecInfoGatherer) getStepsFromSpec(spec *gauge.Specification) []*gauge.StepValue {
	stepValues := make([]*gauge.StepValue, 0)
	for _, scenario := range spec.Scenarios {
		for _, step := range scenario.Steps {
			if !step.IsConcept {
				stepValue := parser.CreateStepValue(step)
				stepValues = append(stepValues, &stepValue)
			}
		}
	}
	return stepValues
}
Пример #5
0
func (s *SpecInfoGatherer) GetConceptInfos() []*gauge_messages.ConceptInfo {
	conceptInfos := make([]*gauge_messages.ConceptInfo, 0)
	s.mutex.Lock()
	for _, conceptList := range s.conceptsCache {
		for _, concept := range conceptList {
			stepValue := parser.CreateStepValue(concept.ConceptStep)
			conceptInfos = append(conceptInfos, &gauge_messages.ConceptInfo{StepValue: parser.ConvertToProtoStepValue(&stepValue), Filepath: proto.String(concept.FileName), LineNumber: proto.Int(concept.ConceptStep.LineNo)})
		}
	}
	s.mutex.Unlock()
	return conceptInfos
}
Пример #6
0
func (specInfoGatherer *SpecInfoGatherer) updateAllStepsList() {
	specInfoGatherer.availableStepsMap = make(map[string]*parser.StepValue, 0)
	specInfoGatherer.addStepValuesToAvailableSteps(specInfoGatherer.runnerStepValues)
	for _, steps := range specInfoGatherer.fileToStepsMap {
		for _, step := range steps {
			if step.IsConcept {
				continue
			}
			stepValue := parser.CreateStepValue(step)
			if _, ok := specInfoGatherer.availableStepsMap[stepValue.StepValue]; !ok {
				specInfoGatherer.availableStepsMap[stepValue.StepValue] = &stepValue
			}
		}
	}
}