Search in sources :

Example 1 with Issues

use of ru.yandex.qatools.allure.annotations.Issues in project allure-cucumberjvm by allure-framework.

the class AllureReporter method startOfScenarioLifeCycle.

@Override
public void startOfScenarioLifeCycle(Scenario scenario) {
    //to avoid duplicate steps in case of Scenario Outline
    if (SCENARIO_OUTLINE_KEYWORDS.contains(scenario.getKeyword())) {
        synchronized (gherkinSteps) {
            gherkinSteps.clear();
        }
    }
    currentStatus = PASSED;
    TestCaseStartedEvent event = new TestCaseStartedEvent(uid, scenario.getName());
    event.setTitle(scenario.getName());
    Collection<Annotation> annotations = new ArrayList<>();
    SeverityLevel level = getSeverityLevel(scenario);
    if (level != null) {
        annotations.add(getSeverityAnnotation(level));
    }
    Issues issues = getIssuesAnnotation(scenario);
    if (issues != null) {
        annotations.add(issues);
    }
    TestCaseId testCaseId = getTestCaseIdAnnotation(scenario);
    if (testCaseId != null) {
        annotations.add(testCaseId);
    }
    annotations.add(getFeaturesAnnotation(feature.getName()));
    annotations.add(getStoriesAnnotation(scenario.getName()));
    annotations.add(getDescriptionAnnotation(scenario.getDescription()));
    AnnotationManager am = new AnnotationManager(annotations);
    am.update(event);
    event.withLabels(AllureModelUtils.createTestFrameworkLabel("CucumberJVM"));
    ALLURE_LIFECYCLE.fire(event);
}
Also used : AnnotationManager(ru.yandex.qatools.allure.utils.AnnotationManager) SeverityLevel(ru.yandex.qatools.allure.model.SeverityLevel) Issues(ru.yandex.qatools.allure.annotations.Issues) ArrayList(java.util.ArrayList) TestCaseId(ru.yandex.qatools.allure.annotations.TestCaseId) Annotation(java.lang.annotation.Annotation)

Aggregations

Annotation (java.lang.annotation.Annotation)1 ArrayList (java.util.ArrayList)1 Issues (ru.yandex.qatools.allure.annotations.Issues)1 TestCaseId (ru.yandex.qatools.allure.annotations.TestCaseId)1 SeverityLevel (ru.yandex.qatools.allure.model.SeverityLevel)1 AnnotationManager (ru.yandex.qatools.allure.utils.AnnotationManager)1