Forum Discussion

sindhusetty's avatar
sindhusetty
New Contributor
4 years ago

Uploading cucumber results to Zephyr issues

I have iOS automation developed with pytest-bdd , I have created BDD scenarios on Zephyr, downloaded the feature files, and executed them on my machine and the results are exported in JSON format. I have attached the JSON file below.  

 

 

{"report": {"environment": {"Python": "3.8.2", "Platform": "macOS-10.16-x86_64-i386-64bit"}, "tests": [{"name": "step_definitions/test_welcome.py::test_QA2_swipe_to_learn_more", "duration": 31.95059585571289, "run_index": 0, "setup": {"name": "setup", "duration": 0.024325847625732422, "outcome": "passed"}, "call": {"name": "call", "duration": 31.90162205696106, "outcome": "passed"}, "teardown": {"name": "teardown", "duration": 0.00032210350036621094, "outcome": "passed"}, "outcome": "passed"}, {"name": "step_definitions/test_welcome.py::test_QA2_for_clinicians_tab", "duration": 6.670141696929932, "run_index": 1, "setup": {"name": "setup", "duration": 0.0002689361572265625, "outcome": "passed"}, "call": {"name": "call", "duration": 6.669113874435425, "outcome": "passed"}, "teardown": {"name": "teardown", "duration": 0.0004899501800537109, "outcome": "passed"}, "outcome": "passed"}], "summary": {"passed": 2, "num_tests": 2, "duration": 38.75271916389465}, "created_at": "2021-05-19 13:45:06.021026"}}
 
 
I uploaded the .json file to the cycle and the test cases are not getting executed to PASS. They are still in an Unexecuted state. I am new to Zephyr BDD. Is there something I am missing?
  • Hi sindhusetty 

     

    In Zephyr Squad, the Scenario name is the Test name.

     

    The JSON file that you have shared doesn't appear to be in the format we support today.

    Our parsers support standard cucumber json output file. Please refer to the attached sample json.

    You need to convert the output file to the supported format.


    In the output file, we expect the “name” attribute to not contain any special characters due to the issue mentioned above. Providing a space is fine.

  • sindhusetty's avatar
    sindhusetty
    4 years ago

    Thank you! that sample result helped. I tried and got the execution status to PASS. 

  • Hello sindhusetty ,

     

    Could you please try again by updating the test name with special characters as hyphen - and underscore _ only. On execution, the test details are fetched from Jira. There is a known issue with Jira where the search issues results are empty when special characters are used.

    https://jira.atlassian.com/browse/JRACLOUD-75866

     

    Also, please ensure each test names are unique.

     

     

     

    • sindhusetty's avatar
      sindhusetty
      New Contributor
      Hello,

      I have 2 questions for you. First - What do you mean by test name?
      Is it scenario name? feature name or else my method name?
      I have changed my scenario names without spaces for ex: swipe_to_learn_more
      Method also with underscores - test_swipe_to_learn_more

      Here is my JSON report after executing

      {"report": {"environment": {"Python": "3.8.2", "Platform":
      "macOS-10.16-x86_64-i386-64bit"}, "tests": [{"name":
      "step_definitions/test_welcome.py::test_swipe_to_learn_more", "duration":
      29.945682048797607, "run_index": 0, "setup": {"name": "setup", "duration":
      0.024849891662597656, "outcome": "passed"}, "call": {"name": "call",
      "duration": 29.89575719833374, "outcome": "passed"}, "teardown": {"name":
      "teardown", "duration": 0.000225067138671875, "outcome": "passed"},
      "outcome": "passed"}, {"name":
      "step_definitions/test_welcome.py::test_for_clinicians_tab", "duration":
      7.033468246459961, "run_index": 1, "setup": {"name": "setup", "duration":
      0.00020313262939453125, "outcome": "passed"}, "call": {"name": "call",
      "duration": 7.032575845718384, "outcome": "passed"}, "teardown": {"name":
      "teardown", "duration": 0.00048613548278808594, "outcome": "passed"},
      "outcome": "passed"}], "summary": {"passed": 2, "num_tests": 2, "duration":
      37.09014678001404}, "created_at": "2021-05-19 20:22:22.341222"}}



      Can you please double-check again and let me know exactly where? Thanks for
      your patience.




      Thanks,

      Naga Sindhu Setty
      • sanjeevpande's avatar
        sanjeevpande
        Staff

        Hi sindhusetty 

         

        In Zephyr Squad, the Scenario name is the Test name.

         

        The JSON file that you have shared doesn't appear to be in the format we support today.

        Our parsers support standard cucumber json output file. Please refer to the attached sample json.

        You need to convert the output file to the supported format.


        In the output file, we expect the “name” attribute to not contain any special characters due to the issue mentioned above. Providing a space is fine.