def test_get_historysport001(self): Returndata = Moudle("Wristband_Alpha").bind() self.headers = Returndata[1] r = Request().post_wirst_request(method=self.method, url=self.url, data=self.parm, header=self.headers) print(r) Assertions().assert_code(r['code'], self.expect['code']) Assertions().assert_code(r['status_code'], self.expect['status_code'])
def test_unbind_device002(self): Returndata = Moudle("Wristband_Alpha").bind() self.parm2['device_token'] = Returndata[0] self.headers = Returndata[1] r = Request().post_wirst_request(method=self.method, url=self.url, data=self.parm2, header=self.headers) print(r) Assertions().assert_code(r['code'], self.expect2['code']) Assertions().assert_code(r['status_code'], self.expect2['status_code'])
def test_unbind_device001(self): Returndata = Moudle("Wristband_Alpha").bind() self.parm['device_token'] = Returndata[0] self.headers = Returndata[1] r = Request().post_wirst_request(method=self.method, url=self.url, data=self.parm, header=self.headers) print(r) Assertions().assert_code(r['code'], self.expect['code']) Assertions().assert_code(r['status_code'], self.expect['status_code']) Assertions().assert_time(r['time_total'], self.expect['respones_time']) Assertions().assert_code(r['message'], self.expect['message']) Assertions().assert_code(r['data']['rst'], self.expect['data']['rst'])
def setup(self): print("Test Start") self.log = MyLog() self.env2 = "Wristband_Alpha" self.moudle = Moudle(self.env2) self.log.debug(u'初始化测试数据')
class TestClass: def setup(self): print("Test Start") self.log = MyLog() self.env2 = "Wristband_Alpha" self.moudle = Moudle(self.env2) self.log.debug(u'初始化测试数据') def teardown(self): print("Test End") @allure.story("wyzeband通过性验证") @allure.severity('blocker') @pytest.mark.smoke def test_wyzeband_smoke(self): self.moudle.bind() #绑定手环 self.moudle.get_token() #获取设备Token(不传参) self.moudle.get_token_data() #获取设备Token(传参) self.moudle.user_info() #获取用户信息 self.moudle.set_defaultconn() #设置默认连接的key self.moudle.get_defaultconn() #获取设备对应的默认自动连接设置 self.moudle.get_functions() #获取版本对应的功能列表(不包括基础功能) self.moudle.data_upload() #上传数据 self.moudle.get_sleep() #获取睡眠数据 self.moudle.get_step() #获取步数统计数据 self.moudle.get_heart_rate() #获取心率统计数据 self.moudle.get_sport_history() #获取运动历史 self.moudle.get_heart_rate_history() #获取某天的心率 self.moudle.get_band_bg_list() #获取手环背景图 self.moudle.upload_band_bg() #上传手环背景图 self.moudle.upload_taglog() #用户打点数据上报 self.moudle.unbind() #解绑手环