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

com.trivago.gherkin.GherkinTranslations Maven / Gradle / Ivy

Go to download

Plugin for slicing Cucumber features into the smallest possible parts for parallel test execution.

There is a newer version: 1.12.0
Show newest version
package com.trivago.gherkin;

import gherkin.GherkinDialect;
import gherkin.GherkinDialectProvider;

import javax.inject.Inject;
import javax.inject.Singleton;

@Singleton
class GherkinTranslations {

    private static final String SCENARIO = "Scenario";
    private static final String BACKGROUND = "Background";

    private final GherkinDialectProvider gherkinDialectProvider;

    @Inject
    GherkinTranslations() {
        gherkinDialectProvider = new GherkinDialectProvider();
    }

    String getScenarioKeyword(final String language) {
        GherkinDialect dialect;
        try {
            dialect = gherkinDialectProvider.getDialect(language, null);
        } catch (Exception e) {
            return SCENARIO;
        }
        return dialect.getScenarioKeywords().get(0);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy