3

I'm trying to execute a such command in the console:

./gradlew cucumber -Pthreads=80 -Ptags=@ALL_API_TESTS

in the build.gradle:

cucumber {
    threads = "$threads"
    glue = 'classpath:com.sixtleasing.cucumber.steps'
    plugin = ['pretty']
    tags = "$tags"
    featurePath = 'src/main/resources/feature'
    main = 'cucumber.api.cli.Main'
}

but it doesnt work :( How can I fix it?

4
  • what do you mean "it doesn't work" : any error / stacktrace?
    – M.Ricciuti
    Commented May 16, 2019 at 14:40
  • It is executed only one thread. If I add 80 threads to gradle.build it works
    – Anna K
    Commented May 16, 2019 at 14:43
  • It should work as you have written. Could you try with threads = project.findProperty("threads") ?
    – M.Ricciuti
    Commented May 16, 2019 at 18:33
  • You can also try project.threads directly. Commented May 17, 2019 at 8:55

1 Answer 1

0

Your original expression set threads to a String value, when it is clearly a numeric one, so you need to use something like:

int threadsNum = "$threads".toInteger()
cucumber {
    threads = threadsNum
    glue = 'classpath:com.sixtleasing.cucumber.steps'
    plugin = ['pretty']
    tags = "$tags"
    featurePath = 'src/main/resources/feature'
    main = 'cucumber.api.cli.Main'
}

Hope this helps.

1
  • Grade doesnt accept it :( I got FAILURE: Build failed with an exception. and exception is in the line "$threads".toInteger()
    – Anna K
    Commented May 17, 2019 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.