use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureAwareListener method buildFixtureItemRq.
@Override
@Nonnull
protected StartTestItemRQ buildFixtureItemRq(@Nonnull FeatureInfo feature, @Nonnull MethodInfo fixture, boolean inherited) {
StartTestItemRQ rq = super.buildFixtureItemRq(feature, fixture, inherited);
Method method = fixture.getReflection();
processLabels(rq, method);
processDescription(rq, Thread.currentThread().getContextClassLoader(), method);
processLinks(rq, method);
return rq;
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureAwareService method buildStartStepRq.
@Override
@Nonnull
protected StartTestItemRQ buildStartStepRq(@Nonnull final ITestResult testResult, @Nonnull final TestMethodType type) {
StartTestItemRQ rq = super.buildStartStepRq(testResult, type);
getMethod(testResult.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);
});
ofNullable(rq.getDescription()).ifPresent(d -> DESCRIPTION_TRACKER.put(testResult, d));
return rq;
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureIdAnnotationTest method test_allure_id_test_case_id_override.
@Test
public void test_allure_id_test_case_id_override() {
runTests(Collections.singletonList(TestNgListener.class), TestAllureIdTestCaseIdOverride.class);
// 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).startTestItem(same(testClassUuid), startMethodCapture.capture());
StartTestItemRQ startMethod = startMethodCapture.getValue();
Set<ItemAttributesRQ> attributes = startMethod.getAttributes();
List<ItemAttributesRQ> idAttributes = attributes.stream().filter(a -> "AS_ID".equals(a.getKey())).collect(Collectors.toList());
assertThat(idAttributes, hasSize(1));
ItemAttributesRQ id = idAttributes.get(0);
assertThat(id.getValue(), equalTo("My ID"));
assertThat(startMethod.getTestCaseId(), equalTo("My Test Case ID"));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureIdAnnotationTest method test_allure_id_no_params.
@Test
public void test_allure_id_no_params() {
runTests(Collections.singletonList(TestNgListener.class), TestAllureIdNoParams.class);
// 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).startTestItem(same(testClassUuid), startMethodCapture.capture());
StartTestItemRQ startMethod = startMethodCapture.getValue();
Set<ItemAttributesRQ> attributes = startMethod.getAttributes();
List<ItemAttributesRQ> idAttributes = attributes.stream().filter(a -> "AS_ID".equals(a.getKey())).collect(Collectors.toList());
assertThat(idAttributes, hasSize(1));
ItemAttributesRQ id = idAttributes.get(0);
assertThat(id.getValue(), equalTo("My no params ID"));
assertThat(startMethod.getTestCaseId(), equalTo("My no params ID"));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project allure-java by reportportal.
the class AllureIdAnnotationTest method test_allure_id_with_params.
@Test
public void test_allure_id_with_params() {
runTests(Collections.singletonList(TestNgListener.class), TestAllureIdParams.class);
// 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).startTestItem(same(testClassUuid), startMethodCapture.capture());
StartTestItemRQ startMethod = startMethodCapture.getValue();
Set<ItemAttributesRQ> attributes = startMethod.getAttributes();
List<ItemAttributesRQ> idAttributes = attributes.stream().filter(a -> "AS_ID".equals(a.getKey())).collect(Collectors.toList());
assertThat(idAttributes, hasSize(1));
ItemAttributesRQ id = idAttributes.get(0);
assertThat(id.getValue(), equalTo("My ID"));
assertThat(startMethod.getTestCaseId(), equalTo("My ID[Data step name]"));
}
Aggregations