使用Gauge ,我们可以在测试规范标题之后使用上下文步骤在每个场景之前重复一组步骤。例如:
Delete project
==============
* User log in as "mike"
Delete single project
---------------------
* Delete the "example" project
* Ensure "example" project has been deleted
Delete multiple projects
------------------------
* Delete all the projects in the list
* Ensure project list is empty
在上面的 Delete Project 测试规范中,上下文步骤User log in as "mike"将被执行两次,两个检测场景各执行一次。
如何定义在测试规范的所有场景之前运行一次的步骤?