Bru*_*oko 8 javascript jasmine protractor cucumberjs
我试图找出一个办法以同样的方式使用,或者还好说,类似的方式,该标记选项cucumberJS
用了protractor
,但与Jasmin
E,有没有办法来标记不同的场景,如:@smoke
,@regression
等等.然后告诉控制台运行那些?
我拒绝使用Cucumber
,因为它的支持它似乎变得片状!
任何帮助都感激不尽!
使用jasmine2,您可以使用正则表达式过滤测试.也许你可以在你的测试中添加像@ smoke,@ regressions这样的东西,然后通过传递grep标志来运行那些:
it('should do stuff @smoke', function() {
...
});
Run Code Online (Sandbox Code Playgroud)
然后运行量角器传递grep标志:
protractor conf.js --grep='@smoke'
grep
将要使用的替代方案suites
:
suites: {
smoke: [
"spec1.js",
"spec2.js",
"spec3.js"
],
regression: [
"spec4.js",
"spec5.js",
],
}
Run Code Online (Sandbox Code Playgroud)
然后,运行指定suite
参数的量角器:
protractor conf.js --suite smoke
protractor conf.js --suite regression
protractor conf.js --suite smoke,regression
Run Code Online (Sandbox Code Playgroud)