lewismj / cucumber Goto Github PK
View Code? Open in Web Editor NEWCucumber Test Framework & Plugin for SBT (BDD Testing in Scala)
License: Other
Cucumber Test Framework & Plugin for SBT (BDD Testing in Scala)
License: Other
Hi @lewismj
Your plugin saved me a lot of pain actually .. much appreciated thanks!
Would it be possible to release it to Sonatype OSS ... issue is I have a project which uses SAAS build tool which fails at this point. There are a few hacky ways around but would be better if the dependency was on released, accessible artefact.
So basically the steps here http://central.sonatype.org/pages/ossrh-guide.html
It is a wee bit of pain setup.
If this isn;t something you fancy doing I can either do it linking to this repo ( but I would need write access on the repo ) or I can clone it and do it that way ( I would use a different package structure to not steal yours :-) )
Can you let me know what option you prefer.
Thanks again.
Andy
I noticed this issue, raised on Cucumber github, think it won't affect the plugin, but the runner:
I've added a jar of cucumber-runner as an unmanaged dependency to my project. However, on running 'sbt test', I'm getting the following error-
java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
at com.waioeka.sbt.runner.CucumberRunner.(CucumberRunner.scala:43)
at com.waioeka.sbt.runner.CucumberFramework.runner(CucumberFramework.scala:48)
at com.waioeka.sbt.runner.CucumberFramework.runner(CucumberFramework.scala:30)
at sbt.Defaults$$anonfun$createTestRunners$1.apply(Defaults.scala:589)
at sbt.Defaults$$anonfun$createTestRunners$1.apply(Defaults.scala:583)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.immutable.Map$Map3.foreach(Map.scala:154)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.Defaults$.createTestRunners(Defaults.scala:583)
at sbt.Defaults$.allTestGroupsTask(Defaults.scala:603)
at sbt.Defaults$$anonfun$testTasks$7.apply(Defaults.scala:466)
at sbt.Defaults$$anonfun$testTasks$7.apply(Defaults.scala:466)
at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:35)
at scala.Function9$$anonfun$tupled$1.apply(Function9.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[error] (test:executeTests) java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V
Hey,
Thanks for the great work so far, I was also wondering if it is possible to get the forked process to write to standard out from the parent process. I am loosing my log messages when cucumber runs and I am assuming this is the cause.
Chris
Options for cucumber-runner seems to be hardcoded. It does not respect --monochrome argument or CucumberPlugin.monochrome setting.
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)?
Hi,
I am having trouble passing JVM arguments via:
sbt -DsomeArg=someVal cucumber
The argument is lost, as a quick test I added the following to my steps:
Before() { scenario =>
println("OPTS:::::")
println(System.getProperty("someArg"))
}
Which results in null
. Similar tests work with sbt run etc
Cheers, Chris
Inside CucumberRunner
:
info(Console.RED + s"$shortName .. failed")
CucumberRunner.numFailures.incrementAndGet()
handle(new OptionalThrowable(), Status.Success)```
- Would it not be better if this was Status.Failure? or something that more accurately reflects the failed scenario
No matter what path I pass I get IOException. Any ideas?
/tmp/json
target/cucumber.json
testOptions in Test += Tests.Argument(cucumberFramework,"--plugin","json:path")
cucumber.runtime.CucumberException: java.io.IOException: Failed to create directory
Hi,
mine is more of a documentation issue than a real issue: what to do if my build.sbt file describes several subprojects: do I have to declare a TestFramework for each subproject, or just one in the project scope will do?
Thanks!
Hi,
This is a question rather than an issue, is it possible to use BeforeAndAfterAll
with the step definition?
Regards,
Syed Farhan Ali
I have an own implementation of the gherkin.formatter.Reporter
trait which needs to be passed in as a --plugin
option.
While it should be possible using the testrunner like this
testOptions in Test += Tests.Argument(framework,"--plugin","acceptanceTests.CucumberReporter")
i struggle to achieve the same using the sbt plugin. Since the Plugin
trait is sealed, it cannot be extended and the available Plugin case classes cannot be used for this.
Am i missing something?
If I define an alternative location for feature files in the build.sbt file as follows:
CucumberPlugin.features := List("src/test/features")
Then sbt cucumber works as required, but sbt test fails to find the feature files as it appears to only look in the src/test/resources directory.
Hey,
Thanks for the good work with this library, works really well. I was wondering, how would I get access to the scenario data prior to my features been run. I can see that in the cucumber JVM version there is the ability to use cucumber.annotation.Before
and decorate a method but I am unsure how to do this here. I basically need to do some different pre setup depending on the tags I specify.
Cheers, Chris
Any idea why
Tests.Argument(cucumberFramework, "--dry-run", "true")
Tests.Argument(cucumberFramework, "--monochrome", "true")
results in
java.lang.IllegalArgumentException: Not a file or directory: ~/Documents/Projects/cucumber/cucumber-testing-suite/true
Our body of Scala Cucumber BDD tests is growing, and becoming slow, so we are looking at how we might execute them parallel from SBT.
The examples I can find are focused on Java and Maven : e.g. https://github.com/sugatmankar/cucumber-jvm-parallel-plugin-rerun-example. This makes use of a maven code-generator plugin which creates a cucumber-runner class per feature file, along with the sure-fire plugin with a concurrent execution configuration. A report per feature is generated. From what I can make out: cross-talk in glue classes is eliminated using DI of a "scenario scope" entity, which itself is implemented using ThreadLocal. Another alternative is to fork for each feature file, which is probably safer but more heavyweight. And finally, the Cucumber report rendering is not thread-safe, so a final report needs to be stitched together from the individual feature reports.
There seems to be a few areas to solve :
I may be way off track, so any insight would be help in directing my efforts..
Hi, is it possible to run a single feature/example without the plugin? In the sbt console, I currently use testOnly *CucumberTestSuite
to only run cucumber tests, but would love to have more control!
sbt prevents sequencing of InputKeys.
CucumberPlugin.cucumber is defined as an InputKey, because it can pass additional commandline parameters.
Would it be an improvement to have a TaskKey that runs all cucumber tests, and a separate InputKey to run specific tests/pass other parameters?
For example how there is a test TaskKey[Unit] and testOnly InputKey[Unit]
Most recently released plugin for Scala 2.10 (version 0.1.2) has bug (line 84 can throws if invokeCucumber
failed: old CucumberRunner).
I would really appreciate if you could release newest version of this plugin for Scala 2.10 (unfortunately I am forced to use Scala 2.10, because I am still stuck on Spark 1.6.x).
Thanks a lot
Hi Mark,
I thought I'd add another issue as you mentioned you might be free to work on this at the weekend. I also noticed that when the tests fail the exit code will still be 0 and as such our CI server is reporting failed tests as a passing build step.
Cheers, Chris
Hi,
Please help me on how to use multiple tags for '--tags' option for cucumber plugin.
I plan to use it in many ways like my cucumber repo consists of test for many modules; a, b, and c
It works as expected when using single tag; "cucumber --tags @a"
or "cucumber --tags ~@a"
But when I tried cucumber --tags @a,@ready
or cucumber --tags @b,@ready
which expect to have test for "@A and @ready" but it's "@A or @ready" instead.
And when I see you mention TAG_EXPRESSION in command help then I check this link https://docs.cucumber.io/tag-expressions/
But when I tried to follow, I've got the error
> cucumber -d --tags '@foo and @bar'
[error] Exception in thread "main" java.lang.IllegalArgumentException: Not a file or directory: C:\Code\pricing-scala-test\and
Thank you very much in advance.
Note:
> cucumber -v
[info] 1.2.4
addSbtPlugin("com.waioeka.sbt" % "cucumber-plugin" % "0.1.6")
As of now, we can only specify one path for the glue setting.
I'd like to provide a set of base classes for cucumber tests and another user running their own tests can use their own step definitions in addition to mine.
Is it possible to get the latest release published?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.