mixin collapseMethodTable(children)
    table.table.table-hover.table-dark.bg-dark
        thead
            tr
                th(scope="col") Method
                th(scope="col") Status
                th(scope="col") Duration
        tbody
            - var index = 0
            each child in children
                - index++
                tr.accordion-toggle(data-toggle="collapse", data-target="#collapse" + index, style="cursor:pointer", title="View details")
                    td #{child.test.replace("#", ".")}
                    td
                        if !child.result
                            span.badge.badge-warning Not run
                        else if child.result.status === 'Pass'
                            span.badge.badge-success Passed
                        else if child.result.status === 'Fail'
                            span.badge.badge-danger Failed
                        else
                            span.badge.badge-secondary Skipped
                    td #{child.result && child.result.duration ? child.result.duration + "ms" : "N/A"}
                tr.accordion-body(id="collapse" + index, class="collapse")
                    td(colspan="3")
                        table.table.table-dark.bg-dark
                            tbody
                                tr
                                    th(scope="col") Message:
                                tr
                                    td #{child.result && child.result.message ? child.result.message : "N/A"}
                                tr
                                    th(scope="col") Stack trace:
                                tr
                                    td
                                        if child.result && child.result.details
                                            pre.text-light: code #{child.result.details}
                                        else
                                            span N/A