use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class MethodNestedStepsTest method test_verify_steps_support_templating_with_self_reference.
@Test
void test_verify_steps_support_templating_with_self_reference() {
mockNestedSteps(client, nestedStepLinks.get(0));
runTests(MethodStepTemplate.class);
ArgumentCaptor<StartTestItemRQ> startNestedStepCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client).startTestItem(same(stepUuid), startNestedStepCapture.capture());
StartTestItemRQ startStep = startNestedStepCapture.getValue();
assertThat(startStep.getName(), equalTo(MethodStepTemplate.STEP_TEMPLATE_VALUE.replace("{this.FIELD}", MethodStepTemplate.FIELD).replace("{0}", MethodStepTemplate.PARAMETER)));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class MethodNestedStepsTest method test_method_single_step.
@Test
public void test_method_single_step() {
mockNestedSteps(client, nestedStepLinks.get(0));
TestNG result = runTests(Collections.singletonList(TestNgListener.class), MethodSingleStep.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(MethodSingleStep.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 MethodNestedStepsTest method test_method_named_single_step.
@Test
public void test_method_named_single_step() {
mockNestedSteps(client, nestedStepLinks.get(0));
TestNG result = runTests(Collections.singletonList(TestNgListener.class), MethodNamedSingleStep.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(MethodNamedSingleStep.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 MutedAnnotationTest method test_muted_annotation_method_level_processing.
@Test
public void test_muted_annotation_method_level_processing() {
TestNG result = runTests("muted_method_tests.xml");
assertThat(result.getStatus(), equalTo(0));
// Start launch
verify(client).startLaunch(any());
// Start parent suites
verify(client).startTestItem(any());
// Start test class
verify(client).startTestItem(same(suitedUuid), any());
ArgumentCaptor<StartTestItemRQ> startMethodCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test step
verify(client, times(2)).startTestItem(same(testClassUuid), startMethodCapture.capture());
List<StartTestItemRQ> startMethods = startMethodCapture.getAllValues().stream().filter(rq -> rq.getName().contains("muted")).collect(Collectors.toList());
assertThat(startMethods, hasSize(1));
assertThat(startMethods.get(0).isHasStats(), equalTo(Boolean.FALSE));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureAwareListener method buildSpecItemRq.
@Override
@Nonnull
protected StartTestItemRQ buildSpecItemRq(@Nonnull SpecInfo spec) {
StartTestItemRQ rq = super.buildSpecItemRq(spec);
AnnotatedElement c = spec.getReflection();
processLabels(rq, c);
processLinks(rq, c);
return rq;
}
Aggregations