[英]Do the blue dashes in cucumber features output always mean skipped?
我已經明白功能輸出中的藍色短划線意味着跳過了一步,因為它失敗了,但在我的所有場景概述中,我得到藍色破折號,但也有一條說明全部通過的行。
這是我的場景大綱。
Scenario Outline: Attempt to assign a role when not authorized
Given a <user_who_can_not_assign_roles> exists with email: "johndoe@example.com"
And that user is signed in
And I am on the user's show page
And a role exists with name: "<other_role1>"
And a role exists with name: "<other_role2>"
When I follow "Edit"
Then I should not see "Admin"
And I should not see "Manager"
And I should not see "Salesperson"
When I fill in "username" with "spuds"
And I fill in "password" with "potatoes"
And I fill in "password confirmation" with "potatoes"
And I fill in "email" with "spuds@gmail.com"
And I press "Save"
Then I should see "success"
And a role should exist with name: "<other_role1>"
And that role should not be one of the user's roles
And a role should exist with name: "<other_role2>"
And that role should not be one of the user's roles
Examples:
| user_who_can_not_assign_roles | other_role1 | other_role2 |
| manager | Admin | Salesperson |
| salesperson | Admin | Manager |
當我運行此功能時,我得到了這個輸出。
-------------------......
2個場景(2個通過)
38步(38通過)
0m3.300s
我得到了它的2個場景,因為我列出了2個例子,38個步驟將是19個兩次運行。 我不明白的是為什么它顯示了藍色破折號(就像通常顯示的跳過步驟一樣),當它還說38步已通過時。
我認為這是在運行大綱時的意圖,因為如果我改變標有藍色短划線的步驟,它將顯示失敗。 我只是在黃瓜文檔中尋找一些確認,我找不到任何東西。
我正在運行rails 3.0.0,黃瓜0.9.3和pickle 0.4.2。
在這種情況下,藍色破折號表示場景大綱的解析,這是比測試更多的元數據。 我發現它也令人困惑。 為了更好地了解正在發生的事情,請嘗試執行:
cucumber -f pretty <your_fancy_scenario.feature>
這將迫使黃瓜用顏色編碼顯示實際的場景文本,而不僅僅是點和短划線。
希望有所幫助!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.