我在我的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