diff --git a/src/test/java/com/epam/reportportal/cucumber/FailedTest.java b/src/test/java/com/epam/reportportal/cucumber/FailedTest.java index 49ff98f..5c55032 100644 --- a/src/test/java/com/epam/reportportal/cucumber/FailedTest.java +++ b/src/test/java/com/epam/reportportal/cucumber/FailedTest.java @@ -42,9 +42,13 @@ import static com.epam.reportportal.cucumber.integration.util.TestUtils.filterLogs; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.allOf; +import static org.hamcrest.Matchers.endsWith; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.notNullValue; +import static org.hamcrest.Matchers.startsWith; import static org.mockito.Mockito.*; /** @@ -58,6 +62,10 @@ public class FailedTest { "file:src/test/resources/features/FailedScenario.feature\n" + ERROR_LOG_TEXT; + private static final Pair SCENARIO_CODE_REFERENCES_WITH_ERROR = Pair.of("file:", + "src/test/resources/features/FailedScenario.feature\n" + ERROR_LOG_TEXT + ); + @CucumberOptions(features = "src/test/resources/features/FailedScenario.feature", glue = { "com.epam.reportportal.cucumber.integration.feature" }, plugin = { "pretty", "com.epam.reportportal.cucumber.integration.TestScenarioReporter" }) @@ -161,7 +169,6 @@ public void verify_failed_nested_step_description_scenario_reporter() { FinishTestItemRQ step = finishRqs.get(0); assertThat(step.getDescription(), not(equalTo(ERROR_LOG_TEXT))); - assertThat(step.getDescription(), not(equalTo(DESCRIPTION_ERROR_LOG_TEXT))); } @Test @@ -182,6 +189,8 @@ public void verify_failed_step_description_step_reporter() { FinishTestItemRQ step = finishRqs.get(0); assertThat(step.getDescription(), equalTo(ERROR_LOG_TEXT)); FinishTestItemRQ test = finishRqs.get(1); - assertThat(test.getDescription(), equalTo(DESCRIPTION_ERROR_LOG_TEXT)); + assertThat(test.getDescription(), + allOf(notNullValue(), startsWith(SCENARIO_CODE_REFERENCES_WITH_ERROR.getKey()), endsWith(SCENARIO_CODE_REFERENCES_WITH_ERROR.getValue())) + ); } }