Code Monkey home page Code Monkey logo

cucumber's People

Contributors

andyjcboyle avatar gauravknoldus avatar jm-g avatar lewismj avatar ppiotrow avatar rpankajakshan avatar tylersouthwick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cucumber's Issues

@Before and accessing scenario tags

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

Documentation: subprojects

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!

Exit code 0

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

Executing tests in parallel

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 :

  1. How to drive parallel test execution from SBT
  2. How to manage "scenario scope" in Scala glue classes (if necessary)
  3. How to produce a final report

I may be way off track, so any insight would be help in directing my efforts..

IOException

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

Request Release Artifact to Sonatype OSS

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

CucumberPlugin.features option is not used by the Cucumber Runner plugin

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.

New version of the plugin for Scala 2.10

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

IllegalArgumentException on runner params

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

[Question] How to run a single feature/example

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!

Piping standard out to forked process

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

[Question] Tag_Expression for '--tags'

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")

CucumberPlugin.cucumber is an InputKey.

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]

sbt test gives error: java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V

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

[Question] How to pass own plugin via CucumberPlugin.plugin

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?

Use of BeforeAndAfterAll

Hi,

This is a question rather than an issue, is it possible to use BeforeAndAfterAll with the step definition?

Regards,

Syed Farhan Ali

Passed JVM options lost

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

CucumberTestFramework returns successful despite test failures.

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

Scala versions compatibility

Would be possible to do some extended cross-version release for the runner?
Current status for the compatibility seems to be like this:

  • Scala 2.10 - runner 0.0.5
  • Scala 2.11 - runner 0.0.8
  • Scala 2.12 - runner 0.1.1

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)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.