eroshenkoam / allure-pdf

25 stars 14 forks source link

Problem with deserialize `io.qameta.allure.model.Status` from String "passed" #25

Open prafair opened 2 years ago

prafair commented 2 years ago

The problem

After update to new allure-model version (just wanted to see how it works):

implementation("io.qameta.allure:allure-model:2.18.1")

I received this error:

java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `io.qameta.allure.model.Status` from String "passed": not one of the values accepted for Enum class: [SKIPPED, FAILED, PASSED, BROKEN]
 at [Source: (File); line: 1, column: 652] (through reference chain: io.github.eroshenkoam.allure.model.TestResult["status"])
    at io.github.eroshenkoam.allure.MainCommand.run(MainCommand.java:57)
    at picocli.CommandLine.executeUserObject(CommandLine.java:1769)
    at picocli.CommandLine.access$900(CommandLine.java:145)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2141)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2108)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:1975)
    at picocli.CommandLine.execute(CommandLine.java:1904)
    at io.github.eroshenkoam.allure.AllurePDF.main(AllurePDF.java:13)
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `io.qameta.allure.model.Status` from String "passed": not one of the values accepted for Enum class: [SKIPPED, FAILED, PASSED, BROKEN]
 at [Source: (File); line: 1, column: 652] (through reference chain: io.github.eroshenkoam.allure.model.TestResult["status"])
    at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
    at com.fasterxml.jackson.databind.DeserializationContext.weirdStringException(DeserializationContext.java:1991)
    at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdStringValue(DeserializationContext.java:1219)
    at com.fasterxml.jackson.databind.deser.std.EnumDeserializer._deserializeAltString(EnumDeserializer.java:356)
    at com.fasterxml.jackson.databind.deser.std.EnumDeserializer._fromString(EnumDeserializer.java:230)
    at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:198)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:313)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:176)
    at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4674)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3494)
    at io.github.eroshenkoam.allure.AllurePDFGenerator.generate(AllurePDFGenerator.java:99)
    at io.github.eroshenkoam.allure.MainCommand.run(MainCommand.java:54)
    ... 7 more

Failed test result JSON:

{
  "uuid": "4825f60e-c3e3-40cd-bfc4-5a1d67d2c5ff",
  "historyId": "3b0ee4c165fbdfdc525141f5c6cbb2e2",
  "testCaseId": "[engine:archunit]/[class:<my_class>]/[field:<test_method_name>]",
  "testCaseName": "t<test_method_name>",
  "labels": [
    {
      "name": "junit.platform.uniqueid",
      "value": "[engine:archunit]/[class:<my_class>]/[field:<test_method_name>]"
    },
    {
      "name": "host",
      "value": "MacBook-Pro-4"
    },
    {
      "name": "thread",
      "value": "21729@MacBook-Pro-4.Test worker(1)"
    },
    {
      "name": "framework",
      "value": "junit-platform"
    },
    {
      "name": "language",
      "value": "java"
    }
  ],
  "links": [],
  "name": "<test_method_name>",
  "status": "passed",
  "stage": "finished",
  "description": "",
  "steps": [],
  "attachments": [],
  "parameters": [],
  "start": 1656580404080,
  "stop": 1656580404083
}

Tell us about your environment

jayanthmuthu10 commented 11 months ago

Try like this..

C:\Users\54978\Playwright\allure-pdf-1.6.0\bin>allure-pdf "C:\Users\54978\Playwright\SGEF_V3_Jayanth\allure-results" -o report1.pdf