ru.yandex.qatools.allure.annotations.Description Java Examples

The following examples show how to use ru.yandex.qatools.allure.annotations.Description. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AllureReporter.java    From allure-cucumberjvm with Apache License 2.0 6 votes vote down vote up
private Description getDescriptionAnnotation(final String description) {
    return new Description() {
        @Override
        public String value() {
            return description;
        }

        @Override
        public DescriptionType type() {
            return DescriptionType.TEXT;
        }

        @Override
        public Class<? extends Annotation> annotationType() {
            return Description.class;
        }
    };
}
 
Example #2
Source File: Allure1Annotations.java    From allure-java with Apache License 2.0 5 votes vote down vote up
public void updateDescription(final TestResult result) {
    final Method method = getMethod();
    if (method.isAnnotationPresent(Description.class)) {
        final Description description = method.getAnnotation(Description.class);
        if (description.type().equals(DescriptionType.HTML)) {
            result.setDescriptionHtml(description.value());
        } else {
            result.setDescription(description.value());
        }
    }
}
 
Example #3
Source File: Allure1TestCaseAspectsTest.java    From allure-java with Apache License 2.0 5 votes vote down vote up
@Title("testcase")
@Description("testcase description")
@Issue("ISSUE-2")
@Issues(@Issue("ISSUE-22"))
@TestCaseId("TEST-1")
@Stories("story2")
@Features("feature2")
@Severity(SeverityLevel.CRITICAL)
@org.testng.annotations.Test
public void testSomething() {
    parameterWithoutName = "testValue1";
    parameterWithName = "testValue2";
}
 
Example #4
Source File: Allure1TestCaseAspectsTest.java    From allure-java with Apache License 2.0 5 votes vote down vote up
@Title("testcase")
@Description("testcase description")
@Issue("ISSUE-2")
@Issues(@Issue("ISSUE-22"))
@TestCaseId("TEST-1")
@Stories("story2")
@Features("feature2")
@Severity(SeverityLevel.CRITICAL)
@org.junit.Test
public void testSomething() {
    parameterWithoutName = "testValue1";
    parameterWithName = "testValue2";
}
 
Example #5
Source File: AnnotationManager.java    From allure1 with Apache License 2.0 5 votes vote down vote up
/**
 * Set default values for annotations.
 * Initial annotation take precedence over the default annotation when both annotation types are present
 *
 * @param defaultAnnotations default value for annotations
 */
public void setDefaults(Annotation[] defaultAnnotations) {
    if (defaultAnnotations == null) {
        return;
    }
    for (Annotation each : defaultAnnotations) {
        Class<? extends Annotation> key = each.annotationType();
        if (Title.class.equals(key) || Description.class.equals(key)) {
            continue;
        }
        if (!annotations.containsKey(key)) {
            annotations.put(key, each);
        }
    }
}
 
Example #6
Source File: AnnotationManager.java    From allure1 with Apache License 2.0 5 votes vote down vote up
/**
 * Find first {@link ru.yandex.qatools.allure.annotations.Description} annotation
 *
 * @return {@link ru.yandex.qatools.allure.model.Description} or null if
 * annotation doesn't present
 */
public ru.yandex.qatools.allure.model.Description getDescription() {
    Description description = getAnnotation(Description.class);
    return description == null ? null : new ru.yandex.qatools.allure.model.Description()
            .withValue(description.value())
            .withType(description.type());
}
 
Example #7
Source File: AnnotationManager.java    From allure1 with Apache License 2.0 2 votes vote down vote up
/**
 * @return true if {@link ru.yandex.qatools.allure.annotations.Description}
 * annotation present in {@link #annotations} and false otherwise
 */
public boolean isDescriptionAnnotationPresent() {
    return isAnnotationPresent(Description.class);
}