Code Monkey home page Code Monkey logo

Comments (14)

lewismj avatar lewismj commented on June 9, 2024

from cucumber.

chrisjowen avatar chrisjowen commented on June 9, 2024

Delay? I literally asked this 4 mins ago, I wouldn't call that a delay :)

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

I think this should be an easy fix:

  val runtimeMXBean = ManagementFactory.getRuntimeMXBean

  import scala.collection.JavaConversions._
  val args = runtimeMXBean.getInputArguments.toList

Gets me the arguments passed in. I'll do that fix in the next couple of hours.

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

The cucumber-plugin should now pass through the JVM arguments. Will look at the runner too, basically two ways Cucumber can be invoked, one through its own command 'sbt cucumber' the other is hooking into the "JUnit" test frameworks. I need to check the later. But, if you are using 'sbt cucumber' that should now pass through arguments fine and return error on failing test. Checked into master, may take a bit of time to hit Maven.

from cucumber.

chrisjowen avatar chrisjowen commented on June 9, 2024

Your a star :)

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

No worries, like the other one, I'll leave the open issue for a day or two in case of problems, then I'll close it down.

from cucumber.

eugeniyk avatar eugeniyk commented on June 9, 2024

for 0.1.4 I still have this issue
could you please help?

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

Will take a look this evening, can generate a new release if required.

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

Just wondering, I guess "sbt -DsomeArg=someVal test" on the runner doesn't work? The plugin creates its own JVM for the new command. The runner hooks into the test framework..., will investigate.

from cucumber.

eugeniyk avatar eugeniyk commented on June 9, 2024

I tried many ways
sbt "-DsomeArg=someVal cucumber --tags @debug"
sbt -DsomeArg=someVal "cucumber --tags @debug"
sbt -DsomeArg=someVal cucumber

none of them works
however in CI, where we lunch it with with java & teamcity cucumber plugin, flags are passed

from cucumber.

danewatts avatar danewatts commented on June 9, 2024

@lewismj hey, I have plugin v0.1.6 and facing the exact same issue. Im passing in -Dbrowser and getProperty is returning null. Im using scala 2.11

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

Finally, getting a chance to look at this today. Busy at work Mifid2 :(

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

Looking first at the Runner, if I do:

tangaroa:example lewismj$ export K="2049" and the run sbt test with println(System.getenv("K")) in one of the steps, I can see that the env is picked up:

Feature: Multiplication
In order to avoid making mistakes
As a dummy
I want to multiply numbers

@my-test
Scenario: Multiply two variables # Multiplication.feature:7
2049
Given a variable x with value 2 # MultiplicationSteps.scala:44
And a variable y with value 3 # MultiplicationSteps.scala:49
When I multiply x * y # MultiplicationSteps.scala:53
Then I get 6 # MultiplicationSteps.scala:57

1 Scenarios (1 passed)
4 Steps (4 passed)
0m0.117s

Which I think is fine for the runner (running tests as a JUnit framework), I will look at the standalone plugin...

from cucumber.

lewismj avatar lewismj commented on June 9, 2024

For the next (sbt 1.0) version of the plugin (not the runner) you can override the environment variables by setting an 'envProperties' flag, e.g.

CucumberPlugin.envProperties := Map("K"->"2049")

The runner documentation and plugin doc should show how to filter by tags.
e.g.
sbt "cucumber --tags ~@my-tag"

Will be a few hours before its checked in and published.

n.b. Unfortunately the SBT interface has changed so the next version of the plugin will be SBT 1.0.2 only.

from cucumber.

Related Issues (20)

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.