def test_plug_schedule_time(self, check_account, close_plug_schedule):
        """
        智能插座设置定时任务:
        1.设置一个基于当前时间5min后的定时任务
        【checklist】检查定时任务列表的时间是否设置正确
        2.等待定时任务启动
        【checklist】检查定时任务启动后灯泡的状态
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('plugs'))
        TestPlug.plug_ready()

        if plug_home_page.read_deivce_status() == 'ON':
            plug_home_page.click_plug_btn()
        plug_home_page.into_schedule()
        _t = plug_schedule_page.add_new_schedule(data.get_device('plugs'), 5)

        assert _t == plug_schedule_page.read_schedule_time(
            plug_schedule_page.week_simple_name), '定时任务设置正确'
        plug_schedule_page.back_plug()

        GlobalVar.set_test_flag('t')  # 此处需要判断设备状态了

        plug_home_page.long_wait(480)
        assert 'ON' in plug_home_page.read_deivce_status(), '定时任务执行启动成功'
    def plugs_close_yellow_tip(self, plugs_close_yellow_tip, check_account):
        """
        智能插座被分享者修改设备名及小黄条显示:
        1. app首页点击进入设备主页,修改一个定时任务
        2.切换账号 [email protected],查看智能开关设备
        【checkpoint】显示设备名称修改小黄条
        :return:
        """
        if home_page.find_device(data.get_device('plugs')) is False:
            assert False, '未查找到分享设备,无法执行用:[test_plugs_close_yellow_tip]'

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

        TestPlug.plug_ready()

        plug_home_page.into_schedule()
        plug_schedule_page.click_away_mode()
        plug_schedule_page.back_plug()
        plug_home_page.back_home()

        TestPlug.change_account('plugs')

        home_page.into_device_home_page(data.get_device('plugs'))
        plug_home_page.skip_plug_guide()
        if plug_home_page.is_offline:
            plug_home_page.ok
            if plug_home_page.plug_is_offline() is False:
                assert False, 'plug 设备处于离线状态'

        plug_home_page.ignore_update()
        plug_home_page.into_schedule()
        GlobalVar.set_test_flag('t')

        assert plug_schedule_page.text_display(
            'share modified the schedule'), '被分享人修改了定时任务未显示小黄条提示'
    def test_switch_change_name(self, check_account, set_switch_name):
        """
        修改开关的设备名:
        1. app首页点击进入设备主页,点击more进入设置界面
        2.修改设备名称
        【checkpoint】检查设置界面的昵称是否修改正确
        3。返回设备主页
        【checkpoint】检查设备主页界面的昵称是否修改正确
        4。返回app主页
        【checkpoint】检查app列表界面的昵称是否修改正确
        :return:
        """
        home_page.into_device_home_page(data.get_device('switch'))

        TestSwitch.switch_ready()

        new_name = data.get_device('switch') + switch_home_page.get_str()
        switch_home_page.into_setting()
        switch_setting_page.change_switch_name(new_name)

        GlobalVar.set_test_flag('t')

        assert new_name in switch_setting_page.read_switch_name(
        ), 'switch 修改昵称后设置界面名称错误'

        switch_setting_page.back_switch()
        time.sleep(3)
        assert new_name in switch_home_page.read_switch_name(
        ), 'switch 修改昵称后设备主页界面名称错误'

        switch_home_page.back_home()
        assert home_page.find_device(new_name), '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 配网成功后首页未查找到设备'
    def test_switch_schedule_time(self, check_account, close_switch_schedule):
        """
        智能开关设置定时任务:
        1.设置一个基于当前时间5min后的定时任务
        【checklist】检查定时任务列表的时间是否设置正确
        2.等待定时任务启动
        【checklist】检查定时任务启动后灯泡的状态
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('switch'))
        TestSwitch.switch_ready()

        if switch_home_page.read_deivce_status() == 'ON':
            switch_home_page.click_switch_btn()
        switch_home_page.into_schedules()
        _t = switch_schedule_page.add_new_schedule(data.get_device('switch'),
                                                   5)

        assert _t == switch_home_page.read_schedule_time(
            switch_schedule_page.week_simple_name), '定时任务设置正确'
        switch_schedule_page.back_switch()

        GlobalVar.set_test_flag('t')  # 此处需要判断设备状态了

        switch_home_page.long_wait(320)
        assert 'ON' in switch_home_page.read_deivce_status(), '定时任务执行启动成功'
    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 移除后设备列表未删除设备'
