我在我的FeatureContext.php中有一个函数,它使用@AfterScenario来清理在测试过程中创建的假数据库条目。我想添加一个@debug标签到特定的场景,告诉函数不要删除为该场景创建的条目,如果该标签存在。在Behat,有没有测试特定标签的方法?
/**
* Deletes the records created during the scenarios.
* @AfterScenario
*/
public function cleanDB(AfterScenarioScope $scope)
{
// if [email protected] present
// delete files from database
// end if
}
behat是什么版本? – lauda
没有尝试过使用标签,但它应该能够获得场景标题,或设置一些变量并根据该变量进行决定。 – lauda
@lauda,Behat 3.1 – zkent