damianszczepanik / cucumber-reporting

HTML reports for Cucumber
GNU Lesser General Public License v2.1
548 stars 403 forks source link

Not compatible with cucumber JVM-1.0.9 #57

Closed holalchi closed 10 years ago

holalchi commented 10 years ago

I upgrade to Cucumber JVM 1.0.9 and tested my feature file. Tested passed and result json file generated I tried to generate the report using cucumber-reporting-0.0.22.jar

Error message

{code} org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getName' in class net.masterthought.cucumber.json.Step threw exception java.lang.NullPointerException at templates/featureReport.vm[line 210, column 25] {code}

kingsleyh commented 10 years ago

Hi

Could you send me an example of the json

--k

Sent from my iPad

On 12 Mar 2014, at 17:02, holalchi notifications@github.com wrote:

I upgrade to Cucumber JVM 1.0.9 and tested my feature file. Tested passed and result json file generated I tried to generate the report using cucumber-reporting-0.0.22.jar

Error message

{code} org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getName' in class net.masterthought.cucumber.json.Step threw exception java.lang.NullPointerException at templates/featureReport.vm[line 210, column 25] {code}

— Reply to this email directly or view it on GitHub.

holalchi commented 10 years ago

Below you can see the difference between two version of json files

from Cucumber JVM 1.0.2 (json content)

    "steps": [
      {
        "result": {
          "duration": 255780848,
          "status": "passed"
        },
        "name": "a \"ABC\" ABC customer",
        "keyword": "Given ",
        "line": 7,
        "match": {
          "arguments": [
            {
              "val": "ABC",
              "offset": 3
            }
          ],
          "location": "ABCTestStepDefs.a_ABC_customer(String)"
        }
      },

from Cucumber JVM 1.0.9 (json content)

    "steps": [
      {
        "name": "a \"ABC\" ABC customer",
        "keyword": "Given ",
        "line": 7,
      },
kingsleyh commented 10 years ago

Hi

I have had a quick look. The actual exception is due to some new code that provides step execution durations - it assumes the presence of a result section in the json.

Which brings me to the main issue - there is no result section for each step in the json - this means it's impossible to tell if a step has passed or failed and the duration time of the step.

I think it's unlikely that this would have been removed from cucumber jvm - so I think this is a bug with the json generation in cucumber jvm 1.0.9

--K

On 12 Mar 2014, at 17:28, holalchi notifications@github.com wrote:

Below you can see the difference between two version of json files

from Cucumber JVM 1.0.2 (json content)

"steps": [
  {
    "result": {
      "duration": 255780848,
      "status": "passed"
    },
    "name": "a \"ABC\" ABC customer",
    "keyword": "Given ",
    "line": 7,
    "match": {
      "arguments": [
        {
          "val": "ABC",
          "offset": 3
        }
      ],
      "location": "ABCTestStepDefs.a_ABC_customer(String)"
    }
  },

from Cucumber JVM 1.0.9 (json content)

"steps": [
  {
    "name": "a \"ABC\" ABC customer",
    "keyword": "Given ",
    "line": 7,
  },

— Reply to this email directly or view it on GitHub.

holalchi commented 10 years ago

Is there any way to enable detail json file? Right now,I am using below format format = {"pretty", "html:target/cucumber", "json-pretty:target/cucumber.json"}

Pls suggest.

kingsleyh commented 10 years ago

I'm not too sure to be honest

Sent from my iPad

On 12 Mar 2014, at 17:46, holalchi notifications@github.com wrote:

Is there any way to enable detail json file? Right now,I am using below format format = {"pretty", "html:target/cucumber", "json-pretty:target/cucumber.json"}

Pls suggest.

— Reply to this email directly or view it on GitHub.

holalchi commented 10 years ago

Hi Kingsleyh, only reason i want to upgrade JVM 1.0.2 to 1.0.9 is to get support for "cucumber.options" , so that i can run maven command with options from Jenkins to override the options from RunCukesTest.java file $mvn test -Dcucumber.options="--tags @all_test --format html:target/cucumber json-pretty:target/cucumber.json"

Please suggest some ways to override the RunCukesTest options from command line

Thanks!

kingsleyh commented 10 years ago

why not move to the latest version? 1.1.5

--K

On 13 Mar 2014, at 14:15, holalchi notifications@github.com wrote:

Hi Kingsleyh, only reason i want to upgrade JVM 1.0.2 to 1.0.9 is to get support for , so that i can run maven command with options from Jenkins to override the options from RunCukesTest.java file $mvn test -Dcucumber.options="--tags @all_test --format html:target/cucumber json-pretty:target/cucumber.json"

Please suggest some ways to override the RunCukesTest options from command line

Thanks!

— Reply to this email directly or view it on GitHub.

holalchi commented 10 years ago

With JVM 1.1.5, junit 4.11 ,maven-surefire-plugin 2.14.1 , I get below error, any clue what could be wrong?

java.lang.TypeNotPresentException: Type Cucumber not present at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:270) at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:114) at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:125) at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:49) at sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:390) at sun.reflect.annotation.AnnotationParser.parseClassValue(AnnotationParser.java:371) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:300) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3178) at java.lang.Class.getAnnotation(Class.java:3137) at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.isValidJUnit4Test(JUnit4TestChecker.java:64) at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:51) at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:97) at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:206) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray2(ReflectionUtils.java:208) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:159) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)

at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)

kingsleyh commented 10 years ago

I think there were some changes to the Cucumber runner class - check the docs

On 13 Mar 2014, at 14:15, holalchi notifications@github.com wrote:

Hi Kingsleyh, only reason i want to upgrade JVM 1.0.2 to 1.0.9 is to get support for , so that i can run maven command with options from Jenkins to override the options from RunCukesTest.java file $mvn test -Dcucumber.options="--tags @all_test --format html:target/cucumber json-pretty:target/cucumber.json"

Please suggest some ways to override the RunCukesTest options from command line

Thanks!

— Reply to this email directly or view it on GitHub.

holalchi commented 10 years ago

Cucumber-JVM/Core 1.1.4 is having fix for this issue. The ticket can be closed. Thanks!