Search in sources :

Example 96 with StartTestItemRQ

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

the class TestItemBuilderTest method providedTestCaseIdTest.

@Test
void providedTestCaseIdTest() {
    StartTestItemRQ request = new StartTestItemRQ();
    request.setName("item");
    request.setType("step");
    String testCaseId = "my-test-case-id";
    request.setTestCaseId(testCaseId);
    TestItem testItem = new TestItemBuilder().addStartItemRequest(request).get();
    assertEquals(testCaseId, testItem.getTestCaseId());
    assertEquals(testCaseId.hashCode(), testItem.getTestCaseHash());
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) TestItem(com.epam.ta.reportportal.entity.item.TestItem) Test(org.junit.jupiter.api.Test)

Example 97 with StartTestItemRQ

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

the class XunitImportHandler method buildStartTestRq.

private StartTestItemRQ buildStartTestRq(String name) {
    StartTestItemRQ rq = new StartTestItemRQ();
    rq.setLaunchUuid(launchUuid);
    rq.setStartTime(EntityUtils.TO_DATE.apply(startItemTime));
    rq.setType(TestItemTypeEnum.TEST.name());
    rq.setName(Strings.isNullOrEmpty(name) ? "no_name" : name);
    return rq;
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ)

Example 98 with StartTestItemRQ

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

the class XunitImportHandler method startStepItem.

private void startStepItem(String name, String duration) {
    StartTestItemRQ rq = new StartTestItemRQ();
    rq.setLaunchUuid(launchUuid);
    rq.setStartTime(EntityUtils.TO_DATE.apply(startItemTime));
    rq.setType(TestItemTypeEnum.STEP.name());
    rq.setName(name);
    String id = startTestItemHandler.startChildItem(user, projectDetails, rq, itemUuids.peek()).getId();
    currentDuration = toMillis(duration);
    currentItemUuid = id;
    itemUuids.push(id);
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ)

Example 99 with StartTestItemRQ

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

the class DemoDataTestItemService method startRootItem.

@Transactional
public String startRootItem(DemoItemMetadata metadata, RootMetaData rootMetaData) {
    StartTestItemRQ rq = new StartTestItemRQ();
    rq.setName(metadata.getName());
    rq.setCodeRef(PACKAGE + metadata.getName());
    rq.setLaunchUuid(rootMetaData.getLaunchUuid());
    rq.setStartTime(new Date());
    rq.setType(metadata.getType().name());
    if (metadata.getType().sameLevel(SUITE)) {
        rq.setAttributes(ContentUtils.getAttributesInRange(ATTRIBUTES_COUNT));
        rq.setDescription(ContentUtils.getSuiteDescription());
    }
    return startTestItemHandler.startRootItem(rootMetaData.getUser(), rootMetaData.getProjectDetails(), rq).getId();
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) Date(java.util.Date) Transactional(org.springframework.transaction.annotation.Transactional)

Example 100 with StartTestItemRQ

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

the class BuildStepTest method testStartConfigurationNullType.

@Test
public void testStartConfigurationNullType() {
    when(testResult.getMethod()).thenReturn(testNGMethod);
    StartTestItemRQ rq = testNGService.buildStartConfigurationRq(testResult, null);
    assertThat("Incorrect method type", rq.getType(), nullValue());
}
Also used : StartTestItemRQ(com.epam.ta.reportportal.ws.model.StartTestItemRQ) 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