Beispiel #1
0
    def bulbs_remove(self, check_account):
        """
        移除灯泡球产品:
        1. app首页点击进入设备主页,点击more进入设置界面
        2. 点击remove
        【checkpoint】弹出移除成功确认弹窗
        【checkpoint】返回app首页,设备列表不显示light
        :param check_account:
        :return:
        """
        if GlobalVar.get_remove_add() == 0:
            pytest.skip('本次指定不执行词条用例')

        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()

        assert bulbs_setting_page.text_display('Are you sure you want to remove this device?'), '未显示移除确认弹窗'
        bulbs_setting_page.commit_remove()
        bulbs_setting_page.loading()
        assert home_page.is_welcome(), '移除设备后未返回app首页'
        home_page.swipe_page('down')
        assert home_page.find_device(data.get_device('white_bulbs')) is False, 'bulbs 删除后首页仍然显示'
    def test_switch_remove(self, check_account):
        """
        移除智能开关:
        1. app首页点击进入设备主页,点击more进入设置界面
        2. 点击remove
        【checkpoint】弹出移除成功确认弹窗
        【checkpoint】返回app首页,设备列表不显示switch
        :return:
        """
        if GlobalVar.get_remove_add() == 0:
            pytest.skip('本次指定不执行词条用例')

        home_page.into_device_home_page(data.get_device('switch'))

        TestSwitch.switch_ready()

        switch_home_page.into_setting()
        switch_setting_page.click_remove()

        assert switch_setting_page.text_display(
            'Are you sure you want to remove this device?'), 'switch 移除未显示确认弹窗'
        switch_setting_page.commit_remove()
        switch_setting_page.loading()
        assert home_page.is_welcome(), 'switch 移除后未返回app首页'
        home_page.swipe_page('down')
        assert home_page.find_device(
            data.get_device('switch')) is False, 'switch 移除后设备列表未删除设备'
    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 配网成功后首页未查找到设备'
Beispiel #4
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 配网成功后首页未查找到设备'