Skip to content

Commit

Permalink
ReportPortalHook: Tests WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Jan 8, 2024
1 parent 2b99260 commit e21c219
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import com.epam.reportportal.service.ReportPortalClient;
import com.epam.reportportal.util.test.CommonUtils;
import com.epam.ta.reportportal.ws.model.StartTestItemRQ;
import com.intuit.karate.Results;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.ArgumentCaptor;

import java.util.List;
Expand All @@ -20,6 +22,7 @@
import static org.mockito.Mockito.*;

public class SimpleItemNameTest {
private static final String TEST_FEATURE = "classpath:feature/simple.feature";
private final String featureId = CommonUtils.namedId("feature_");
private final String scenarioId = CommonUtils.namedId("scenario_");
private final List<String> stepIds = Stream.generate(() -> CommonUtils.namedId("step_"))
Expand All @@ -37,9 +40,15 @@ public void setupMock() {
mockBatchLogging(client);
}

@Test
public void test_item_names_simple() {
var results = TestUtils.runAsReport(rp, "classpath:feature/simple.feature");
@ParameterizedTest
@ValueSource(booleans = {true, false})
public void test_item_names_simple(boolean report) {
Results results;
if (report) {
results = TestUtils.runAsReport(rp, TEST_FEATURE);
} else {
results = TestUtils.runAsHook(rp, TEST_FEATURE);
}
assertThat(results.getFailCount(), equalTo(0));

ArgumentCaptor<StartTestItemRQ> featureCaptor = ArgumentCaptor.forClass(StartTestItemRQ.class);
Expand Down

0 comments on commit e21c219

Please sign in to comment.