use of com.epam.reportportal.jbehave.integration.EmptySteps in project allure-java by reportportal.
the class ScenarioMetaTest method verify_a_scenario_with_meta_attributes.
@Test
public void verify_a_scenario_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(), empty());
StartTestItemRQ startScenario = items.get(1);
assertThat(startScenario.getAttributes(), allOf(notNullValue(), hasSize(STEP_ATTRIBUTES.size())));
Set<ItemAttributesRQ> scenarioAttributes = startScenario.getAttributes();
scenarioAttributes.forEach(a -> assertThat(STEP_ATTRIBUTES, hasItem(Pair.of(a.getKey(), a.getValue()))));
}
use of com.epam.reportportal.jbehave.integration.EmptySteps 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)));
}
Aggregations