use of com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ in project allure-java by reportportal.
the class StoryMetaTest method verify_a_story_with_meta_attributes.
@Test
public void verify_a_story_with_meta_attributes() {
run(format, STORY_PATH, new EmptySteps());
ArgumentCaptor<StartTestItemRQ> startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client).startTestItem(startCaptor.capture());
verify(client).startTestItem(same(storyId), startCaptor.capture());
verify(client).startTestItem(same(scenarioId), any());
List<StartTestItemRQ> items = startCaptor.getAllValues();
StartTestItemRQ startSuite = items.get(0);
assertThat(startSuite.getAttributes(), allOf(notNullValue(), hasSize(SUITE_ATTRIBUTES.size())));
Set<ItemAttributesRQ> suiteAttributes = startSuite.getAttributes();
suiteAttributes.forEach(a -> assertThat(SUITE_ATTRIBUTES, hasItem(Pair.of(a.getKey(), a.getValue()))));
StartTestItemRQ startScenario = items.get(1);
assertThat(startScenario.getAttributes(), empty());
String description = startSuite.getDescription();
SUITE_DESCRIPTION_LINKS.forEach(d -> assertThat(description, containsString(d)));
}
use of com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ in project allure-java by reportportal.
the class SeverityAnnotationTest method test_severity_annotation_method_level_processing.
@Test
public void test_severity_annotation_method_level_processing() {
runTests(Collections.singletonList(TestNgListener.class), TestPriorityMethodLevel.class);
// Start launch
verify(client).startLaunch(any());
// Start parent suites
verify(client).startTestItem(any());
// Start test class
verify(client).startTestItem(same(suitedUuid), any());
ArgumentCaptor<StartTestItemRQ> startMethodCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test step
verify(client).startTestItem(same(testClassUuid), startMethodCapture.capture());
StartTestItemRQ startMethod = startMethodCapture.getValue();
Set<ItemAttributesRQ> attributes = startMethod.getAttributes();
List<ItemAttributesRQ> priorityAttributes = attributes.stream().filter(a -> "priority".equals(a.getKey())).collect(Collectors.toList());
assertThat(priorityAttributes, hasSize(1));
ItemAttributesRQ priority = priorityAttributes.get(0);
assertThat(priority.getValue(), equalTo("blocker"));
}
use of com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ in project allure-java by reportportal.
the class SeverityAnnotationTest method test_severity_annotation_class_level_processing.
@Test
public void test_severity_annotation_class_level_processing() {
runTests(Collections.singletonList(TestNgListener.class), TestPriorityClassLevel.class);
// Start launch
verify(client).startLaunch(any());
// Start parent suites
verify(client).startTestItem(any());
// Start test class
verify(client).startTestItem(same(suitedUuid), any());
ArgumentCaptor<StartTestItemRQ> startMethodCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test step
verify(client).startTestItem(same(testClassUuid), startMethodCapture.capture());
StartTestItemRQ startMethod = startMethodCapture.getValue();
Set<ItemAttributesRQ> attributes = startMethod.getAttributes();
List<ItemAttributesRQ> priorityAttributes = attributes.stream().filter(a -> "priority".equals(a.getKey())).collect(Collectors.toList());
assertThat(priorityAttributes, hasSize(1));
ItemAttributesRQ priority = priorityAttributes.get(0);
assertThat(priority.getValue(), equalTo("critical"));
}
Aggregations