Decathlon / tzatziki

Decathlon library to ease and promote Test Driven Development of Java microservices!
Apache License 2.0
61 stars 30 forks source link

Tzatziki {{var}} reporting interpretation #294

Open bmougeot opened 4 months ago

bmougeot commented 4 months ago

🚀 Feature Request

Hello 👋🏼

Subject: Allow tzatziki {{var}} interpretation in report.

Example:

Scenario: This is an example of scenario used in our team
        Given we post "{{tillURL}}/acquisitions":
        """
            {"value": "3608399888925"}
        """
        And we get "{{tillURL}}/transactions/current"

        # ⬇️ here I will retrieve and save in {{id}} my uuid data return by previous step
        And we save result as id 

        And we patch "{{tillURL}}/transactions/current/status":
        """
            {"status": "CANCELED"}
        """

        # ⬇️ here I will call another endpoint by my {{id}} value to assert his new status
        When we get "{{tillURL}}/transactions/{{id}}"
        Then we receive a status OK_200 and:
        """
            {
                "id": "{{id}}",
                "status": "CANCELED"
            }
        """

We are using since few weeks tzatziki for our integration tests and sometimes we should retrieve some data (not unique like an id, uuid, etc) before to do some calls.

Our problem: all {{var}} are not interpreted by our cucumber html (based on cucumber.json generated)

Example: The cucumber.json generated after tests looks like to:

{
   "result": {
         "duration": 139339000,
          "status": "passed"
      },
      "line": 23,
      "name": "we get \"{{tillURL}}/transactions/{{id}}\"", # ⬅️ example
      "match": {
           "arguments": [
                  {....},
                  {
                      "val": "{{tillURL}}/transactions/{{id}}", # ⬅️ example
                      "offset": 8
                   }
            ],
            {....}
       },
         "keyword": "When "
}

Our cucumber html report is generated from the cucumber.json:

Capture d’écran 2024-07-09 à 11 38 21