All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.serenitybdd.reports.model.FailuresByFeature.kt Maven / Gradle / Ivy

There is a newer version: 4.2.3
Show newest version
package net.serenitybdd.reports.model

import net.thucydides.model.domain.TestOutcome
import net.thucydides.model.reports.TestOutcomes

class FailuresByFeature(val featureName: String, val failures: List) {
    companion object {
        fun from(testOutcomes: TestOutcomes): List {
            val failingOutcomesGroupedByFeature = testOutcomes.unsuccessfulTests.tests.groupBy { it.userStory }
            return failingOutcomesGroupedByFeature.keys.map { userStory ->
                FailuresByFeature(userStory.name, failingScenariosIn(failingOutcomesGroupedByFeature.getOrDefault(userStory, listOf())))
            }.sortedBy { it.featureName }
        }

        private fun failingScenariosIn(testOutcomes: List): List {
            return testOutcomes.map { ScenarioSummary.ofFailingScenariosIn(it) }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy