from hytest import * from lib.webapi import apimgr class c1: name = '我的' def teststeps(self): INFO('测试步骤') # STEP 1: 调用小程序登录接口,获取 cookies STEP(1, '调用小程序登录接口获取 cookies') try: apimgr.mgr_get_cookie(phone='15037870765', token='8817684142977367381') INFO('Cookies 获取成功') except Exception as e: INFO(f'获取 Cookies 失败: {e}') raise # STEP 2: 调用获取订单详情接口 STEP(2, '调用获取订单详情接口') try: res = apimgr.debrisproduct_orderDetail(order_id='12345') r = res.json() INFO(r) except Exception as e: INFO(f'调用订单详情接口失败: {e}') raise # STEP 3: 设置检查点 STEP(3, '设置检查点') actual_error_code = r.get('error_code') CHECK_POINT('检查获取订单详情接口是否正常', actual_error_code == 0)