Exemplo n.º 7
0
    def test_white_bulbs_check_schedule_icon(self, check_account):
        """
        检查定时任务图标是否显示:
        1.进入app主页,检查是否显示定时任务图标
        2.如果未显示则去开启一个定时任务,并返回app首页
        【checkpoint】检查设备是否显示定时任务图标
        :return:
        """
        home_page.swipe_page('down')
        status = home_page.have_schedule_icon(data.get_device('white_bulbs'))

        if not status:
            home_page.into_device_home_page(data.get_device('white_bulbs'))
            bulbs_home_page.skip_bulbs_guide()
            if bulbs_home_page.is_offline:
                bulbs_home_page.ok
            bulbs_home_page.ignore_update()

            bulbs_home_page.into_schedules(False)
            if not bulbs_schedule_page.read_away_mode_status():
                bulbs_schedule_page.click_away_mode()
            bulbs_schedule_page.back_bulbs()
            bulbs_home_page.back_home()
            home_page.swipe_page('down')
            status = home_page.have_schedule_icon(data.get_device('white_bulbs'))

        assert status, 'bulbs 未显示定时任务图标'

        home_page.click_schedule_icon(data.get_device('white_bulbs'))
        assert home_page.text_display('Schedules'), 'bulbs 定时任务快捷图标进入失败'
    def test_switch_check_schedule_icon(self, check_account):
        """
        检查定时任务图标是否显示:
        1.进入app主页,检查是否显示定时任务图标
        2.如果未显示则去开启一个定时任务,并返回app首页
        【checkpoint】检查设备是否显示定时任务图标
        :return:
        """
        home_page.swipe_page('down')
        status = home_page.have_schedule_icon(data.get_device('switch'))

        if not status:
            home_page.into_device_home_page(data.get_device('switch'))

            TestSwitch.switch_ready()

            switch_home_page.into_schedules()
            if not switch_schedule_page.read_away_mode_status():
                switch_schedule_page.click_away_mode()
            switch_schedule_page.back_switch()
            switch_home_page.back_home()
            home_page.swipe_page('down')
            status = home_page.have_schedule_icon(data.get_device('switch'))

        assert status, 'switch 未显示定时任务图标'

        home_page.click_schedule_icon(data.get_device('switch'))
        assert home_page.text_display('Schedules'), 'switch 定时任务快捷图标进入失败'
    def switch_close_yellow_tip(self, switch_close_yellow_tip, check_account):
        """
        智能开关被分享者修改设备名及小黄条显示:
        1. app首页点击进入设备主页,修改一个定时任务
        2.切换账号 [email protected],查看智能开关设备
        【checkpoint】显示设备名称修改小黄条
        :return:
        """
        if home_page.find_device(data.get_device('switch')) is False:
            assert False, '未查找到分享设备,无法执行用:[test_switch_close_yellow_tip]'

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

        TestSwitch.switch_ready()

        switch_home_page.into_schedules()
        switch_schedule_page.click_away_mode()
        switch_schedule_page.back_switch()
        switch_home_page.back_home()

        TestSwitch.change_account('switch')

        home_page.into_device_home_page(data.get_device('switch'))
        switch_home_page.skip_switch_guide()
        if switch_home_page.is_offline:
            switch_home_page.ok
            if switch_home_page.switch_is_offline() is False:
                assert False, 'switch 设备处于离线状态'

        switch_home_page.into_schedules()
        GlobalVar.set_test_flag('t')

        assert switch_schedule_page.text_display(
            'share modified the schedule'), '被分享人修改了定时任务未显示小黄条提示'
