use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project agent-java-testNG by reportportal.
the class TestCaseIdTest method testCaseIdFromCodeRef.
@Test
public void testCaseIdFromCodeRef() {
TestUtils.runTests(Collections.singletonList(TestReportPortalListener.class), TestCaseIdFromCodeReference.class);
String expectedCodeRef = TestCaseIdFromCodeReference.class.getCanonicalName() + "." + TestCaseIdFromCodeReference.STEP_NAME;
// Start parent suite
verify(launch, times(1)).startTestItem(any());
ArgumentCaptor<StartTestItemRQ> captor = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test and step
verify(launch, times(2)).startTestItem(any(), captor.capture());
StartTestItemRQ testRequest = extractRequest(captor, "test");
StartTestItemRQ stepRequest = extractRequest(captor, "step");
assertThat(testRequest.getName(), equalTo(TestUtils.TEST_NAME));
assertThat(stepRequest.getCodeRef(), equalTo(expectedCodeRef));
assertThat(stepRequest.getTestCaseId(), equalTo(expectedCodeRef));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project agent-java-testNG by reportportal.
the class TestCaseIdTest method testCaseIdFromAnnotationValue.
@Test
public void testCaseIdFromAnnotationValue() {
TestUtils.runTests(Collections.singletonList(TestReportPortalListener.class), TestCaseIdFromAnnotationValue.class);
// Start parent suites
verify(launch, times(1)).startTestItem(any());
ArgumentCaptor<StartTestItemRQ> captor = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test and step
verify(launch, times(2)).startTestItem(any(), captor.capture());
StartTestItemRQ testRequest = extractRequest(captor, "test");
StartTestItemRQ stepRequest = extractRequest(captor, "step");
assertThat(testRequest.getName(), equalTo(TestUtils.TEST_NAME));
assertThat(stepRequest.getTestCaseId(), equalTo(TestCaseIdFromAnnotationValue.TEST_CASE_ID));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project agent-java-testNG by reportportal.
the class TestCaseIdTest method verify_test_case_id_parameterized_no_marked_parameters.
@Test
public void verify_test_case_id_parameterized_no_marked_parameters() {
TestUtils.runTests(Collections.singletonList(TestReportPortalListener.class), TestCaseIdFromAnnotationValueParametrizedNoParam.class);
// Start parent suites
verify(launch, times(1)).startTestItem(any());
ArgumentCaptor<StartTestItemRQ> captor = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test and step
verify(launch, times(4)).startTestItem(any(), captor.capture());
StartTestItemRQ testRequest = extractRequest(captor, "test");
List<StartTestItemRQ> stepRequests = extractRequests(captor, "step");
List<String> actualTestCaseIds = stepRequests.stream().map(StartTestItemRQ::getTestCaseId).collect(Collectors.toList());
assertThat(testRequest.getName(), equalTo(TestUtils.TEST_NAME));
assertThat(actualTestCaseIds, containsInAnyOrder("[one,1]", "[two,2]", "[three,3]"));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project agent-java-testNG by reportportal.
the class TestNameAndDescriptionTest method test_name_should_be_passed_to_rp_if_specified.
@Test
public void test_name_should_be_passed_to_rp_if_specified() {
runTests(Collections.singletonList(TestNgListener.class), AnnotationNamedClassTest.class);
// Start launch
verify(client, times(1)).startLaunch(any());
// Start parent suites
verify(client, times(1)).startTestItem(any());
ArgumentCaptor<StartTestItemRQ> startTestCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
// Start test class
verify(client, times(1)).startTestItem(same(suitedUuid), startTestCapture.capture());
// Start test step
verify(client, times(1)).startTestItem(same(testClassUuid), any());
StartTestItemRQ startItem = startTestCapture.getAllValues().get(0);
assertThat(startItem.isRetry(), nullValue());
assertThat(startItem.getName(), equalTo(AnnotationNamedClassTest.TEST_NAME));
}
use of com.epam.ta.reportportal.ws.model.StartTestItemRQ in project agent-java-testNG by reportportal.
the class TestNameAndDescriptionTest method test_description_should_be_passed_to_rp_if_specified.
@Test
public void test_description_should_be_passed_to_rp_if_specified() {
runTests(Collections.singletonList(TestNgListener.class), DescriptionTest.class);
// Start launch
verify(client, times(1)).startLaunch(any());
// Start parent suites
verify(client, times(1)).startTestItem(any());
// Start test class
verify(client, times(1)).startTestItem(same(suitedUuid), any());
ArgumentCaptor<StartTestItemRQ> startTestCapture = ArgumentCaptor.forClass(StartTestItemRQ.class);
verify(client, times(1)).startTestItem(same(testClassUuid), startTestCapture.capture());
StartTestItemRQ startItem = startTestCapture.getAllValues().get(0);
assertThat(startItem.getDescription(), equalTo(DescriptionTest.TEST_DESCRIPTION));
}
Aggregations