Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing jvm arguments to cucumber task #53

Open
Darkvater opened this issue Dec 3, 2015 · 1 comment
Open

Passing jvm arguments to cucumber task #53

Darkvater opened this issue Dec 3, 2015 · 1 comment

Comments

@Darkvater
Copy link

How do I set task properties to the cucumber task from outside the cucumber block?

Normally one would do it like this:


cucumber {

  jvmOptions.systemProperties += ["foo": "bar"]

}

But if I want to set properties globally through 'withType' for example, it doesn't work. None of the below gets picked up.


tasks.withType(Test) {task ->

  task.systemProperty('foo', 'bar')

}

tasks.withType(JavaExec) {task ->

  task.systemProperty('foo', 'bar')

}

The only way I have gotten this to work is to set a system and not task property on Test, e.g. after which I can use retrieve this value inside the cucumber task from System.getProperty()


tasks.withType(Test) {task ->

  System.setProperty('foo', 'bar')

}

Why are task properties not propagated?

@tommywo
Copy link

tommywo commented Dec 7, 2015

can you try using tasks.withType(CucumberTask) ?
(u might need to import com.excella.gradle.cucumber.tasks.CucumberTask)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants