問題描述
我正在嘗試找出一種方法,以與 cucumberJS
與 protractor
相同的方式,或者更好地說,類似的方式使用標記選項,但是使用 Jasmin
e,有沒有辦法標記不同的場景,例如:@smoke
、@regression
等.然后告訴控制臺與那些一起運行?
I'm trying to figure out a way to use in the same way, or better said, similar way, the tagging options that cucumberJS
has with protractor
, but with Jasmin
e, is there a way to tag the different scenarios, like: @smoke
, @regression
, etc.. and then tell on console to run with those?
我拒絕使用 Cucumber
,因為它的支持似乎越來越不穩定!
I'm declining to use Cucumber
, since it's support it's seems to be getting flaky!
任何幫助將不勝感激!
推薦答案
使用 jasmine2,您可以使用正則表達式過濾測試.也許你可以在你的測試中添加@smoke、@regressions 之類的東西,然后只通過傳遞 grep 標志來運行這些:
With jasmine2 you can filter tests using a regular expression. Maybe you can add something like @smoke, @regressions to your tests and then only run those ones by passing the grep flag:
it('should do stuff @smoke', function() {
...
});
然后通過 grep 標志運行量角器:
Then run protractor passing the grep flag:
量角器 conf.js --grep='@smoke'
這篇關于標簽 Protractor + Jasmine 運行套件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!