Search in sources :

Example 16 with StartTestItemRQ

use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project examples-java by reportportal.

the class ScenarioReporterTestCaseId method buildStartStepRequest.

// Removing Test Case ID from nested steps as redundant
@Override
protected StartTestItemRQ buildStartStepRequest(TestStep testStep, String stepPrefix, String keyword) {
    StartTestItemRQ rq = super.buildStartStepRequest(testStep, stepPrefix, keyword);
    rq.setTestCaseId(null);
    return rq;
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ)

Example 17 with StartTestItemRQ

use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project examples-java by reportportal.

the class ScenarioReporterTestCaseId method buildStartScenarioRequest.

// Getting our custom tag from already parsed attributes and set it as Test Case ID for the item
@Override
protected StartTestItemRQ buildStartScenarioRequest(TestCase testCase, String name, String uri, int line) {
    StartTestItemRQ rq = super.buildStartScenarioRequest(testCase, name, uri, line);
    rq.getAttributes().stream().filter(a -> isNotBlank(a.getValue()) && a.getValue().startsWith(TAG_PREFIX + TEST_TRACKING_TICKET_PREFIX)).findAny().ifPresent(t -> rq.setTestCaseId(t.getValue().substring(// strip tag prefix to make Test Case ID equal to real ticket ID
    TAG_PREFIX.length())));
    return rq;
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ)

Example 18 with StartTestItemRQ

use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project examples-java by reportportal.

the class ScenarioReporterTestCaseId method buildStartStepRequest.

// Removing Test Case ID from nested steps as redundant
@Override
protected StartTestItemRQ buildStartStepRequest(Step step, String stepPrefix, Match match) {
    StartTestItemRQ rq = super.buildStartStepRequest(step, stepPrefix, match);
    rq.setTestCaseId(null);
    return rq;
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ)

Example 19 with StartTestItemRQ

use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project service-api by reportportal.

the class TestItemControllerTest method startRootItemWithoutUuid.

@Test
void startRootItemWithoutUuid() throws Exception {
    StartTestItemRQ rq = new StartTestItemRQ();
    rq.setLaunchUuid("a7b66ef2-db30-4db7-94df-f5f7786b398a");
    rq.setName("RootItem");
    rq.setType("SUITE");
    rq.setParameters(getParameters());
    rq.setStartTime(Date.from(LocalDateTime.now().atZone(ZoneId.of("UTC")).toInstant()));
    mockMvc.perform(post(SUPERADMIN_PROJECT_BASE_URL + "/item").contentType(APPLICATION_JSON).content(objectMapper.writeValueAsBytes(rq)).with(token(oAuthHelper.getSuperadminToken()))).andExpect(status().isCreated());
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Example 20 with StartTestItemRQ

use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project service-api by reportportal.

the class TestItemControllerTest method startChildItemWithoutUuid.

@Test
void startChildItemWithoutUuid() throws Exception {
    StartTestItemRQ rq = new StartTestItemRQ();
    rq.setLaunchUuid("a7b66ef2-db30-4db7-94df-f5f7786b398a");
    rq.setName("ChildItem");
    rq.setType("TEST");
    rq.setParameters(getParameters());
    rq.setStartTime(Date.from(LocalDateTime.now().atZone(ZoneId.of("UTC")).toInstant()));
    mockMvc.perform(post(DEFAULT_PROJECT_BASE_URL + "/item/0f7ca5bc-cfae-4cc1-9682-e59c2860131e").content(objectMapper.writeValueAsBytes(rq)).contentType(APPLICATION_JSON).with(token(oAuthHelper.getDefaultToken()))).andExpect(status().isCreated());
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) BaseMvcTest(com.epam.ta.reportportal.ws.BaseMvcTest) Test(org.junit.jupiter.api.Test)

Aggregations

StartTestItemRQ (com.epam.ta.reportportal.ws.model.StartTestItemRQ)159 Test (org.junit.jupiter.api.Test)124 FinishTestItemRQ (com.epam.ta.reportportal.ws.model.FinishTestItemRQ)30 List (java.util.List)21 TestNG (org.testng.TestNG)21 Launch (com.epam.reportportal.service.Launch)20 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)19 BeforeEach (org.junit.jupiter.api.BeforeEach)19 TestNgListener (com.epam.reportportal.testng.util.TestNgListener)18 Collectors (java.util.stream.Collectors)17 ArgumentCaptor (org.mockito.ArgumentCaptor)17 ReportPortal (com.epam.reportportal.service.ReportPortal)16 ReportPortalClient (com.epam.reportportal.service.ReportPortalClient)15 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)15 ArgumentMatchers.same (org.mockito.ArgumentMatchers.same)14 ReportPortalUser (com.epam.ta.reportportal.commons.ReportPortalUser)13 ItemAttributesRQ (com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ)13 BaseMvcTest (com.epam.ta.reportportal.ws.BaseMvcTest)12 Set (java.util.Set)12 Nonnull (javax.annotation.Nonnull)12