use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureAwareListener method buildStartStepRq.
@Override
@Nonnull
protected StartTestItemRQ buildStartStepRq(@Nonnull final Object runner, @Nullable final Description description, @Nonnull final FrameworkMethod method, @Nonnull final ReflectiveCallable callable, @Nullable final Date startTime) {
StartTestItemRQ rq = super.buildStartStepRq(runner, description, method, callable, startTime);
ItemType itemType = ItemType.valueOf(rq.getType());
if (itemType == ItemType.STEP) {
ofNullable(method.getMethod()).ifPresent(m -> {
processLabels(rq, m);
processAllureId(rq, m);
processDescription(rq, Thread.currentThread().getContextClassLoader(), m);
processLinks(rq, m);
processPriority(rq, m);
processFlaky(rq, m);
processMuted(rq, m);
});
} else {
ofNullable(method.getMethod()).ifPresent(m -> {
processLabels(rq, m);
processDescription(rq, Thread.currentThread().getContextClassLoader(), m);
processLinks(rq, m);
});
}
ofNullable(rq.getDescription()).ifPresent(d -> DESCRIPTION_TRACKER.put(method, d));
return rq;
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureAwareExtension method buildStartStepRq.
@Override
@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 = super.buildStartStepRq(context, arguments, itemType, description, startTime);
if (itemType == ItemType.SUITE) {
context.getTestClass().ifPresent(c -> {
processLabels(rq, c);
processLinks(rq, c);
});
} else {
context.getTestMethod().ifPresent(m -> {
processLabels(rq, m);
processAllureId(rq, m);
processDescription(rq, Thread.currentThread().getContextClassLoader(), m);
processLinks(rq, m);
processPriority(rq, m);
processFlaky(rq, m);
processMuted(rq, m);
});
DESCRIPTION_TRACKER.put(context, rq.getDescription());
}
return rq;
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureAwareExtension method buildStartConfigurationRq.
@Override
@Nonnull
protected StartTestItemRQ buildStartConfigurationRq(@Nonnull Method method, @Nonnull ExtensionContext parentContext, @Nonnull ExtensionContext context, @Nonnull ItemType itemType) {
StartTestItemRQ rq = super.buildStartConfigurationRq(method, parentContext, context, itemType);
processLabels(rq, method);
processDescription(rq, Thread.currentThread().getContextClassLoader(), method);
processLinks(rq, method);
ofNullable(rq.getDescription()).ifPresent(d -> DESCRIPTION_TRACKER.put(context, d));
return rq;
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class StaticNestedStepsTest method test_static_anonymous_step.
@Test
public void test_static_anonymous_step() {
mockNestedSteps(client, nestedStepLinks.get(0));
TestNG result = runTests(StaticAnonymousStep.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(StaticAnonymousStep.class.getSimpleName() + " anonymous step 1"));
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 StaticNestedStepsTest method test_two_static_anonymous_step.
@Test
public void test_two_static_anonymous_step() {
mockNestedSteps(client, nestedStepLinks);
TestNG result = runTests(TwoStaticAnonymousSteps.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(TwoStaticAnonymousSteps.class.getSimpleName() + " anonymous 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())));
}
Aggregations