microsoft / microsoft/azure-devops-python-api

How to post Test Results to a test run.

未關閉
#415 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
Python
星號
684
分支
218
平均合併
8 天 10 小時
30 天內合併 PR
1

描述

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)**

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 add_test_results_to_test_run 和 issue 中顯示的 test_results payload 開始,比較 testCaseId、testPointId、planId 及其他欄位的處理方式。重現針對三個測試案例的呼叫,並驗證每個結果都保留其各自不同的測試案例標題,並連結到預期的 Test Case 和 Test Project。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
azure, python
領域
api, testing
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。