Exemplo n.º 10
0
    def test_white_bulbs_schedule_time(self, check_account, close_bulbs_schedule):
        """
        球泡灯设置定时任务:
        1.设置一个基于当前时间5min后的定时任务
        【checklist】检查定时任务列表的时间是否设置正确
        2.等待定时任务启动
        【checklist】检查定时任务启动后灯泡的状态
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))
        TestBulbs.bulbs_ready()

        if bulbs_home_page.bulb_status(False):
            bulbs_home_page.click_bulbs()
        bulbs_home_page.into_schedules(False)
        _t = bulbs_schedule_page.add_new_schedule(data.get_device('white_bulbs'), 5)

        assert _t == bulbs_schedule_page.read_schedule_time(bulbs_schedule_page.week_simple_name), '定时任务设置正确'
        bulbs_schedule_page.back_bulbs()

        GlobalVar.set_test_flag('t')  # 此处需要判断设备状态了

        bulbs_home_page.long_wait(320)
        assert bulbs_home_page.bulb_status(False), '定时任务执行启动成功'
Exemplo n.º 11
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_change_name(self, check_account, set_plugs_name):
        """
        修改插座的设备名:
        1. app首页点击进入设备主页,点击more进入设置界面
        2.修改设备名称
        【checkpoint】检查设置界面的昵称是否修改正确
        3。返回设备主页
        【checkpoint】检查设备主页界面的昵称是否修改正确
        4。返回app主页
        【checkpoint】检查app列表界面的昵称是否修改正确
        :return:
        """
        home_page.into_device_home_page(data.get_device('plugs'))

        TestPlug.plug_ready()

        new_name = data.get_device('plugs') + plug_home_page.get_str()
        plug_home_page.into_setting()
        plug_setting_page.change_device_name(new_name)

        GlobalVar.set_test_flag('t')

        assert new_name in plug_setting_page.read_device_name(
        ), 'plugs 修改昵称后设置界面名称错误'

        plug_setting_page.back_plug()
        assert new_name in plug_home_page.read_plug_name(
        ), 'plugs 修改昵称后设备主页界面名称错误'

        plug_home_page.back_home()
        assert home_page.find_device(new_name), 'plugs 修改昵称后设备列表名称错误'
    def test_switch_agree_share(self, check_account, delete_share_news):
        """
        智能开关被分享者接受分享:
        1. 登陆账号[email protected]/12345678
        【checkpoint】登陆账号为[email protected]
        2. 点击进入侧边栏界面
        【checkpoint】消息通知显示分享通知红点标识
        3. 点击news进入消息界面
        【checkpoint】显示分享邀请消息记录
        4. 点击最新一条分享邀请通知,点击ok按钮
        【checkpoint】点击ok按钮弹窗提示分享成功
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('switch'))

        TestSwitch.switch_ready()

        switch_home_page.into_setting()
        switch_setting_page.into_share()

        status = share_setting_page.read_share_status(
            data.get_username('share'))
        if status not in ['Awaiting Confirmation', 'Pending Confirmation']:
            share_setting_page.add_share()
            share_setting_page.commit_share(data.get_account('share'))
            assert share_setting_page.share_result(
            ), 'switch 正确账号分享失败,无法执行用例:[test_bulbs_agree_share]'
            share_setting_page.ok
            share_setting_page.loading()

        share_setting_page.back_setting()
        switch_setting_page.back_switch()
        switch_home_page.back_home()
        TestSwitch.change_account('share')
        home_page.into_system()

        system_page.into_sharing()
        assert all_share_page.text_display(
            data.get_device('switch')), '被分享列表未显示分享设备信息'
        GlobalVar.set_test_flag('t')  # 到这里后需要执行 tear_down
        all_share_page.into_device(data.get_device('switch'))
        all_share_page.yes
        all_share_page.loading()

        assert all_share_page.text_display(
            'Request Accepted. You may now use this device.'), '被分享者确认接受分享失败'
        all_share_page.ok
        assert all_share_page.text_display(
            'switch shared a ' +
            data.get_device('switch').strip()), '被分享者显示的分享设备名称错误'

        news_page.back_system()
        news_page.back_system()
        system_page.back_home()
        home_page.swipe_page('down')
        assert home_page.find_device(
            data.get_device('switch')), '被分享者未显示分享的switch设备'
