microsoft / microsoft/azure-devops-python-api
How to post Test Results to a test run.
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 684
- Forks
- 218
- Merge médio
- 8d 10h
- PRs com merge (30d)
- 1
Descrição
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)**
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece com add_test_results_to_test_run e o payload test_results mostrado na issue, comparando como testCaseId, testPointId, planId e os outros campos são tratados. Reproduza a chamada para os três casos de teste e verifique se cada resultado mantém seu título distinto de caso de teste e está vinculado ao Test Case e ao Test Project esperados.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- azure, python
- Domínio
- api, testing
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100