Tz_*_*Tz_ 54
Gherkin不支持它,所以你必须在所有行前加#.
如果使用SpecFlow Visual Studio扩展(v1.9.2),则只需选择行并将其切换为注释并返回.默认快捷键是Ctrl + K,C表示注释,Ctrl + K表示取消注释.
您还可以使用多行编辑功能在Visual Studio中"解决"此问题.(见http://weblogs.asp.net/scottgu/archive/2010/04/26/box-selection-and-multi-line-editing-with-vs-2010.aspx).您只需要按住ALT并使用鼠标选择行的开头.使用此功能,您可以同时键入所有选定的行.您也可以类似地删除所有这些,选择所有#字符进行删除.
Art*_*rov 23
就在这里.它被称为PyStrings类型注释.请参阅http://docs.behat.org/guides/1.gherkin.html#pystrings上的示例.
如果您在Feature或Scenario之后使用它以及其他一些元素,它将起作用.
Feature: my feature
""" some block comment
still block comment
""" end of block comment
Scenario: my feature
""" some block comment
still block comment
""" end of block comment
Run Code Online (Sandbox Code Playgroud)
另一方面,如果你想要评论一些步骤,它将无法工作.
我认为您可以将IDE配置为在标准组合键上注释掉一行.例如,IntelliJ识别*.feature文件并允许注释掉开箱即用的行.与Notepad ++甚至VS一样可能.
在Eclipse
评论Gherkin特征文件内容的单行/多行时,我们还可以执行以下操作.
添加新文件关联
Windows > Preferences > General > Editors> File Associations > File types: > Add...
并添加新文件类型*.feature
为新文件类型
Associated Editors > > Add...
添加关联编辑器Properties File Editor (Default)
.
现在重新打开文件,如果它打开,它将打开Properties File Editor
而不是Text editor
.
这样做允许我使用常用注释快捷键Ctrl + Shift + C选择任意数量的行和注释
归档时间: |
|
查看次数: |
79088 次 |
最近记录: |