Exemplo n.º 14
0
 def bulbs_off(self):
     """
     灯泡后置操作:关闭灯泡
     :return:
     """
     yield 1
     if home_page.is_welcome():
         if home_page.read_device_status(data.get_device('white_bulbs')) == 'ON':
             home_page.click_device_btn(data.get_device('white_bulbs'))
     elif bulbs_home_page.bulb_status(False):
         bulbs_home_page.click_bulbs()
 def set_switch_name(self):
     """
     恢复设备名
     :return:
     """
     yield 1
     if GlobalVar.get_test_flag():
         if home_page.is_welcome():
             home_page.into_device_home_page(data.get_device('switch'))
         if switch_home_page.is_switch_home():
             switch_home_page.into_setting()
         switch_setting_page.change_switch_name(data.get_device('switch'))
         time.sleep(1.5)
 def set_plugs_name(self):
     """
     恢复设备名
     :return:
     """
     yield 1
     if GlobalVar.get_test_flag():
         if home_page.is_welcome():
             home_page.into_device_home_page(data.get_device('plugs'))
         if plug_home_page.is_plug_home():
             plug_home_page.into_setting()
         plug_setting_page.change_device_name(data.get_device('plugs'))
         time.sleep(1.5)
    def test_switch_refuse_share(self, delete_share_news, check_account,
                                 delete_refuse_share_account):
        """
        智能开关被分享者拒绝接受分享:
        1. 点击智能开关进入扫地机主页,点击 more进入设置界面,点击share setting进入分享列表
        2. 点击 add 按钮进入添加界面,输入分享账号:[email protected]并提交
        【checkpoint】 分享邀请发送成功,弹窗提示:Successed to share
        3.重启app切换账号[email protected],进入分享消息记录
        4.点击拒绝接受分享按钮
        【checkpoint】显示已拒绝分享弹窗
        【chenckpoint】app首页不显示分享设备
        5.切换至分享者账号,检查分享列表
        【checkpoint】不显示已拒绝的分享人
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('switch'))

        TestSwitch.switch_ready()

        switch_home_page.into_setting()
        switch_setting_page.into_share()
        share_setting_page.add_share()
        share_setting_page.commit_share(data.get_account('refuseshare'))
        assert share_setting_page.share_result(), 'switch 正确账号分享失败'
        share_setting_page.ok
        share_setting_page.loading()

        share_setting_page.back_setting()
        switch_setting_page.back_switch()
        switch_home_page.back_home()

        TestSwitch.change_account('refuseshare')
        GlobalVar.set_test_flag('t')

        home_page.into_system()
        system_page.into_sharing()
        all_share_page.into_device(data.get_device('switch'))
        all_share_page.no
        assert all_share_page.text_display(
            'Request Declined. This device will be removed.'
        ), 'switch 被分享者拒绝接受分享失败'
        all_share_page.ok
        all_share_page.loading()

        all_share_page.back_system()
        system_page.back_home()
        home_page.swipe_page('down')
        assert home_page.find_device(
            data.get_device('switch')) is False, 'app首页被分享者拒绝分享后显示分享了扫地机设备'
Exemplo n.º 18
0
    def _white_bulbs_check_update_icon(self, check_account):
        """
        设备升级提示图标检查:
        1. app首页点击进入设备主页
        【checkpoint】首页设备列表是否显示升级图标
        :param check_account:
        :param bulb:
        :return:
        """
        home_page.swipe_page('down')
        assert home_page.have_update_icon(data.get_device('white_bulbs')), 'white_bulbs 未显示升级图标'

        home_page.click_update_icon(data.get_device('white_bulbs'))
        assert home_page.text_display('Firmware Update'), 'white_bulbs OTA升级快捷入口进入失败'
Exemplo n.º 19
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 switch_check_update_icon(self, check_account):
        """
        设备升级提示图标检查:
        1. app首页点击进入设备主页
        【checkpoint】首页设备列表是否显示升级图标
        :param check_account:
        :return:
        """
        home_page.swipe_page('down')
        assert home_page.have_update_icon(
            data.get_device('switch')), 'random_robotic 未显示升级图标'

        home_page.click_update_icon(data.get_device('switch'))
        assert home_page.text_display(
            'Firmware Update'), 'switch OTA升级快捷入口进入失败'
    def test_switch_add_and_delete_schedule(self, check_account):
        """
        新增和删除一个定时任务:
        1. 进入app首页,点击设备开关
        2.点击shecdule进入设备定时任务界面,新增定时任务,日期选择当天
        3.点击save保存
        【checkpoint】提示新增成功确认弹窗
        【checkpoint】返回定时任务列表显示定时任务,时间为当天
        4.在列表左滑删除定时任务
        【checkpoint】定时任务列表显示为空
        :param check_account:
        :param switch_off:
        :return:
        """
        home_page.into_device_home_page(data.get_device('switch'))

        TestSwitch.switch_ready()

        switch_home_page.into_schedules()
        if switch_schedule_page.count_schedule() > 0:
            switch_schedule_page.delete_schedule()

        switch_schedule_page.add_new_schedule()
        time.sleep(3)
        assert switch_schedule_page.count_schedule() == 1, 'switch 添加定时任务失败'
        week = data.get_week_by_id(str(switch_schedule_page.week_id))
        assert switch_schedule_page.text_display(week), 'switch 定时任务日期显示错误'

        switch_schedule_page.delete_schedule()
        time.sleep(2.5)
        assert switch_schedule_page.count_schedule() == 0, 'switch 删除定时任务失败'
Exemplo n.º 22
0
    def test_white_bulbs_share_email(self, check_account, delete_refuse_share_account):
        """
        灯泡球分享给未注册的账号:
        1. 点击灯泡球进入扫地机主页,点击 more进入设置界面,点击share setting进入分享列表
        2. 点击 add 按钮进入添加界面,输入分享账号:[email protected]并提交
        【checkpoint】 分享邀请发送成功,弹窗提示:Successed to share
        【checkpoint】页面返回到分享列表并显示分享人,状态为:待确认
        :param check_account:
        :return:
        """

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

        TestBulbs.bulbs_ready()

        bulbs_home_page.into_setting()
        bulbs_setting_page.into_share()
        share_setting_page.add_share()
        share_setting_page.commit_share(data.get_account('share'))

        assert share_setting_page.share_result(), 'bulbs正确账号分享失败'
        share_setting_page.ok
        share_setting_page.loading()
        status = share_setting_page.read_share_status(data.get_username('share'))
        assert status == 'Awaiting Confirmation' or status == 'Pending Confirmation', '分享列表被分享者状态显示错误'
    def test_switch_add_timer(self, desc, yt, check_account, switch_off):
        """
        新增一个倒计时任务:(默认一分钟)
        1.进入设备主页,点击定时器新增一个开启快关的倒计时,默认为1min
        【checkpoint】1分钟后检查设备状态
        2.新增一个关闭快关的倒计时,默认为1min
        【checkpoint】1分钟后检查设备状态
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('switch'))

        TestSwitch.switch_ready()

        if desc == 'OFF' and switch_home_page.read_deivce_status() == 'OFF':
            switch_home_page.click_switch_btn()
            time.sleep(2.5)

        switch_home_page.into_timer()
        switch_timer_page.set_timer(desc, yt)
        switch_timer_page.start_timer()
        switch_timer_page.loading()

        switch_timer_page.long_wait(yt * 60 + 10)
        switch_timer_page.back_switch()
        assert desc in switch_home_page.read_deivce_status(
        ), 'switch 倒计时结束后状态显示错误'
