当我用Cucumber运行我的第一个测试文件时,我得到了这个例外如何解决这个问题?
Exception in thread "main" cucumber.runtime.CucumberException: Error parsing feature file D:/intalled/CucumberConcepts/src/cucumber/features/myfeature.feature
at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:123)
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:52)
at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:33)
at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:143)
at cucumber.runtime.Runtime.run(Runtime.java:107)
at cucumber.api.cli.Main.run(Main.java:26)
at cucumber.api.cli.Main.main(Main.java:16)
Run Code Online (Sandbox Code Playgroud)
引起:gherkin.lexer.LexingError:第1行的Lexing错误:'功能:我的框架工作的概念证明
Feature : Proof of concept that my framework works
Scenario Outline : My first Test
Given this is my first test
When This is my second step
Then This is the final step
Run Code Online (Sandbox Code Playgroud)
您需要做以下几件事:A)删除空格Feature :和Scenario Outline :关键字; 和B)将场景大纲更改为场景(或添加缺少的大纲示例).
如果您运行此功能:
Feature: Proof of concept that my framework works
Scenario: My first Test
Given this is my first test
When This is my second step
Then This is the final step
Run Code Online (Sandbox Code Playgroud)
然后,黄瓜将输出待完成的步骤定义:
You can implement step definitions for undefined steps with these snippets:
Given(/^this is my first test$/) do
pending # Write code here that turns the phrase above into concrete actions
end
When(/^This is my second step$/) do
pending # Write code here that turns the phrase above into concrete actions
end
Then(/^This is the final step$/) do
pending # Write code here that turns the phrase above into concrete actions
end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7944 次 |
| 最近记录: |