microsoft / microsoft/azure-devops-python-api

How to post Test Results to a test run.

Abierto
#415 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
684
Forks
218
Merge medio
8 d 10 h
PR fusionados (30 d)
1

Descripción

Does anyone have sample code for posting Test Results to a Test Run? I have built a sample class which is working fine for many operations: get_projects, get_test_plans, get_test_case_list, get_test_runs, get_test_results, create_test_run. But when I try to post results to an existing or newly created test_run I get no errors, but only partial results. What I get is some data fields like: outcome, comment, owner, runBy comes through properly. But most fields, like testCaseTitle is a single title replicated for every test case, inside the test results there are no links to the Test Case or Test Project. I'm not sure if my test_results dictionary is incorrect or there are additional steps to creating a Test Run that I am missing. I have been trying to add 3 test case results like the one below, to a test run.

    test_results = [
            {
                "outcome": "passed",
                "errorMessage": "",
                "comment": "DevOps API Experiment",
                "dateStarted": "/Date(1648507431249)/",
                "dateCompleted": "/Date(1648507525480)/",
                "duration": 915770000,
                "testCaseId": 185,  # 185, 1071
                "configurationId": 6,
                "configurationName": "Windows 10",
                "testPointId": 128,  # 185-128, 1071-867
                "revision": 0,
                "state": "Completed",
                # "owner": "dd174dbe-01ab-6ee7-9aa8-a3ca22944639",  # User 2
                "owner": {"id": "6682ffe6-a175-640e-96a8-a3c8fdb046c7"},  # User 1
                # "runBy": "dd174dbe-01ab-6ee7-9aa8-a3ca22944639",
                "runBy": {"id": "6682ffe6-a175-640e-96a8-a3c8fdb046c7"},  # User 1
                "testCaseTitle": "Login Screen UX Elements",
                "testCaseArea": "",
                "dataRowCount": 0,
                "testCaseRevision": 1,
                "priority": 1,
                "planId": self.plan_id,
                "automatedTestName": "test_sample_azure_testplan.py",
            },

    response = self.harness.test_client.**add_test_results_to_test_run(test_results, self.project, self.run_id)**

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con add_test_results_to_test_run y el payload test_results mostrado en el issue, comparando cómo se gestionan testCaseId, testPointId, planId y los demás campos. Reproduce la llamada para los tres casos de prueba y verifica que cada resultado conserve su título de caso de prueba distintivo y enlace con el Test Case y el Test Project esperados.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, python
Área
api, testing
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.