microsoft / microsoft/azure-devops-python-api

How to post Test Results to a test run.

Đang mở
#415 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Python
Star
684
Fork
218
Merge trung bình
8 ngày 10 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với add_test_results_to_test_run và payload test_results được hiển thị trong issue, so sánh cách testCaseId, testPointId, planId và các trường khác được xử lý. Tái hiện lệnh gọi cho ba test case và xác minh rằng mỗi kết quả vẫn giữ tiêu đề test case riêng biệt của nó và liên kết đến Test Case và Test Project được mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
azure, python
Lĩnh vực
api, testing
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.