I need the help of the Parsing-Champions. My JSON looks like this when I use the API, it is structured in “Teststeps” and “TeststepFolders”. The teststeps are always above the belonging teststepFolder.
The example JSON looks like this:
[{
“teststeps” : [ {
“name” : “b”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “‘xyz’”,
“dType” : “TestStep”
} ],
“name” : “a”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“teststeps” : [ {
“name” : “d”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “e”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“teststeps” : [ {
“name” : “g”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “f”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
} ],
“name” : “c”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“teststeps” : [ {
“name” : “i”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “j”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “k”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“teststeps” : [ {
“name” : “m”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “n”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“teststeps” : [ {
“name” : “p”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “o”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
} ],
“name” : “l”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“teststeps” : [ {
“name” : “r”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “q”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“teststeps” : [ {
“teststeps” : [ {
“name” : “u”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “t”,
“description” : “null”,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
} ],
“name” : “s”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
} ],
“name” : “h”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“teststeps” : [ {
“teststeps” : [ {
“name” : “x”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “w”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“name” : “z”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “z”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “aa”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “ab”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “v”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“teststeps” : [ {
“name” : “ad”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “ae”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “af”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
} ],
“name” : “ac”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStepFolder”
}, {
“name” : “ag”,
“description” : null,
“verdict” : “PASSED”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}, {
“name” : “ah”,
“description” : null,
“verdict” : “NONE”,
“expectedResult” : “xyz”,
“dType” : “TestStep”
}]
and I need the result to look like this:
I am thankful for any help