/** * Sets title using fluent-api * * @param title value to set * @return modified instance */ public TestSuiteStartedEvent withTitle(String title) { setTitle(title); return this; }
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); }
public void update(TestSuiteStartedEvent event) { if (isTitleAnnotationPresent()) { event.setTitle(getTitle()); } if (isDescriptionAnnotationPresent()) { event.setDescription(getDescription()); } if (isStoriesAnnotationPresent()) { event.getLabels().addAll(getStoryLabels()); } if (isFeaturesAnnotationPresent()) { event.getLabels().addAll(getFeatureLabels()); } }
/** * Sets into specified {@link ru.yandex.qatools.allure.events.TestSuiteStartedEvent} * information from Allure annotations. * * @param event to change */ public void update(TestSuiteStartedEvent event) { if (isTitleAnnotationPresent()) { event.setTitle(getTitle()); } if (isDescriptionAnnotationPresent()) { event.setDescription(getDescription()); } if (isIssueAnnotationPresent()) { event.getLabels().add(createIssueLabel(getIssueKey())); } if (isIssuesAnnotationPresent()) { for (String issueKey : getIssueKeys()) { event.getLabels().add(createIssueLabel(issueKey)); } } event.getLabels().addAll(getStoryLabels()); event.getLabels().addAll(getFeatureLabels()); }