def test8_fankui_remarkcontentmore200(self): """登录后,请求参数中问题备注内容有大于200字的内容""" # 获取文件中的车务工单号 danhao = cheWu()[0].strip('\n') # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/issue-feedback" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } remark = "测试数据测试数据测试数据测试数据测测试试测试数据据测据测测试数据试数" \ "测试数据测试数据测试数据测试数据测测试试测试数据据测据测测试数据试数" \ "测试数据测试数据测试数据测试数据测测试试测试数据据测据测测试数据试数测" \ "试数据测试数据测试数据测试数据测测试试测试数据据测据测测试数据试数测试" \ "数据测试数据测试数据测试数据测测试试测试数据据测据测测试数据试数测试数据" \ "测试数据测试数据测试数据测测试试测试数据据测据测测试数据试数测试数据测" \ "试数据测试数据测试数据测测试试测试数据据测据测测试数据试数测试数据测" \ "试数据测试数据测试数据测测试试测试数据据测据测测试数据试数" request_data = { "serviceId": danhao, "serviceStatus": 101, "remark": remark } response_data = requests.patch(login_url, json.dumps(request_data), headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "SUCCESS")
def test4_qianyue(self): """收齐首付款时,选择线下签约""" # 获取文件中的车务工单号 danhao = cheWu()[0].strip('\n') # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/contract/paperSign" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } request_data = { "serviceId": danhao, "images": [{ "latitude": 39.943238, "longitude": 116.333319, "cdn": "https://optimize-qa.kanche.com/ydg/vehicle/operation/9761847da2511a720d725e8fdb12bac7.jpg", "source": "https://images-qa.kanche.com/ydg/vehicle/operation/9761847da2511a720d725e8fdb12bac7.jpg" }] } response_data = requests.post(login_url, json.dumps(request_data), headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "SUCCESS")
def test1_fankui_notoken(self): """问题反馈接口,未登录直接请求""" # 获取文件中的车务工单号 danhao = cheWu()[0].strip('\n') # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/issue-feedback" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', # 未添加token } response_data = requests.patch(login_url, headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "用户未登录")
def test3_zhunru(self): """执行准入操作""" # 获取文件中的车务工单号 danhao = cheWu()[0] # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/approval-success" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } response_data = requests.patch(login_url, headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "SUCCESS")
def test1_zhunru_notoken(self): """准入接口,未登录直接请求""" # 获取文件中的车务工单号 danhao = cheWu()[0] # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/approval-success" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', # 未添加token } response_data = requests.patch(login_url, headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "用户未登录")
def test1_qianyue_status(self): """线下签约接口,登录后判断工单是否为待签约状态""" # 获取文件中的车务工单号 danhao = cheWu()[0] # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/query?pageIndex=1&" \ "pageSize=10&serviceStatus=102&serviceId=" + danhao # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } response_data = requests.get(login_url, headers=headers).json() # print(response_data) self.assertEqual(response_data["data"]["rowCount"], 1)
def test2_fankui_wrongjson(self): """登录后,不输入请求参数""" # 获取文件中的车务工单号 danhao = cheWu()[0].strip('\n') # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/issue-feedback" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } response_data = requests.patch(login_url, headers=headers).json() # print(response_data) self.assertIn( "请求JSON格式不正确", response_data["message"], )
def test5_fankui_noremark(self): """登录后,缺少问题备注参数,直接请求接口""" # 获取文件中的车务工单号 danhao = cheWu()[0].strip('\n') # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/issue-feedback" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } request_data = { "serviceId": danhao, "serviceStatus": 101, # "remark": "" } response_data = requests.patch(login_url, json.dumps(request_data), headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "问题反馈备注不能为空")
def test9_wrongstatus(self): """请求参数中填写的工单状态与实际状态不一致,请求接口""" # 获取文件中的车务工单号 danhao = cheWu()[0].strip('\n') # 登录地址 login_url = "http://uat-c2b.taoche.com/basegate/work/order/" + danhao + "/issue-feedback" # 请求头 headers = { 'Content-Type': 'application/json;charset=UTF-8', 'Authorization': GetToken().token() } request_data = { "serviceId": danhao, "serviceStatus": 102, "remark": "" } response_data = requests.patch(login_url, json.dumps(request_data), headers=headers).json() # print(response_data) self.assertEqual(response_data["message"], "接收消息订单状态与订单状态不匹配")