Java Code Examples for ru.yandex.qatools.allure.events.TestSuiteStartedEvent#withLabels()
The following examples show how to use
ru.yandex.qatools.allure.events.TestSuiteStartedEvent#withLabels() .
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: AllureRunListener.java From allure-cucumberjvm with Apache License 2.0 | 5 votes |
public void testSuiteStarted(Description description, String suiteName) throws IllegalAccessException { String[] annotationParams = findFeatureByScenarioName(suiteName); //Create feature and story annotations. Remove unnecessary words from it Features feature = getFeaturesAnnotation(new String[]{annotationParams[0].split(":")[1].trim()}); Stories story = getStoriesAnnotation(new String[]{annotationParams[1].split(":")[1].trim()}); //If it`s Scenario Outline, add example string to story name if (description.getDisplayName().startsWith("|") || description.getDisplayName().endsWith("|")) { story = getStoriesAnnotation(new String[]{annotationParams[1].split(":")[1].trim() + " " + description.getDisplayName()}); } String uid = generateSuiteUid(suiteName); TestSuiteStartedEvent event = new TestSuiteStartedEvent(uid, story.value()[0]); event.setTitle(story.value()[0]); //Add feature and story annotations Collection<Annotation> annotations = new ArrayList<>(); for (Annotation annotation : description.getAnnotations()) { annotations.add(annotation); } annotations.add(story); annotations.add(feature); AnnotationManager am = new AnnotationManager(annotations); am.update(event); event.withLabels(AllureModelUtils.createTestFrameworkLabel("CucumberJVM")); getLifecycle().fire(event); }
Example 2
Source File: AllureMarathonRunListener.java From marathonv5 with Apache License 2.0 | 3 votes |
public void testSuiteStarted(Description description) { String uid = generateSuiteUid(getSuiteName(description)); TestSuiteStartedEvent event = new TestSuiteStartedEvent(uid, getSuiteName(description)); AnnotationManager am = new AnnotationManager(description.getAnnotations()); am.update(event); event.withLabels(AllureModelUtils.createTestFrameworkLabel("Marathon")); getLifecycle().fire(event); }
Example 3
Source File: AllureRunListener.java From allure1 with Apache License 2.0 | 3 votes |
public void testSuiteStarted(Description description) { String uid = generateSuiteUid(description.getClassName()); TestSuiteStartedEvent event = new TestSuiteStartedEvent(uid, description.getClassName()); AnnotationManager am = new AnnotationManager(description.getAnnotations()); am.update(event); event.withLabels(AllureModelUtils.createTestFrameworkLabel("JUnit")); getLifecycle().fire(event); }