use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class StaticNestedStepsTest method test_two_static_class_step.
@Test
public void test_two_static_class_step() {
mockNestedSteps(client, nestedStepLinks);
TestNG result = runTests(TwoStaticClassSteps.class);
assertThat(result.getStatus(), equalTo(0));
ArgumentCaptor<StartTestItemRQ> startNestedStepCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client, times(2)).startTestItem(same(stepUuid), startNestedStepCapture.capture());
startNestedStepCapture.getAllValues().forEach(i -> {
assertThat(i.getName(), matchesPattern(ClassStep.class.getSimpleName() + " step \\d"));
assertThat(i.isHasStats(), equalTo(Boolean.FALSE));
});
ArgumentCaptor<FinishTestItemRQ> finishNestedStepCapture = ArgumentCaptor.forClass(FinishTestItemRQ.class);
verify(client).finishTestItem(same(nestedSteps.get(0)), finishNestedStepCapture.capture());
verify(client).finishTestItem(same(nestedSteps.get(1)), finishNestedStepCapture.capture());
finishNestedStepCapture.getAllValues().forEach(i -> assertThat(i.getStatus(), equalTo(ItemStatus.PASSED.name())));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class StaticNestedStepsTest method test_static_single_step_with_status.
@Test
public void test_static_single_step_with_status() {
mockNestedSteps(client, nestedStepLinks.get(0));
TestNG result = runTests(StaticSingleStepStatus.class);
assertThat(result.getStatus(), equalTo(0));
ArgumentCaptor<StartTestItemRQ> startNestedStepCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client).startTestItem(same(stepUuid), startNestedStepCapture.capture());
StartTestItemRQ startStep = startNestedStepCapture.getValue();
assertThat(startStep.getName(), equalTo(StaticSingleStepStatus.TEST_STEP_NAME));
assertThat(startStep.isHasStats(), equalTo(Boolean.FALSE));
ArgumentCaptor<FinishTestItemRQ> finishNestedStepCapture = ArgumentCaptor.forClass(FinishTestItemRQ.class);
verify(client).finishTestItem(same(nestedSteps.get(0)), finishNestedStepCapture.capture());
FinishTestItemRQ finishStep = finishNestedStepCapture.getValue();
assertThat(finishStep.getStatus(), equalTo(ItemStatus.INTERRUPTED.name()));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class StaticNestedStepsTest method test_named_static_anonymous_step.
@Test
public void test_named_static_anonymous_step() {
mockNestedSteps(client, nestedStepLinks.get(0));
TestNG result = runTests(NamedStaticAnonymousStep.class);
assertThat(result.getStatus(), equalTo(0));
ArgumentCaptor<StartTestItemRQ> startNestedStepCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client).startTestItem(same(stepUuid), startNestedStepCapture.capture());
verify(client, times(0)).startTestItem(same(nestedSteps.get(0)), any(StartTestItemRQ.class));
StartTestItemRQ startStep = startNestedStepCapture.getValue();
assertThat(startStep.getName(), equalTo(NamedStaticAnonymousStep.TEST_STEP_NAME));
assertThat(startStep.isHasStats(), equalTo(Boolean.FALSE));
ArgumentCaptor<FinishTestItemRQ> finishNestedStepCapture = ArgumentCaptor.forClass(FinishTestItemRQ.class);
verify(client).finishTestItem(same(nestedSteps.get(0)), finishNestedStepCapture.capture());
FinishTestItemRQ finishStep = finishNestedStepCapture.getValue();
assertThat(finishStep.getStatus(), equalTo(ItemStatus.PASSED.name()));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class StepAspect method startNestedStepAnnotation.
@Before(value = "!stepMethod() && (anyMethod() && withStepAnnotation(step))", argNames = "joinPoint,step")
public void startNestedStepAnnotation(JoinPoint joinPoint, Step step) {
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
String name = step.value().trim().isEmpty() ? signature.getName() : StepNameUtils.getStepName(step.value(), new TemplateConfiguration(), signature, joinPoint);
StartTestItemRQ startStepRequest = com.epam.reportportal.aspect.StepRequestUtils.buildStartStepRequest(name, ofNullable(signature.getMethod().getAnnotation(Description.class)).map(Description::value).filter(d -> !d.isEmpty()).orElse(null), signature);
// noinspection ReactiveStreamsUnusedPublisher
ofNullable(Launch.currentLaunch()).ifPresent(l -> l.getStepReporter().startNestedStep(startStepRequest));
ofNullable(startStepRequest.getDescription()).ifPresent(d -> ReportPortal.emitLog(STEP_DESCRIPTION + d, LogLevel.INFO.name(), Calendar.getInstance().getTime()));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project agent-java-soapui by reportportal.
the class StepBasedSoapUIServiceImpl method startItem.
protected Maybe<String> startItem(String name, TestItemType type, Maybe<String> parentId) {
if (null != launch) {
StartTestItemRQ rq = new StartTestItemRQ();
rq.setName(name);
rq.setStartTime(Calendar.getInstance().getTime());
rq.setType(type.getValue());
return this.launch.startTestItem(parentId, rq);
} else {
return Maybe.empty();
}
}
Aggregations