Closed pjedruszuk closed 7 years ago
Yes, shouldn't be a problem, I'll take a look this evening. Try to get that published onto Maven.
I just published an 0.1.2 version to standardize all builds of the runner, should be one for 2.10, 2.11 and 2.12, may take a few hours to appear on maven central, will check it later.
I think the latest version of the runner should be available for Scala 2.10, 2.11 and 2.12, I'll re-open this issue if there are any problems.
0.1.2 does not work for Scala 2.10, as shown below: By the way: Using snapshots as dependencies is probalby not something, that is desirable in a production code... Is there a strong reqiirement to rely on 2.0.0.-SNAPSHOT for Cucumber dependencies?
Error:Error while importing SBT project:<br/>...<br/><pre>[error] unresolved dependency: io.cucumber#cucumber-jvm;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-junit;2.0.0-SNAPSHOT: not found
[error] ({project_name}/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: io.cucumber#cucumber-core;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-scala_2.10;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-jvm;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-junit;2.0.0-SNAPSHOT: not found
[error] ({project_name}/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: io.cucumber#cucumber-core;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-scala_2.10;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-jvm;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-junit;2.0.0-SNAPSHOT: not found
[error] ({project_name}/*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: io.cucumber#cucumber-core;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-scala_2.10;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-jvm;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-junit;2.0.0-SNAPSHOT: not found
[error] ({project_name}/*:update) sbt.ResolveException: unresolved dependency: io.cucumber#cucumber-core;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-scala_2.10;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-jvm;2.0.0-SNAPSHOT: not found
[error] unresolved dependency: io.cucumber#cucumber-junit;2.0.0-SNAPSHOT: not found
[error] Total time: 35 s, completed 2017-08-08 14:24:57
I think you need to add resolvers += Resolver.sonatypeRepo("snapshots")
The issue is that the SNAPSHOT version 2.0.0 is currently the only version that will support Scala 2.12, I will release a new version once its released. All prior versions of Cucumber don't work with Scala 2.12.
It took a long time before Cucumber had any build that would work with Scala 2.12 (only fairly recently had a build that would work at all), hopefully with the 2.0.0 release it should be easier to update. There was a fair bit of work blocked waiting on the update.
I'll leave this open so that people know they have to use: resolvers += Resolver.sonatypeRepo("snapshots") Until we get a pdn release of Cucumber 2.0.0
I have used the same resolver which you have mentioned above, but still my tests are not running. Consistently it gives me "cucumber.runtime.junit.UndefinedThrowable" exception. I have setup the right path of my stepdef in cucumberOptions.
Following you could see the resolver
Set up the path of my stepdef
Project settings in my build.sbt
Cucumber dependencies which I have used
Plugin that I have used in plugin.sbt addSbtPlugin("com.waioeka.sbt" % "cucumber-plugin" % "0.1.4")
sbt.version = 0.13.15 scalaVersion := "2.11.8" cucumber_sbt = "0.1.2" cucumberRunner = "0.0.8" cucumberVersion = "1.2.5" scalaTestVersion = "3.0.1"
project structure
Could you please help me what I am doing wrong?
Hi,
I think the first thing is, do you want to run Cucumber tests as part of your 'sbt test' test suite or as a standalone command 'sbt cucumber'. In the first case, treating Cucumber tests as standard unit tests - you would use the Runner otherwise (for a standalone command) I would use the plugin. You don't need both,
In most cases I would use it as part of 'sbt test'.
If using as sbt test, see this example: https://github.com/lewismj/cucumber/tree/master/example
In your build.sbt file, make sure you add the framework.
val framework = new TestFramework("com.waioeka.sbt.runner.CucumberFramework") testFrameworks += framework
together with any options:
testOptions in Test += Tests.Argument(framework,"--monochrome") testOptions in Test += Tests.Argument(framework,"--glue","") testOptions in Test += Tests.Argument(framework,"--plugin","pretty") testOptions in Test += Tests.Argument(framework,"--plugin","html:/tmp/html") testOptions in Test += Tests.Argument(framework,"--plugin","json:/tmp/json")
n.b. I would put the tests under a 'test' rather than 'main' source directory.
It mig toht be easier take the example project (https://github.com/lewismj/cucumber/tree/master/example) and customise it.
Note:
The plugin example is here: https://github.com/lewismj/cucumber/tree/master/plugin/example, n.b. the plugin is only if you want to run cucumber tests outside of the normal test framework. It was created because at work, we wanted to run 'cucumber' tests only via a particular command. Usually you would use just the Runner. i.e. If you want to run as part of 'sbt test' you don't need the plugin. Similarly, if running as a command 'sbt cucumber' you can ignore the runner. Most people use the runner though to run Cucumber as part of 'sbt test'.
I have tried with "sbt cucumber" as a standalone command. Thanks a lot it works for me.
0.13 version (runner) and updated plugin released to Maven (will be a few hours to propagate) this uses the release versions of the 2.0.0 Cucumber, which hopefully solves a few issues if you can't access snapshot versions.
should be fixed, with 0.13 release.
Would be possible to do some extended cross-version release for the runner? Current status for the compatibility seems to be like this:
I have a project with mixed 2.10 and 2.11 modules and the newest version I can use is 0.0.5 (because 0.0.8 and upwards has not been released for 2.10). Therefore, I can't use the newest runner integration, that you have enabled after rewritting this component. Is it possible to release new artifacts for older versions of Scala (especially 0.0.8 for Scala 2.10, from my PoV)?