{"name": "百度检测低质封面", "status": "failed", "statusDetails": {"message": "Failed: 请求失败，状态码: 403", "trace": "self = <api_auto_framework.testcases.test_Baidu_Common_baiduRequest.TestBaiduCommonBaiduRequest object at 0x000001ECEFE50F50>\n\n    @allure.feature(\"百度\")\n    @allure.story(\"广告搭建\")\n    @allure.title(\"百度检测低质封面\")\n    @pytest.mark.generated\n    def test_baidu_common_baidu_request(self):\n        \"\"\"Automatically generated test case: 百度检测低质封面\"\"\"\n        # 加载测试数据\n        test_data = load_test_data(self.TEST_DATA)[0]\n        # 准备请求参数\n        request_kwargs = {\n            \"method\": test_data['method'],\n            \"url\": test_data['url'],\n            \"headers\": test_data.get('headers'),\n            \"cookies\": cookie()  # 新增cookies参数\n        }\n        # 智能选择请求体处理方式\n        body = test_data.get('body')\n        if body is not None:\n            if isinstance(body, (dict, list)):\n                request_kwargs[\"json\"] = body\n            else:\n                request_kwargs[\"data\"] = body\n        with allure.step(\"准备请求数据\"):\n            print(f\"请求参数: {request_kwargs['json']}\")\n            allure.attach(f\"URL: https://cli1.mobgi.com/Baidu/Common/baiduRequest\", \"请求URL\")\n            allure.attach(json.dumps(body), \"请求体\", allure.attachment_type.JSON)\n        # 发送请求并获取响应\n        with allure.step(f\"发送请求:test_baidu_common_baidu_request\"):\n            response = RequestWrapper.send_request(**request_kwargs)\n            if response.status_code != 200:\n                error_msg = f\"请求失败，状态码: {response.status_code}\"\n                allure.attach(error_msg, \"请求错误\", allure.attachment_type.TEXT)\n>               pytest.fail(error_msg)\nE               Failed: 请求失败，状态码: 403\n\ntestcases\\test_Baidu_Common_baiduRequest.py:48: Failed"}, "description": "Automatically generated test case: 百度检测低质封面", "steps": [{"name": "准备请求数据", "status": "passed", "attachments": [{"name": "请求URL", "source": "98e23859-5a1a-45fa-a0b0-5a0c53dfbb12-attachment.attach"}, {"name": "请求体", "source": "d9f5bc3c-1b40-4d1a-80ef-c8512b69960d-attachment.json", "type": "application/json"}], "start": 1757680873251, "stop": 1757680873252}, {"name": "发送请求:test_baidu_common_baidu_request", "status": "failed", "statusDetails": {"message": "Failed: 请求失败，状态码: 403\n", "trace": "  File \"D:\\memorandum\\chuangliangProject\\api_auto_framework\\testcases\\test_Baidu_Common_baiduRequest.py\", line 48, in test_baidu_common_baidu_request\n    pytest.fail(error_msg)\n    ~~~~~~~~~~~^^^^^^^^^^^\n  File \"D:\\memorandum\\chuangliangProject\\venv\\Lib\\site-packages\\_pytest\\outcomes.py\", line 177, in fail\n    raise Failed(msg=reason, pytrace=pytrace)\n"}, "attachments": [{"name": "请求错误", "source": "0067adad-fcf4-4f52-9bc3-ad1f9137e430-attachment.txt", "type": "text/plain"}], "start": 1757680873252, "stop": 1757680873453}], "attachments": [{"name": "stdout", "source": "6f31d277-9246-44da-9b09-809238ade95a-attachment.txt", "type": "text/plain"}], "start": 1757680872785, "stop": 1757680873456, "uuid": "a7d89745-e90e-41b0-b947-166c41adb2d0", "historyId": "9305aa8fe177b3ec8014321394155033", "testCaseId": "9305aa8fe177b3ec8014321394155033", "fullName": "test_Baidu_Common_baiduRequest.TestBaiduCommonBaiduRequest#test_baidu_common_baidu_request", "labels": [{"name": "feature", "value": "百度"}, {"name": "story", "value": "广告搭建"}, {"name": "tag", "value": "generated"}, {"name": "suite", "value": "test_Baidu_Common_baiduRequest"}, {"name": "subSuite", "value": "TestBaiduCommonBaiduRequest"}, {"name": "host", "value": "September"}, {"name": "thread", "value": "20148-MainThread"}, {"name": "framework", "value": "pytest"}, {"name": "language", "value": "cpython3"}, {"name": "package", "value": "test_Baidu_Common_baiduRequest"}], "titlePath": ["test_Baidu_Common_baiduRequest.py", "TestBaiduCommonBaiduRequest"]}