use of com.epam.reportportal.service.ReportPortal in project agent-java-testNG by reportportal.
the class StepReporterTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, "launchUuid", suitedUuid, testClassUuid, testMethodUuid);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
TestNgListener.initReportPortal(reportPortal);
}
use of com.epam.reportportal.service.ReportPortal in project agent-java-testNG by reportportal.
the class TestWithRetryWithStepsAndDependentMethodTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, namedUuid("launchUuid"), suitedUuid, testClassUuid, testUuidList);
TestUtils.mockNestedSteps(client, testStepUuidOrder);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
TestListener.initReportPortal(reportPortal);
}
use of com.epam.reportportal.service.ReportPortal in project agent-java-junit5 by reportportal.
the class ReportPortalExtension method getLaunch.
/**
* Returns a current launch instance, starts new if no such instance
*
* @param context JUnit's launch context
* @return represents current launch
*/
protected Launch getLaunch(ExtensionContext context) {
return launchMap.computeIfAbsent(getLaunchId(context), id -> {
ReportPortal rp = getReporter();
ListenerParameters params = rp.getParameters();
StartLaunchRQ rq = buildStartLaunchRq(params);
Launch launch = rp.newLaunch(rq);
Runtime.getRuntime().addShutdownHook(getShutdownHook(id));
Maybe<String> launchIdResponse = launch.start();
if (params.isCallbackReportingEnabled()) {
TEST_ITEM_TREE.setLaunchId(launchIdResponse);
}
return launch;
});
}
use of com.epam.reportportal.service.ReportPortal in project agent-java-junit5 by reportportal.
the class ReportPortalExtension method buildStartStepRq.
/**
* Extension point to customize test step creation event/request
*
* @param context JUnit's test context
* @param arguments a test arguments list
* @param itemType a test method item type
* @param description a test method description
* @param startTime a start time of the test
* @return Request to ReportPortal
*/
@Nonnull
protected StartTestItemRQ buildStartStepRq(@Nonnull final ExtensionContext context, @Nonnull final List<Object> arguments, @Nonnull final ItemType itemType, @Nonnull final String description, @Nonnull final Date startTime) {
StartTestItemRQ rq = new StartTestItemRQ();
rq.setStartTime(startTime);
rq.setName(createStepName(context));
rq.setDescription(description);
rq.setUniqueId(context.getUniqueId());
rq.setType(itemType == TEMPLATE ? SUITE.name() : itemType.name());
String codeRef = getCodeRef(context);
rq.setCodeRef(codeRef);
rq.setAttributes(context.getTags().stream().map(it -> new ItemAttributesRQ(null, it)).collect(Collectors.toSet()));
if (SUITE == itemType) {
context.getTestClass().ifPresent(c -> rq.getAttributes().addAll(getAttributes(c)));
}
Optional<Method> testMethod = getTestMethod(context);
TestCaseIdEntry caseId = testMethod.map(m -> {
rq.getAttributes().addAll(getAttributes(m));
rq.setParameters(getParameters(m, arguments));
return getTestCaseId(m, codeRef, arguments, context.getTestInstance().orElse(null));
}).orElseGet(() -> TestCaseIdUtils.getTestCaseId(codeRef, arguments));
rq.setTestCaseId(ofNullable(caseId).map(TestCaseIdEntry::getId).orElse(null));
return rq;
}
use of com.epam.reportportal.service.ReportPortal in project allure-java by reportportal.
the class DescriptionAnnotationTest method initMocks.
@BeforeEach
public void initMocks() {
mockLaunch(client, namedUuid("launchUuid"), suitedUuid, testClassUuid, stepUuids);
ReportPortal reportPortal = ReportPortal.create(client, standardParameters());
TestNgListener.REPORT_PORTAL_THREAD_LOCAL.set(reportPortal);
}
Aggregations