Cucumber-JVM参数中的换行符

时间:2013-03-21 15:35:40

标签: cucumber-jvm

有没有办法将包含换行符的参数传递给Cucumber-JVM场景?

作为一种解决方法,我将“\ n”字符串放入参数中,并在场景方法的开头用换行符替换它们,但感觉好像可能有更好的方法。

1 个答案:

答案 0 :(得分:2)

您可以使用三重引用来使用Doc Strings。从官方维基http://cukes.info/step-definitions.html

中窃取的示例
Given a blog post named "Random" with Markdown body
  """
  Some Title, Eh?
  ==============
  Here is the first paragraph of my blog post. Lorem ipsum dolor sit amet,
  consectetur adipiscing elit.
  """