Exemplo n.º 24
0
    def test_white_bulbs_set_custom_light_status(self, check_account, bulbs_off):
        """
        修改灯光默认设置为自定义灯效:
        1. app首页点击灯泡进入设备主页设置灯效flow,点击more,点击defult light state进入编辑界面
        2.默认灯效改为自定义设置,选择color,点击done
        【checkpoint】当前选择custom light status
        3. 返回灯泡主页,点亮灯泡
        【checkpoint】灯效显示为color
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))

        TestBulbs.bulbs_ready()

        bulbs_home_page.into_setting()
        bulbs_setting_page.into_default_light()
        bulbs_default_light_page.min_custom_lightness()
        bulbs_default_light_page.add_check_image('自定义灯效设置')

        bulbs_default_light_page.back_setting()
        bulbs_setting_page.back_bulbs_home()

        if bulbs_home_page.bulb_status(False) is False:
            bulbs_home_page.click_bulbs()
        time.sleep(4)
        assert bulbs_home_page.check_lightness_img('bulbs_min'), '灯泡自定义亮度设置失败'
Exemplo n.º 25
0
    def test_white_bulbs_set_last_light_status(self, check_account, bulbs_off):
        """
        修改灯光默认设置为最后一次灯效:
        1. app首页点击灯泡进入设备主页,点击more,点击defult light state进入编辑界面
        2.修改默认设置为上一次灯效
        【checkpoint】当前选择 Last On Status
        3.修改灯泡模式为flow, 返回灯泡主页再次点亮灯泡读取灯效
        【checkpoint】灯效显示为flow
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))

        TestBulbs.bulbs_ready()

        # 灯泡调到最亮
        if bulbs_home_page.bulb_status(False) is False:
            bulbs_home_page.click_bulbs()
            time.sleep(4)
        bulbs_home_page.change_lightness('up')
        bulbs_home_page.click_bulbs()

        bulbs_home_page.into_setting()
        bulbs_setting_page.into_default_light()
        bulbs_default_light_page.click_last_status()
        bulbs_default_light_page.loading()
        bulbs_default_light_page.add_check_image('记录最后一次灯效设置')

        bulbs_default_light_page.back_setting()
        bulbs_setting_page.back_bulbs_home()

        bulbs_home_page.click_bulbs()
        assert bulbs_home_page.check_lightness_img('bulbs_max'), '灯泡使用最后一次亮度设置失败'
