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

io.cucumber.core.plugin.FeatureTracker Maven / Gradle / Ivy

There is a newer version: 4.2.8
Show newest version
package io.cucumber.core.plugin;

import io.cucumber.plugin.event.TestCaseStarted;

import java.net.URI;
import java.util.*;

public class FeatureTracker {
    private static ThreadLocal> STARTED_FEATURES = ThreadLocal.withInitial(HashSet::new);

    public static void startNewFeature(TestCaseStarted event) {
        STARTED_FEATURES.get().add(event.getTestCase().getUri());
    }

    public static boolean isNewFeature(TestCaseStarted event) {
        return !STARTED_FEATURES.get().contains(event.getTestCase().getUri());
    }

    public static boolean isASingleBrowserScenario(TestCaseStarted event) {
        return event.getTestCase().getTags().contains("@singlebrowser");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy