最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Tags Protractor + Jasmine to run set of suites - Stack Overflow

programmeradmin1浏览0评论

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 Jasmine, is there a way to tag the different scenarios, like: @smoke, @regression, etc.. and then tell on console to run with those?

I'm declining to use Cucumber, since it's support it's seems to be getting flaky!

Any help will be much appreciated!

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 Jasmine, is there a way to tag the different scenarios, like: @smoke, @regression, etc.. and then tell on console to run with those?

I'm declining to use Cucumber, since it's support it's seems to be getting flaky!

Any help will be much appreciated!

Share Improve this question edited Nov 30, 2015 at 19:56 alecxe 474k126 gold badges1.1k silver badges1.2k bronze badges asked Nov 30, 2015 at 17:33 El NubroEl Nubro 6246 silver badges20 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 10

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() {
  ...
});

Then run protractor passing the grep flag:

protractor conf.js --grep='@smoke'

Alternative to grep would to be to use suites:

suites: {
    smoke: [ 
        "spec1.js",
        "spec2.js",
        "spec3.js"
    ],

    regression: [
        "spec4.js",
        "spec5.js",
    ],
}

Then, run protractor specifying the suite argument:

protractor conf.js --suite smoke
protractor conf.js --suite regression
protractor conf.js --suite smoke,regression

Running protractor tests with multiple tags in using jasmine framework:

protractor.conf.js --grep '@smoke|@regression'

发布评论

评论列表(0)

  1. 暂无评论