use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AttributeTests method verify_scenario_attributes_step_reporter.
@Test
public void verify_scenario_attributes_step_reporter() {
TestNG result = TestUtils.runTests(ScenarioStepReporter.class);
assertThat(result.getStatus(), equalTo(0));
ArgumentCaptor<StartTestItemRQ> captor = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client).startTestItem(any(StartTestItemRQ.class));
verify(client).startTestItem(same(featureId), captor.capture());
verify(client, times(3)).startTestItem(same(scenarioId), any(StartTestItemRQ.class));
StartTestItemRQ scenarioItem = captor.getValue();
assertThat(scenarioItem.getAttributes(), allOf(hasSize(3)));
Set<Pair<String, String>> attributes = scenarioItem.getAttributes().stream().map(a -> Pair.of(a.getKey(), a.getValue())).collect(Collectors.toSet());
ATTRIBUTES.forEach(a -> assertThat(attributes, hasItem(equalTo(a))));
String description = scenarioItem.getDescription();
SUITE_DESCRIPTION_LINKS.forEach(d -> assertThat(description, containsString(d)));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class DescriptionAnnotationTest method test_description_conflict_processing.
@Test
public void test_description_conflict_processing() {
runTests(Collections.singletonList(TestNgListener.class), TestTwoDescription.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();
assertThat(startMethod.getDescription(), equalTo("My test description" + AnnotationUtils.MARKDOWN_DELIMITER + "My description description"));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class FlakyAnnotationTest method test_flaky_annotation_method_level_processing.
@Test
public void test_flaky_annotation_method_level_processing() {
runTests(Collections.singletonList(TestNgListener.class), TestFlakyMethodLevel.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> flakyAttributes = attributes.stream().filter(a -> "flaky".equals(a.getValue())).collect(Collectors.toList());
assertThat(flakyAttributes, hasSize(1));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class FlakyAnnotationTest method test_flaky_annotation_class_level_processing.
@Test
public void test_flaky_annotation_class_level_processing() {
runTests(Collections.singletonList(TestNgListener.class), TestFlakyClassLevel.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> flakyAttributes = attributes.stream().filter(a -> "flaky".equals(a.getValue())).collect(Collectors.toList());
assertThat(flakyAttributes, hasSize(1));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class InlineDescriptionTest method verify_a_story_with_meta_attributes.
@Test
public void verify_a_story_with_meta_attributes() {
run(format, STORY_PATH, new DescriptionSteps());
ArgumentCaptor<StartTestItemRQ> startCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client).startTestItem(any(StartTestItemRQ.class));
verify(client).startTestItem(same(storyId), any(StartTestItemRQ.class));
verify(client).startTestItem(same(scenarioId), startCaptor.capture());
ArgumentCaptor<FinishTestItemRQ> finishCaptor = ArgumentCaptor.forClass(FinishTestItemRQ.class);
verify(client).finishTestItem(same(stepId), finishCaptor.capture());
verify(client).finishTestItem(same(scenarioId), any(FinishTestItemRQ.class));
verify(client).finishTestItem(same(stepId), any(FinishTestItemRQ.class));
assertThat(startCaptor.getValue().getDescription(), emptyOrNullString());
assertThat(finishCaptor.getValue().getDescription(), equalTo(DescriptionSteps.DESCRIPTION));
}
Aggregations