Search in sources :

Example 1 with TestCaseStartedEvent

use of ru.yandex.qatools.allure.events.TestCaseStartedEvent in project allure-cucumberjvm by allure-framework.

the class AllureRunListener method testStarted.

@Override
public void testStarted(Description description) throws IllegalAccessException {
    if (description.isTest()) {
        String methodName = extractMethodName(description);
        TestCaseStartedEvent event = new TestCaseStartedEvent(getSuiteUid(description), methodName);
        event.setTitle(methodName);
        Collection<Annotation> annotations = new ArrayList<>();
        for (Annotation annotation : description.getAnnotations()) {
            annotations.add(annotation);
        }
        AnnotationManager am = new AnnotationManager(annotations);
        am.update(event);
        getLifecycle().fire(event);
    }
}
Also used : AnnotationManager(ru.yandex.qatools.allure.utils.AnnotationManager) ArrayList(java.util.ArrayList) Annotation(java.lang.annotation.Annotation) TestCaseStartedEvent(ru.yandex.qatools.allure.events.TestCaseStartedEvent)

Example 2 with TestCaseStartedEvent

use of ru.yandex.qatools.allure.events.TestCaseStartedEvent in project allure-cucumberjvm by allure-framework.

the class AllureRunListener method startFakeTestCase.

public void startFakeTestCase(Description description) throws IllegalAccessException {
    String uid = getSuiteUid(description);
    String name = description.isTest() ? description.getMethodName() : description.getClassName();
    TestCaseStartedEvent event = new TestCaseStartedEvent(uid, name);
    event.setTitle(name);
    AnnotationManager am = new AnnotationManager(description.getAnnotations());
    am.update(event);
    getLifecycle().fire(event);
}
Also used : AnnotationManager(ru.yandex.qatools.allure.utils.AnnotationManager) TestCaseStartedEvent(ru.yandex.qatools.allure.events.TestCaseStartedEvent)

Aggregations

TestCaseStartedEvent (ru.yandex.qatools.allure.events.TestCaseStartedEvent)2 AnnotationManager (ru.yandex.qatools.allure.utils.AnnotationManager)2 Annotation (java.lang.annotation.Annotation)1 ArrayList (java.util.ArrayList)1