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;
}
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;
}
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;
}
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());
}
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());
}
Aggregations