本文整理匯總了Golang中github.com/getgauge/gauge/gauge_messages.Step類的典型用法代碼示例。如果您正苦於以下問題:Golang Step類的具體用法?Golang Step怎麽用?Golang Step使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Step類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: handleTable
func (self *extractor) handleTable(stepInConcept *parser.Step, step *gauge_messages.Step) {
stepInConcept.Value += " {}"
specText := self.fileContent + step.GetTable()
spec, result := new(parser.SpecParser).Parse(specText, &parser.ConceptDictionary{})
if !result.Ok {
self.errors = append(self.errors, result.ParseError)
return
}
stepArgs := []*parser.StepArg{spec.Scenarios[0].Steps[0].Args[0]}
self.addTableAsParam(step, stepArgs)
stepInConcept.Args = append(stepInConcept.Args, stepArgs[0])
}
示例2: getExtractedConcept
func getExtractedConcept(conceptName *gauge_messages.Step, steps []*gauge_messages.Step, content string) (string, string, error) {
tokens, _ := new(parser.SpecParser).GenerateTokens("* " + conceptName.GetName())
conceptStep, _ := (&parser.Specification{}).CreateStepUsingLookup(tokens[0], nil)
specText, err := getContentWithDataTable(content)
if err != nil {
return "", "", err
}
extractor := &extractor{conceptName: "* " + conceptName.GetName(), stepsInConcept: "", stepsToExtract: steps, conceptStep: conceptStep, table: &parser.Table{}, fileContent: specText, errors: make([]error, 0)}
extractor.extractSteps()
if len(extractor.errors) != 0 {
return "", "", err
}
conceptStep.ReplaceArgsWithDynamic(conceptStep.Args)
addArgsFromTable(conceptStep, &extractor.conceptName, extractor.dynamicArgs)
if extractor.table.IsInitialized() {
extractor.conceptName += "\n" + formatter.FormatTable(extractor.table)
}
return strings.Replace(formatter.FormatStep(conceptStep), "* ", "# ", 1) + (extractor.stepsInConcept), extractor.conceptName, nil
}
示例3: addTableAsParam
func (self *extractor) addTableAsParam(step *gauge_messages.Step, args []*parser.StepArg) {
if step.GetParamTableName() != "" {
self.conceptName = strings.Replace(self.conceptName, fmt.Sprintf("<%s>", step.GetParamTableName()), "", 1)
self.table = &args[0].Table
args[0] = &parser.StepArg{Value: step.GetParamTableName(), ArgType: parser.Dynamic}
} else {
self.dynamicArgs = append(self.dynamicArgs, (&args[0].Table).GetDynamicArgs()...)
}
}