[英]How can the tags in cucumber hooks(@Before and @After) be organised
我有兩個步驟定義,包含兩種類型的標簽(填充和測試)
在鈎子中,我有以下定義:
-> Before("not @populate_cars1 and not @populate_cars2 and not @populate_clients1 and not @populate_clients2", function(){...}) - 按預期工作
-> After("not @cars1 and not @cars2 and not @clients1 and not @clients2", function(){...}) - 按預期工作。
我想組織如下標簽: let pop_car = "not @populate_cars1 and not @populate_cars2"
let pop_client = "and not @populate_clients1 and not @populate_clients2"
@Before(pop_car + pop_client, function(){...})
我為每個步驟定義了一個變量,該變量包含標簽之間的操作並連接該變量以獲取字符串。
問題是當我連接變量“pop_car + pop_client”時 -調用 @Before鈎子。
串聯變量之間需要一個空格。
嘗試:
@Before("pop_car" + " " + "pop_client")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.