Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular2 + karma + protractor - run specific e2e test case

What command can I use to start specific e2e test case from test suite?

If this is not possible - running specific test suite may be some workaround.

I use Jasmine, Karma and Protractor. I start my tests with command

npm run e2e

which is defined in package.json

"e2e": "protractor protractor.config.js"

I can redefine this task (or create new one)

"e2e-s": "protractor protractor.config.js --specs ./app/dashboard/e2e-spec.js"

But I'd like to perform this from command line.

like image 969
koral Avatar asked Oct 03 '16 10:10

koral


Video Answer


1 Answers

You can propagate arguments to the npm script via the --:

npm run e2e -- --specs path/to/spec

Make sure you have the latest npm installed.


You can also focus tests with fdescribe/ddescribe in Jasmine and describe.only in Mocha.

like image 65
alecxe Avatar answered Nov 04 '22 20:11

alecxe