groovy - How to get a reference of cucumber RuntimeOptions when using cucumber-java and junit? -
i using cucumber-java in groovy code. prefer cucumber-java cucumber-groovy because can run tests plain old junit tests. however, step definition templates spitted out cucumber in java style. instead, have groovy style. example, in java style, like
@when("^an http request sent obtain config.xml of \"([^\"]*)\"$") public void an_http_get_request_is_sent_to_obtain_config_xml_of(string arg1) throws throwable { // express regexp above code wish had throw new pendingexception(); }
since using groovy, like
@when(/^an http request sent obtain config.xml of "([^"]*)"$/) void 'an http request sent obtain config.xml of'(string arg1) { // express regexp above code wish had throw new pendingexception(); }
i thinking implement such feature. basically, idea add new field, maybe called templatelanguage
, in cucumber.api.cucumberoptions
. when new field equal groovy
, groovy-style templates spitted. involve if statement in cucumber.runtime.java.javasnippet.template()
, such as
if( runtimeoptions.gettemplatelanguage().tolowercase().equals('groovy') ) {...}
however, question is: how can reference of runtimeoptions passed in like
@cucumberoptions( format = ["pretty", "html:build/cucumber"], features="src/test/resources/cucumber_features/api/job_view.feature", glue=['com.yahoo.adcd.jenkins.tests.smoke.api.cucumber.job.view'], strict = true )
thank much!
Comments
Post a Comment