Suk*_*uva 11 ruby cucumber gherkin
我当前的Cucumber文件如下所示:
功能:测试在线申请页面
场景:访问应用程序主页和测试链接
场景:访问应用程序登录并验证登录
所以现在我想在同一个文件中添加几个可能用于API测试的场景.所以我想为此创建一个新功能,而不是使用功能:测试在线应用程序页面.这样我就不需要为API测试创建单独的功能文件.
功能:测试在线申请页面
Feature: Test Online application Page
Scenario: Visit application home page and test links
Scenario: Visit application Login and Validate login
Run Code Online (Sandbox Code Playgroud)
功能:测试应用程序API
Feature: Test Online application Page
Scenario: Visit application home page and test links
Scenario: Visit application Login and Validate login
Feature: Test application API's
Scenario: validate Login API
Run Code Online (Sandbox Code Playgroud)
是否可以在单个功能文件中包含多个功能,这是一个好的做法吗?我只需要测试一个API,我将运行API测试以及在线测试.我仍然会使用@online和@api标签将它们分开.
Suk*_*uva 20
单个要素文件中不可能有多个要素.如果在单个特征文件中创建多个特征,则在运行黄瓜场景时将获得Gherkin Parser异常.所以答案是否定的.
C:/Users/ABC/RubymineProjects/XYZ.feature: Lexing error on line 47: 'Feature test google'. See https://github.com/cucumber-attic/gherkin2/wiki/LexingError for more information. (Cucumber::Core::Gherkin::ParseError)
Run Code Online (Sandbox Code Playgroud)