Tyler-Keith-Thompson / CucumberSwift

A lightweight swift Cucumber implementation
https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/
MIT License
74 stars 19 forks source link

Cucumber export JSON have missing Property's #60

Closed bitsmakerde closed 1 year ago

bitsmakerde commented 1 year ago

Hi @Tyler-Keith-Thompson

I try to import the test report inside my Jira, but it was never possible.

There a 4 option to import:

  1. JVM
  2. JS
  3. Ruby
  4. other

All of them aren't working for me. Then I Crete JSON test Projekt and find out in your report some property's are missing.

Uncaught Error Error: Could not validate Cucumber JSON.
Errors from #/definitions/BehaveJson validation: [
  {
    "instancePath": "/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "status"
    },
    "message": "must have required property 'status'"
  }
]
Errors from #/definitions/CucumberJsJson validation: [
  {
    "instancePath": "/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "line"
    },
    "message": "must have required property 'line'"
  }
]
Errors from #/definitions/CucumberJvmJson validation: [
  {
    "instancePath": "/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "line"
    },
    "message": "must have required property 'line'"
  }
]
Errors from #/definitions/CucumberRubyJson validation: [
  {
    "instancePath": "/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "line"
    },
    "message": "must have required property 'line'"
  }
]
Error: Could not validate Cucumber JSON.
Errors from #/definitions/BehaveJson validation: [
  {
    "instancePath": "/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "status"
    },
    "message": "must have required property 'status'"
  }
]
Errors from #/definitions/CucumberJsJson validation: [
  {
    "instancePath": "/0/elements/0/steps/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "arguments"
    },
    "message": "must have required property 'arguments'"
  },
  {
    "instancePath": "/0/elements/0/steps/0",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "hidden"
    },
    "message": "must have required property 'hidden'"
  },
  {
    "instancePath": "/0/elements/0/steps/0",
    "schemaPath": "#/anyOf",
    "keyword": "anyOf",
    "params": {},
    "message": "must match a schema in anyOf"
  }
]
Errors from #/definitions/CucumberJvmJson validation: [
  {
    "instancePath": "/1",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "line"
    },
    "message": "must have required property 'line'"
  }
]
Errors from #/definitions/CucumberRubyJson validation: [
  {
    "instancePath": "/1",
    "schemaPath": "#/required",
    "keyword": "required",
    "params": {
      "missingProperty": "line"
    },
    "message": "must have required property 'line'"
  }
]

I use for the check this tool: https://github.com/cucumber/cucumber-json-converter

Perhaps its possible to fix this

Tyler-Keith-Thompson commented 1 year ago

Sure! I will need to dive into what it expects, but this seems like a reasonable request. I honestly can't remember what I used to try and match the specification before, but I think I stopped once the HTML reporter I was using was happy.

bitsmakerde commented 1 year ago

@Tyler-Keith-Thompson sounds great. Here is the link to my test project with which I get the errors from. Perhaps it can help you.

https://github.com/bitsmakerde/cucumber-json-check

bitsmakerde commented 1 year ago

@Tyler-Keith-Thompson I make a pull request for this issue. The schema checker be happy now. I can import to ma plugin, but not all Feature or scenarios are detected there. I have no idea why.

Tyler-Keith-Thompson commented 1 year ago

Looks like there's something goofy with the pipeline, but as soon as I fix that and the library deploys I will close this issue.

Tyler-Keith-Thompson commented 1 year ago

This was release in CucumberSwift 3.3.25! Thank you for your PR!