黄瓜错误:引起:gherkin.lexer.LexingError:第1行的Lexing错误

时间:2015-11-17 11:17:43

标签: java cucumber lexical-analysis gherkin

我有一个黄瓜特征文件,当我运行它时会出错,而Eclipse编辑器也会警告我错误。

对我来说语法是正确的。

@feature100
Feature: Feature-100: Category Navigation
Landing on homepage, it is possible to select a category through main navigation menu. Clicking on one of them, the Product grid page is reached.
Here all the filter types are listed in the bar: selecting one or more filter for filter type, the page refresh showing filter result in the grid. The number of filters selected updates near each filter type.
Once a filter is selected, Reset Filters functionality appears the left side of the bar.
Clicking on one of the products listed in filter result, the product detail page is reached. 

@test100 @active @screenshot @frontend @payment @caus
Scenario Outline: Feature-100 Group CAUS. 
Given FRONTEND_HOME_PAGE I access to homepage <Initials> and <Language>
And   FRONTEND_HOME_PAGE I control cookie alert <Initials> <Language>
And   FRONTEND_HOME_PAGE I click category GIFTS <Initials> and <Language>
And   FRONTEND_HOME_PAGE I click category FOR HER <Initials> and <Language>
And   FRONTEND_HOME_PAGE I select filters grid color
And   FRONTEND_HOME_PAGE I select filters grid material
#And   FRONTEND_HOME_PAGE I select filters grid line
#And   FRONTEND_HOME_PAGE I select filters grid gender
#And   FRONTEND_HOME_PAGE I select filters grid dimension
#And   FRONTEND_HOME_PAGE I select filters grid sort
#And   FRONTEND_HOME_PAGE I select filters grid all
#Then  FRONTEND_HOME_PAGE I select filters for product
@us
Examples: US Success
|Initials|Language|
| "us"   |"en"    |

如果我参加了Cukes课程,我会得到:

Exception in thread "main" cucumber.runtime.CucumberException: Error parsing feature file C:/works/integrationtest/frontend/frontend.test/src/it/javatest/RunCukes100.java
    at cucumber.runtime.FeatureBuilder.parse(FeatureBuilder.java:133)
    at cucumber.runtime.model.CucumberFeature.loadFromFeaturePath(CucumberFeature.java:104)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:54)
    at cucumber.runtime.model.CucumberFeature.load(CucumberFeature.java:34)
    at cucumber.runtime.RuntimeOptions.cucumberFeatures(RuntimeOptions.java:235)
    at cucumber.runtime.Runtime.run(Runtime.java:110)
    at cucumber.api.cli.Main.run(Main.java:36)
    at cucumber.api.cli.Main.main(Main.java:18)
Caused by: gherkin.lexer.LexingError: Lexing error on line 1: 'package it.integrationtest.frontend.test;

并且Eclipse报告错误:

enter image description here

0 个答案:

没有答案