Exemplo n.º 26
0
    def test_white_bulbs_add_effect_favorite(self, check_account, delete_effect_favorite):
        """
        添加white模式的favorite:
        1. app首页点击灯泡进入设备主页
        2. 点击white模式,点击收藏,输入收藏名字f_white,点击保存
        【checkpoint]】toast=Successfully Add
        3.退出effect,点击favorite进入收藏列表,遍历列表
        【checkpoint】列表显示f_white
        4.点击f_white,返回灯泡主页
        【checkpoint】灯效显示white
        :param check_account:
        :param effect:灯效
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))

        TestBulbs.bulbs_ready()

        if bulbs_home_page.bulb_status(False) is False:
            bulbs_home_page.click_bulbs()
        time.sleep(4)

        bulbs_effect_page.add_favorite_effect('favorite')
        bulbs_effect_page.add_check_image('添加灯效收藏')
        GlobalVar.set_test_flag('t')

        bulbs_home_page.click_bulbs()
        bulbs_home_page.into_favorites(False)
        assert bulbs_favorite_page.find_favorite('favorite'), '未找到新添加的effect收藏'
Exemplo n.º 27
0
    def test_white_bulbs_delete_favorite(self, check_account):
        """
        删除灯效列表:
        1. app首页进入收藏列表,统计列表总数,小于1则新增一条
            2.灯泡主页点击灯泡进入设备主页,点击effect
            3. 点击white模式,点击收藏,输入收藏名字f_white,点击保存
        4.左滑删除列表,推出后再进来检查是否生效
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))

        TestBulbs.bulbs_ready()

        bulbs_home_page.into_favorites(False)
        if bulbs_favorite_page.count_favorite_title() < 1:
            bulbs_favorite_page.back_bulbs()
            if bulbs_home_page.bulb_status(False) is False:
                bulbs_home_page.click_bulbs()
                time.sleep(5)

            bulbs_effect_page.add_favorite_effect('delete')
            if bulbs_home_page.bulb_status(False):
                bulbs_home_page.click_bulbs()
            bulbs_home_page.into_favorites(False)
        bulbs_favorite_page.delete_favorite()

        bulbs_favorite_page.back_bulbs()
        bulbs_home_page.into_favorites(False)
        assert bulbs_favorite_page.count_favorite_title() == 0, 'bulbs 灯效收藏列表删除失败'
