How can I use a parameter to a protractor configuration file to chose steps?

Following the lead of this question, I tried (naievely) to do this:

protractor test/features/protractor-conf.js --params.test_set=dev_test

and

protractor-conf.js:

exports.config = {
   // ...
  specs: [browser.params.test_set+'/*.feature'],

... but of course it doesn't work because browser is not defined at the time that the conf file is parse.

So how could I achieve this effect: passing a parameter to protractor that determines the specs?

Answers:

Answer

Use the --specs command-line argument:

--specs Comma-separated list of files to test

protractor test/features/protractor-conf.js --specs=dev_test/*.feature

Note that dev_test/*.feature would be passed into the protractor's command-line-interface which would resolve the paths based on the current working directory (source code).

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.