El Nubro
El Nubro

Reputation: 624

Tags Protractor + Jasmine to run set of suites

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!

Upvotes: 9

Views: 5913

Answers (3)

vinayak kumbi
vinayak kumbi

Reputation: 1

Running protractor tests with multiple tags in using jasmine framework:

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

Upvotes: 0

alecxe
alecxe

Reputation: 474271

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

Upvotes: 7

Andres D
Andres D

Reputation: 8900

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'

Upvotes: 10

Related Questions