Exemplo n.º 28
0
    def test_white_bulbs_schedule_add_and_delete(self, check_account):
        """
        新增和删除定时任务:
        1. app首页点击灯泡进入设备主页,点击schedule
        2. 点击 add 新增一个定时任务,星期几选择当前日期,点击save保存
        【checkpoint】返回定时任务列表,定时任务数量增加1
        【checkpoint】显示新增定时任务,日期为今天
        3.长按左滑在列表删除定时任务,点击ok
        # 【checkpoint】提示删除成功确认弹窗 封装在方法内部无法校验
        【checkpoint】定时任务列表任务清空
        :param check_account:
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))

        TestBulbs.bulbs_ready()

        bulbs_home_page.into_schedules(False)
        time.sleep(2.5)
        if bulbs_schedule_page.count_schedule() > 0:
            bulbs_schedule_page.delete_schedule()
        bulbs_schedule_page.add_new_schedule()
        time.sleep(2.5)

        assert bulbs_schedule_page.count_schedule() == 1, 'bulbs添加定时任务失败'
        week = data.get_week_by_id(str(bulbs_schedule_page.week_id))
        assert bulbs_schedule_page.text_display(week), '定时任务日期显示错误'

        bulbs_schedule_page.delete_schedule()
        time.sleep(2.5)
        assert bulbs_schedule_page.count_schedule() == 0, '删除定时任务失败'
Exemplo n.º 29
0
    def test_white_bulbs_change_lightness(self, check_account, bulbs_off):
        """
        调节灯泡亮度及默认亮度设置:
        1. app首页点击灯泡进入设备主页,点击effect设置灯泡效果white
        2.点击设置灯光亮度为上次灯光亮度
        3.向下滑动灯泡调节亮度到最低
        【checkpoint】检查亮度值 是否为1%
        4. 向上滑动调节灯泡亮度到最高,3s后再次按压灯泡,读取新的亮度值
        【checkpoint】检查亮度值是否为100%
        :return:
        """
        home_page.into_device_home_page(data.get_device('white_bulbs'))

        TestBulbs.bulbs_ready()

        if bulbs_home_page.bulb_status(False) is False:
            bulbs_home_page.click_bulbs()
            time.sleep(5)

        bulbs_home_page.change_lightness('down')
        time.sleep(5)
        assert bulbs_home_page.check_lightness_img('bulbs_min'), '灯泡调至最小亮度失败'

        bulbs_home_page.change_lightness('up')
        time.sleep(5)
        assert bulbs_home_page.check_lightness_img('bulbs_max'), '灯泡调至最大亮度失败'
    def test_plug_add_timer(self, desc, yt, check_account, plug_off):
        """
        新增一个倒计时任务:(默认一分钟)
        1.进入设备主页,点击定时器新增一个开启快关的倒计时,默认为1min
        【checkpoint】1分钟后检查设备状态
        2.新增一个关闭快关的倒计时,默认为1min
        【checkpoint】1分钟后检查设备状态
        :param desc:
        :param yt:
        :param check_account:
        :param plug_off:
        :return:
        """
        home_page.into_device_home_page(data.get_device('plugs'))

        TestPlug.plug_ready()

        if desc == 'OFF' and plug_home_page.read_deivce_status() == 'OFF':
            plug_home_page.click_plug_btn()
            time.sleep(2.5)

        plug_home_page.into_timer()
        plug_timer_page.set_timer(desc, yt)
        plug_timer_page.start_timer()

        plug_timer_page.long_wait(60 * yt + 10)
        plug_timer_page.back_plug()
        assert desc in plug_home_page.read_deivce_status(
        ), 'plugs 倒计时结束后状态显示错误'