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

net.serenitybdd.cucumber.suiteslicing.TestStatistics Maven / Gradle / Ivy

There is a newer version: 4.2.9
Show newest version
package net.serenitybdd.cucumber.suiteslicing;

import io.cucumber.gherkin.ScenarioLineCountStatistics;
import net.thucydides.model.util.EnvironmentVariables;

import java.math.BigDecimal;
import java.net.URI;
import java.util.List;

import static net.thucydides.model.ThucydidesSystemProperty.SERENITY_TEST_STATISTICS_DIR;

public interface TestStatistics {

    BigDecimal scenarioWeightFor(String feature, String scenario);

    List records();

    static TestStatistics from(EnvironmentVariables environmentVariables, List featurePaths) {
        String directory = environmentVariables.getProperty(SERENITY_TEST_STATISTICS_DIR);
        if (directory == null) {
            return ScenarioLineCountStatistics.fromFeaturePaths(featurePaths);
        } else {
            return MultiRunTestStatistics.fromRelativePath(directory);
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy