作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否必须执行一些配置设置才能让 Robot Framework (RF) 运行 Gherkin/BDD 风格的测试用例?
我已经在 Windows 7 上安装了 RF 2.8.3,并且在 Selenium2Library 和 DatabaseLibrary 上运行正常。根据用户文档和网络上的其他信息,我应该能够编写和运行 Gherkin 风格的测试。但是,当我这样做时,我会出错。在尝试匹配关键字之前,RF 不会剥离 Gherkin 关键字(Given、When、Then、...):
Tests.Group001 GeneralTests
==============================================================================
Scenario: No template operation selected | FAIL |
No keyword with name 'But page does not contain a no template operation selected error message' found.
------------------------------------------------------------------------------
pybot ../Tests
*** settings ***
Library Selenium2Library
Library DatabaseLibrary
Library kw_common
*** Test Cases ***
Scenario: No template operation selected
Given I have logged in and I have selected to perform template configuration
When I do not select a template operation
But page does not contain a no template operation selected error message
And I press the next button
Then I should not see a template operation selected error message
*** Keywords ***
I have logged in and I have selected to perform template configuration
Log Given I have logged in and I have selected to perform template configuration
I do not select a template operation
Log No template operation selected
page does not contain a no template operation selected error message
Page Should Not Contain 'ddTemplateOperation' is required.
I press the next button
Click Element xpath=//input[contains(@id,'next')]
I should not see a template operation selected error message
Page Should Contain 'ddTemplateOperation' is required.
最佳答案
Prefixes Given, When, Then and And are dropped when matching keywords are searched
page does not contain a no template operation selected error message
关键字需要重命名为
But page does not contain a no template operation selected error message
.
关于robotframework - 如何在 Robot Framework 中运行小 cucumber 风格的测试用例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21260931/
我是一名优秀的程序员,十分优秀!