def reset_phone_network(self): """ 检查并重置手机网络,防止配网失败影响网络 :return: """ yield 1 add_device_page.set_system_wifi(data.get_wifi('phone')[0])
def genie_add_device(self, check_account, reset_phone_network): """ 添加智能开关: 1. app首页点击+,选择switch,跳过引导页 2. 选择亚添加的设备id 3. 设置wifi,勾选 Status Confirmed,点击 next 4. 连接中,等待conecting消失 【checkpoint】判断是否显示添加成功(文本校验) 5. 修改设备昵称未T1100,点击保存 6. 返回设备主页查看设备列表 【checkpoint】首页列表刷新后显示插座T1100 :param check_account: :return: """ if GlobalVar.get_remove_add() == 0: GlobalVar.set_test_flag('f') pytest.skip('本次指定不执行词条用例') home_page.swipe_page('down') home_page.click_add_device() add_device_page.click_genie() add_device_page.select_switch_by_udid(data.get_device_udid('genie')) wifi_date = data.get_wifi('genie') add_device_page.select_wifi_with_switch(wifi_date[0], wifi_date[1]) add_device_page.wait_connect() assert add_device_page.connect_result(), 'genie 配网连接失败' add_device_page.set_device_name(data.get_device('genie')) add_device_page.loading() genie_page.back_home() home_page.swipe_page('down') assert home_page.find_device(data.get_device('genie')), 'genie 配网成功后首页未查找到设备'
def reset_phone_network(self): """ 检查并重置手机网络,防止配网失败影响网络 :return: """ yield 1 if GlobalVar.get_test_flag(): add_device_page.set_system_wifi(data.get_wifi('phone')[0])
def bulbs_add_device(self, check_account, bulbs_off, reset_phone_network): """ 添加灯泡: 1. app首页点击+,选择bulbs 2. 点击Next,勾选 Status Confirmed,点击 next, 勾选 Status Confirmed,点击 next 3. 选择亚添加的设备id 4. 连接中,等待conecting消失 【checkpoint】判断是否显示添加成功(文本校验) 5. 修改设备昵称未T1013,点击保存 6. 返回设备主页查看设备列表 【checkpoint】首页列表刷新后显示灯泡1013 :param check_account: :return: """ if GlobalVar.get_remove_add() == 0: GlobalVar.set_test_flag('f') pytest.skip('本次指定不执行词条用例') home_page.swipe_page('down') if home_page.find_device(data.get_device('white_bulbs')): home_page.into_device_home_page(data.get_device('white_bulbs')) TestBulbs.bulbs_ready() bulbs_home_page.into_setting() bulbs_setting_page.swipe_page('up') bulbs_setting_page.click_remove() bulbs_setting_page.commit_remove() bulbs_setting_page.loading() home_page.click_add_device() add_device_page.click_bulds() wifi = data.get_wifi('white_bulbs') add_device_page.set_wifi(wifi[0], wifi[1]) add_device_page.confirm_bulbs_status() add_device_page.bulbs_next() add_device_page.confirm_bulbs_status() add_device_page.bulbs_next() add_device_page.select_robotic_by_id(data.get_device_udid('white_bulbs')) add_device_page.loading() add_device_page.wait_connect() assert add_device_page.connect_result(), 'bulbs 配网连接失败' add_device_page.set_device_name(data.get_device('white_bulbs')) add_device_page.ok add_device_page.loading() home_page.swipe_page('down') assert home_page.find_device(data.get_device('white_bulbs')), 'bulbs 配网成功后首页未查找到设备'
def test_plug_add_device(self, check_account, reset_phone_network): """ 添加插座设备: 1. app首页点击+,选择plug,设置wifi 2. 勾选 Status Confirmed,点击 next 3. 选择亚添加的设备id 4. 连接中,等待conecting消失 【checkpoint】判断是否显示添加成功(文本校验) 5. 修改设备昵称未T1100,点击保存 6. 返回设备主页查看设备列表 【checkpoint】首页列表刷新后显示插座T1100 :return: """ if GlobalVar.get_remove_add() == 0: GlobalVar.set_test_flag('f') pytest.skip('本次指定不执行词条用例') home_page.swipe_page('down') if home_page.find_device(data.get_device('plugs')): home_page.into_device_home_page(data.get_device('plugs')) TestPlug.plug_ready() plug_home_page.into_setting() plug_setting_page.click_remove() plug_setting_page.commit_remove() plug_setting_page.loading() home_page.click_add_device() add_device_page.click_plug() wifi_data = data.get_wifi('plugs') add_device_page.set_wifi(wifi_data[0], wifi_data[1]) add_device_page.confirm_bulbs_status() add_device_page.bulbs_next() add_device_page.select_robotic_by_id(data.get_device_udid('plugs')) add_device_page.wait_connect() assert add_device_page.connect_result(), 'plugs 配网连接失败' add_device_page.set_device_name(data.get_device('plugs')) add_device_page.ok add_device_page.loading() home_page.swipe_page('down') assert home_page.find_device( data.get_device('plugs')), 'plugs 配网成功后首页未查找到设备'