def setUpClass(cls) -> None: '''获取新增厂商ID''' cls.header = OperationHeader().get_header() url_firm = globalvar.Base_Url + "/firm/add" data_firm = { "name": "测试厂商700", "code": 700, "icon": " 测试厂商11", "address": "金绣国际测试地址" } cls.firmid = requests.post(url=url_firm, data=json.dumps(data_firm), headers=cls.header).json()['result'] '''获取新增产品ID''' cls.header = OperationHeader().get_header() url_product = globalvar.Base_Url + "/product/add" data_product = { "firmId": cls.firmid, "name": "test product", "code": 800, "ability": 512 } cls.productid = requests.post(url=url_product, data=json.dumps(data_product), headers=cls.header).json()['result'] '''读测试用例sheet''' cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='product_edit') cls.run_method = RunMethod() cls.com_util = CommonUtil()
def setUpClass(cls) -> None: '''读测试用例sheet''' cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='firm_add') cls.run_method = RunMethod() cls.com_util = CommonUtil() '''获取token''' cls.header = OperationHeader().get_header()
def setUpClass(cls) -> None: '''获取新增厂商ID''' cls.header = OperationHeader().get_header() url = globalvar.Base_Url + "/firm/add" data = {"name": "测试厂商700", "code":700, "icon":" 测试厂商11", "address":"金绣国际测试地址"} cls.firmid = requests.post(url=url, data=json.dumps(data), headers=cls.header).json()['result'] '''读测试用例sheet''' cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='firm_del') cls.run_method = RunMethod() cls.com_util = CommonUtil()
def setUpClass(cls) -> None: '''获取新增家庭ID''' cls.header = OperationHeader().get_header() url = globalvar.Base_Url + "/scene/add" data = {"name": "002 testhome"} cls.sceneid = requests.post(url=url, data=json.dumps(data), headers=cls.header).json()['result'] '''读测试用例sheet''' cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='room_add') cls.run_method = RunMethod() cls.com_util = CommonUtil()
def setUpClass(cls) -> None: "登录" url = globalvar.Base_Url + "/account/login" data = { "username": "******", "password": "******", "appId": "1469503131678220288" } header = {"Content-Type": "application/json"} requests.post(url=url, data=json.dumps(data), headers=header) cls.run_method = RunMethod() cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='scene_add') cls.com_util = CommonUtil() cls.send_email = SendEmail()
def setUpClass(cls) -> None: # "登录" # url = globalvar.Base_Url + "/account/login" # data = {"username": "******", "password": "******", "appId": "1469503131678220288"} # header = {"Content-Type": "application/json"} # requests.post(url=url, data=json.dumps(data), headers=header) cls.run_method = RunMethod() cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='scene_edit') cls.com_util = CommonUtil() cls.header = OperationHeader().get_header() '获取新增场景ID' url = globalvar.Base_Url + "/scene/add" data = {"name": "002 test home"} cls.sceneid = requests.post(url=url, data=json.dumps(data), headers=cls.header).json()['result']
def setUp(self) -> None: self.run_method = RunMethod() self.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='login') self.com_util = CommonUtil()
def setUpClass(cls) -> None: cls.run_method = RunMethod() cls.data = GetData(fileName='/Users/stina/Desktop/apitest.xls', sheetName='scene_del') cls.com_util = CommonUtil()
def __init__(self): self.run_method = RunMethod() self.data = GetData() self.com_util = CommonUtil() self.send_mai = SendEmail()