microsoft / microsoft/azure-devops-python-api
How to post Test Results to a test run.
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 684
- Fork
- 218
- Merge medio
- 8g 10h
- PR unite (30g)
- 1
Descrizione
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)**
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con add_test_results_to_test_run e il payload test_results mostrato nell’issue, confrontando il modo in cui vengono gestiti testCaseId, testPointId, planId e gli altri campi. Riproduci la chiamata per i tre casi di test e verifica che ogni risultato mantenga il titolo distinto del proprio caso di test e sia collegato al Test Case e al Test Project previsti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api, testing
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100