問題描述
我有一個簡單的問題 - 我想運行一個 Cucumber 場景,但我似乎找不到任何選項/配置.
I have a simple problem - I want to run a single Cucumber scenario, but I can't seem to find any option/configuration for that.
我有 5-6 個場景,我可以設置配置來運行所有測試,但是當我糾正一個場景時,這需要太多時間......
I have 5-6 scenarios and I can set up configurations to run all tests, but It takes too much time, when I am correcting one scenario...
推薦答案
給特征文件添加任意名稱,可以添加多個以空格分隔的標簽.
Tag the feature file with any name, you may add multiple tags separated with spaces.
例如:@acceptance
@regression
現在,通過編輯配置在 VM 選項末尾添加以下選項
Now, add below options in the end of VM otions by editing configuration
-Dcucumber.options="--tags @acceptance"
運行測試,它只會觸發帶有 @acceptance
Run the test and it will only trigger the feature files tagged with @acceptance
您可以將配置設置為接受和回歸,或者在每次運行時編輯配置.
You can either set the configuration one for acceptance and one for regression or edit the configuration everytime you run it.
這篇關于如何在 Intellij 中運行單個黃瓜場景?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!