sbt / sbt-cucumber

Cucumber plugin for SBT.
Other
20 stars 14 forks source link

Can't seem to pass through JVM options on the command line #5

Open Stephen-Kam opened 5 years ago

Stephen-Kam commented 5 years ago

I've had a look around but can't see the answer so if the following does exist, pointing me in the right direction would be appreciated.

Firstly, great that I can just run sbt cucumber and not have the unit tests execute also, however, in my tests, I tend to specify various JVM options, these seem to be ignored with sbt cucumber though.

For example, when choosing what browser to run against I would normally enter:

sbt -Dbrower=firefox test and the test would run agains the firefox driver as expected

however, that is ignored if I enter

sbt -Dbrowser=firefox cucumberand the test runs in Chrome by default.

Is it possible to be able to pass through JVM options on the command line?

lewismj commented 5 years ago

Can you try CucucmberPlugin.envProperties?

e.g. CucumberPlugin.envProperties := Map("K"->"2049")

bindulaxminarayan commented 5 years ago

how to override through command line? I am trying to override that from command line like: ./sbt 'CucumberPlugin.envProperties := Map("testenv"->"stage")' "cucumber --tags @regression" and I see error: not a valid key: Not a valid key: CucumberPlugin (similar: cucumberPlugins, cucumberGlues, cucumberDryRun) [error] CucumberPlugin.envProperties := Map("testenv"->"stage")

satyagraha commented 4 years ago

You may need something like: sbt -J-Dproperty=something "cucumber --tags @foo"

satyagraha commented 1 year ago

The -J-D facility worked in 0.2.1 but has no longer works in 0.3.1.