Search in sources :

Example 1 with HookType

use of io.cucumber.plugin.event.HookType in project cucumber-jvm by cucumber.

the class TeamCityPlugin method extractName.

private String extractName(TestStep step) {
    if (step instanceof PickleStepTestStep) {
        PickleStepTestStep pickleStepTestStep = (PickleStepTestStep) step;
        return pickleStepTestStep.getStep().getText();
    }
    if (step instanceof HookTestStep) {
        HookTestStep hook = (HookTestStep) step;
        HookType hookType = hook.getHookType();
        switch(hookType) {
            case BEFORE:
                return "Before";
            case AFTER:
                return "After";
            case BEFORE_STEP:
                return "BeforeStep";
            case AFTER_STEP:
                return "AfterStep";
            default:
                return hookType.name().toLowerCase(Locale.US);
        }
    }
    return "Unknown step";
}
Also used : PickleStepTestStep(io.cucumber.plugin.event.PickleStepTestStep) HookTestStep(io.cucumber.plugin.event.HookTestStep) HookType(io.cucumber.plugin.event.HookType)

Aggregations

HookTestStep (io.cucumber.plugin.event.HookTestStep)1 HookType (io.cucumber.plugin.event.HookType)1 PickleStepTestStep (io.cucumber.plugin.event.PickleStepTestStep)1