Search in sources :

Example 1 with EmptySteps

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()))));
}
Also used : ItemAttributesRQ(com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ) EmptySteps(com.epam.reportportal.jbehave.integration.EmptySteps) StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) Test(org.junit.jupiter.api.Test)

Example 2 with EmptySteps

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)));
}
Also used : ItemAttributesRQ(com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ) EmptySteps(com.epam.reportportal.jbehave.integration.EmptySteps) StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) Test(org.junit.jupiter.api.Test)

Aggregations

EmptySteps (com.epam.reportportal.jbehave.integration.EmptySteps)2 StartTestItemRQ (com.epam.ta.reportportal.ws.model.StartTestItemRQ)2 ItemAttributesRQ (com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ)2 Test (org.junit.jupiter.api.Test)2