Ejemplo n.º 1
0
 def test_alarm_top5_7days(self, login_web):
     self.test_alarm_top5_7days.__func__.__doc__ = T.top5_7dayas['dec']
     P_log.info("*******开始执行{0}测试用例******".format(T.top5_7dayas['name']))
     try:
         会议室门 = First_Page(login_web).get_text(First_Page.小会议室)
         ymq = First_Page(login_web).get_text(First_Page.ymq)
         门口走廊 = First_Page(login_web).get_text(First_Page.门口走廊)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.top5_7dayas['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.top5_7dayas['name'], e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 2
0
 def test_resource_total(self, login_web, flag=True):
     self.test_resource_total.__func__.__doc__ = T.resource_total['dec']
     P_log.info("*******开始执行{0}测试用例******".format(T.resource_total['name']))
     try:
         First_Page(login_web).select_laber('资源统计', '累计')
         R_log.info("{0}用例执行成功".format(T.resource_total['name']))
         time.sleep(3)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.resource_total['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.resource_total['name'], e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 3
0
 def test_alarm_top5_sum(self, login_web):
     self.test_alarm_top5_sum.__func__.__doc__ = T.top5_sum['dec']
     P_log.info("*******开始执行{0}测试用例******".format(T.top5_sum['name']))
     try:
         First_Page(login_web).select_laber('点位告警', '累计')
         会议室门 = First_Page(login_web).get_text(First_Page.小会议室累计)
         ymq = First_Page(login_web).get_text(First_Page.ymq_sum)
         门口走廊 = First_Page(login_web).get_text(First_Page.门口走廊累计)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.top5_sum['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.top5_sum['name'], e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 4
0
 def test_alarm_total(self, login_web):
     self.test_alarm_total.__func__.__doc__ = T.alarm_total['dec']
     P_log.info("*******开始执行{0}测试用例******".format(T.alarm_total['name']))
     try:
         First_Page(login_web).select_laber('告警统计', '累计')
         告警统计累计人脸 = First_Page(login_web).get_text(First_Page.告警统计累计人脸)
         告警统计累计人体 = First_Page(login_web).get_text(First_Page.告警统计累计人体)
         告警统计累计机动车 = First_Page(login_web).get_text(First_Page.告警统计累计机动车)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.alarm_total['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.alarm_total['name'], e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 5
0
 def test_monitor_statistics(self, login_web):
     self.test_monitor_statistics.__func__.__doc__ = T.monitor_statistics[
         'dec']
     P_log.info("*******开始执行{0}测试用例******".format(
         T.monitor_statistics['name']))
     try:
         人脸布控 = First_Page(login_web).get_text(First_Page.人脸布控)
         人体布控 = First_Page(login_web).get_text(First_Page.人体布控)
         机动车布控 = First_Page(login_web).get_text(First_Page.机动车布控)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.monitor_statistics['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.monitor_statistics['name'],
                                            e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 6
0
 def test_mix_select(self, login_web):
     self.test_mix_select.__func__.__doc__ = E.mix_query['dec']
     P_log.info("*******开始执行{0}测试用例******".format(E.mix_query['name']))
     First_Page(login_web).select_item('解析管理')
     time.sleep(1)
     try:
         head = Analytical(login_web).get_text(Analytical.列表标题)
         time.sleep(2)
         Analytical(login_web).click(Analytical.设备类型)
         time.sleep(2)
         Analytical(login_web).select_type(E.mix_query['type'])
         time.sleep(2)
         Analytical(login_web).click(Analytical.任务状态)
         time.sleep(2)
         Analytical(login_web).select_state(E.mix_query['state'])
         time.sleep(1)
         Analytical(login_web).click(Analytical.查询按钮)
         time.sleep(1)
         body = Analytical(login_web).get_text(Analytical.列表)
         list_1 = Analytical(login_web).process_text(head, body)
         #检验筛选过后的实际状态与预期的状态一致
         P_log.info("*******开始进行结果校验*********")
         assert list_1[2][0] == E.mix_query['type'] and list_1[3][
             0] == E.mix_query['state']
         R_log.info("{0}用例执行成功".format(E.mix_query['name']))
     except Exception as e:
         R_log.info("{0}用例执行失败".format(E.mix_query['name']))
         P_log.error("{0}用例失败原因:{1}".format(E.mix_query['name'], e))
         Analytical(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 7
0
    def test_stop(self, login_web):
        self.test_stop.__func__.__doc__ = E.button_stop['dec']
        P_log.info("*******开始执行{0}测试用例******".format(E.button_stop['name']))
        First_Page(login_web).select_item('解析管理')
        time.sleep(1)
        try:
            head = Analytical(login_web).get_text(Analytical.列表标题)
            Analytical(login_web).input_text(Analytical.请输入设备名称,
                                             E.button_stop['device'])
            time.sleep(2)
            Analytical(login_web).click(Analytical.查询按钮)
            body = Analytical(login_web).get_text(Analytical.列表)
            list_1 = Analytical(login_web).process_text(head, body)
            # 判断当前设备的状态
            if "停止" in list_1[4][0]:
                Analytical(login_web).click(Analytical.停止按钮)
                time.sleep(1)
                Analytical(login_web).click(Analytical.确定)
                time.sleep(4)
                body_1 = Analytical(login_web).get_text(Analytical.列表)
                list_1 = Analytical(login_web).process_text(head, body_1)
                assert "启动" in list_1[4][0]
                R_log.info("{0}用例执行成功".format(E.button_stop['name']))
            else:
                P_log.info('当前设备状态不是运行中,无法继续执行用例')
                raise Exception('当前设备状态无法继续执行用例')

        except Exception as e:
            R_log.info("{0}用例执行失败".format(E.button_stop['name']))
            P_log.error("{0}用例失败原因:{1}".format(E.button_stop['name'], e))
            Analytical(login_web).save_picture('用例异常截图')
            raise e
Ejemplo n.º 8
0
 def test_archives_statistics(self, login_web):
     self.test_archives_statistics.__func__.__doc__ = T.archives_statistics[
         'dec']
     P_log.info("*******开始执行{0}测试用例******".format(
         T.archives_statistics['name']))
     try:
         人员档案 = First_Page(login_web).get_text(First_Page.人员档案)
         场所档案 = First_Page(login_web).get_text(First_Page.场所档案)
         车辆档案 = First_Page(login_web).get_text(First_Page.车辆档案)
         设备档案 = First_Page(login_web).get_text(First_Page.设备档案)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.archives_statistics['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.archives_statistics['name'],
                                            e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 9
0
    def test_newusererror(self, login_web, data):
        P_log.info('*******开始执行【新增用户】{0}测试用例******'.format(data['casename']))
        First_Page(login_web).manager(2, 'user')
        if data['casename'] == '所属组织为空':
            User(login_web).user_departnull(data['phone'], data['name'],
                                            data['pwd'], data['pwdtwo'])
        elif data['casename'] == '所属角色为空':
            User(login_web).user_rolenull(data['phone'], data['name'],
                                          data['pwd'], data['pwdtwo'])
        elif '身份证' in data['casename']:
            User(login_web).add_user(data['phone'], data['name'], data['pwd'],
                                     data['pwdtwo'], data['cardID'])
        elif data['casename'] == '手机号码已存在':
            User(login_web).add_user(data['phone'], data['name'], data['pwd'],
                                     data['pwdtwo'])
            User(login_web).add_user(data['phone'], data['name'], data['pwd'],
                                     data['pwdtwo'])
        else:
            User(login_web).add_user(data['phone'], data['name'], data['pwd'],
                                     data['pwdtwo'])

        msg = User(login_web).get_errorinfo()
        try:
            P_log.info("*******开始进行【新增用户】{0}测试用例结果校验*********".format(
                data['casename']))
            assert data['error'] in msg
            R_log.info("******【新增用户】{0}用例执行成功******".format(data['casename']))
        except Exception as e:
            R_log.info("【新增用户】{0}用例执行失败".format(data['casename']))
            P_log.error("【新增用户】{0}用例失败,失败原因:{1}".format(data['casename'], e))
            User(login_web).save_picture('用例异常截图')
            raise e
Ejemplo n.º 10
0
    def test_type(self, login_web, data):
        self.test_modification.__func__.__doc__ = data['dec']
        P_log.info("*******开始执行{0}测试用例******".format(data['name']))
        First_Page(login_web).select_item('解析管理')
        time.sleep(1)
        try:
            head = Analytical(login_web).get_text(Analytical.列表标题)
            time.sleep(2)
            Analytical(login_web).click(Analytical.设备类型)
            time.sleep(2)
            Analytical(login_web).select_type(data['type'])
            time.sleep(2)
            Analytical(login_web).click(Analytical.任务状态)
            time.sleep(2)
            Analytical(login_web).select_state(data['state'])
            time.sleep(1)
            Analytical(login_web).click(Analytical.查询按钮)
            time.sleep(1)
            body = Analytical(login_web).get_text(Analytical.列表)
            list_1 = Analytical(login_web).process_text(head, body)
            if list_1[0][0] == '暂无数据':
                P_log.info("查询结果为空")
            else:
                P_log.info("*******开始进行结果校验*********")
                assert list_1[2][0] == data['type'] and list_1[3][0] == data[
                    'state']
                R_log.info("{0}用例执行成功".format(data['name']))

        except Exception as e:
            R_log.info("{0}用例执行失败".format(data['name']))
            P_log.error("{0}用例失败原因:{1}".format(data['name'], e))
            Analytical(login_web).save_picture('用例异常截图')
            raise e
Ejemplo n.º 11
0
 def test_query_device(self, login_web):
     self.test_query_device.__func__.__doc__ = E.query_device['dec']
     P_log.info("*******开始执行{0}测试用例******".format(E.query_device['name']))
     First_Page(login_web).select_item('解析管理')
     time.sleep(1)
     try:
         # 获取列表标题头
         head = Analytical(login_web).get_text(Analytical.列表标题)
         Analytical(login_web).input_text(Analytical.请输入设备名称,
                                          E.query_device['device'])
         time.sleep(1)
         Analytical(login_web).click(Analytical.查询按钮)
         # 获取列表正文部分
         body = Analytical(login_web).get_text(Analytical.列表)
         # 得到处理完的页面数据,结构式大列表嵌套
         list_1 = Analytical(login_web).process_text(head, body)
         #判断查询到的设备名称是否是查询输入的设备名称
         P_log.info("*******开始进行结果校验*********")
         assert E.query_device['device'] == list_1[0][0]
         R_log.info("{0}用例执行成功".format(E.query_device['name']))
     except Exception as e:
         R_log.info("{0}用例执行失败".format(E.query_device['name']))
         P_log.error("{0}用例失败原因:{1}".format(E.query_device['name'], e))
         Analytical(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 12
0
 def test_query_reset(self, login_web):
     self.test_query_reset.__func__.__doc__ = E.query_reset['dec']
     P_log.info("*******开始执行{0}测试用例******".format(E.query_reset['name']))
     First_Page(login_web).select_item('解析管理')
     time.sleep(1)
     try:
         head = Analytical(login_web).get_text(Analytical.列表标题)
         Analytical(login_web).input_text(Analytical.请输入设备名称,
                                          E.query_reset['device'])
         time.sleep(1)
         Analytical(login_web).click(Analytical.查询按钮)
         body = Analytical(login_web).get_text(Analytical.列表)
         time.sleep(1)
         Analytical(login_web).click(Analytical.重置按钮)
         time.sleep(2.5)
         body_1 = Analytical(login_web).get_text(Analytical.列表)
         list = Analytical(login_web).process_text(head, body)
         list_1 = Analytical(login_web).process_text(head, body_1)
         #判断标准执行前后的解析列表长度不相等
         P_log.info("*******开始进行结果校验*********")
         assert list != list_1
         R_log.info("{0}用例执行成功".format(E.query_reset['name']))
     except Exception as e:
         R_log.info("{0}用例执行失败".format(E.query_reset['name']))
         P_log.error("{0}用例失败原因:{1}".format(E.query_reset['name'], e))
         Analytical(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 13
0
    def test_modification(self, login_web):
        self.test_modification.__func__.__doc__ = E.button_modification['dec']
        P_log.info("*******开始执行{0}测试用例******".format(
            E.button_modification['name']))
        First_Page(login_web).select_item('解析管理')
        time.sleep(1)
        try:
            head = Analytical(login_web).get_text(Analytical.列表标题)
            Analytical(login_web).input_text(Analytical.请输入设备名称,
                                             E.button_modification['device'])
            time.sleep(2)
            Analytical(login_web).click(Analytical.查询按钮)
            body = Analytical(login_web).get_text(Analytical.列表)
            list_1 = Analytical(login_web).process_text(head, body)
            str = list_1[1][0]
            # 切割字符串返回当前
            t_list = str.split('/')
            if len(t_list) == 4:
                P_log.info('当前设备解析规则为全选')
                Analytical(login_web).click(Analytical.修改)
                time.sleep(2)
                Analytical(login_web).click(Analytical.人脸)
                Analytical(login_web).click(Analytical.人体)
                Analytical(login_web).click(Analytical.批量修改确定)
                time.sleep(5)
                body_1 = Analytical(login_web).get_text(Analytical.列表)
                list_1 = Analytical(login_web).process_text(head, body_1)
                str = list_1[1][0]
                # 切割字符串返回当前
                t_list = str.split('/')
                P_log.info("*******开始进行结果校验*********")
                assert len(t_list) == 2
                R_log.info("{0}用例执行成功".format(E.button_modification['name']))

            else:
                P_log.info('当前设备解析规则为非全选')
                Analytical(login_web).click(Analytical.修改)
                time.sleep(2)
                Analytical(login_web).click(Analytical.人脸)
                Analytical(login_web).click(Analytical.人体)
                Analytical(login_web).click(Analytical.机动车)
                Analytical(login_web).click(Analytical.非机动车)
                Analytical(login_web).click(Analytical.批量修改确定)
                time.sleep(5)
                body_1 = Analytical(login_web).get_text(Analytical.列表)
                list_1 = Analytical(login_web).process_text(head, body_1)
                str = list_1[1][0]
                # 切割字符串返回当前
                t_list = str.split('/')
                P_log.info("*******开始进行结果校验*********")
                assert len(t_list) == 4
                R_log.info("{0}用例执行成功".format(E.button_modification['name']))
        except Exception as e:
            R_log.info("{0}用例执行失败".format(E.button_modification['name']))
            P_log.error("{0}用例失败原因:{1}".format(E.button_modification['name'],
                                               e))
            Analytical(login_web).save_picture('用例异常截图')
            raise e
Ejemplo n.º 14
0
 def test_resource_7days(self, login_web):
     self.test_resource_7days.__func__.__doc__ = T.resource_7days['dec']
     P_log.info("*******开始执行{0}测试用例******".format(T.resource_7days['name']))
     try:
         人脸 = First_Page(login_web).get_text(First_Page.face_number)
         人体 = First_Page(login_web).get_text(First_Page.body_number)
         机动车 = First_Page(login_web).get_text(First_Page.car_number)
         非机动车 = First_Page(login_web).get_text(First_Page.uncar_number)
         P_log.info("资源统计下人脸的数量是:{0}".format(人脸))
         P_log.info("资源统计下人体的数量是:{0}".format(人体))
         P_log.info("资源统计下机动车的数量是:{0}".format(机动车))
         P_log.info("资源统计下非机动车的数量是:{0}".format(非机动车))
         R_log.info("{0}用例执行成功".format(T.resource_7days['name']))
     except Exception as e:
         R_log.info("{0}用例执行失败".format(T.resource_7days['name']))
         P_log.error("{0}用例失败原因:{1}".format(T.resource_7days['name'], e))
         First_Page(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 15
0
    def test_resource_select(self, login_web, data):
        self.test_resource_select.__func__.__doc__ = data['dec']
        P_log.info("*******开始执行{0}测试用例******".format(data['name']))
        try:
            First_Page(login_web).click(First_Page.资源按钮)
            time.sleep(1)
            d = First_Page.__dict__
            # 字典解析式
            dic = {key: d[key] for key in d if "_" not in d}
            First_Page(login_web).click(dic[data['object']])
            #图像比对
            src = First_Page(login_web).save_picture('src')
            time.sleep(1)
            res = G(data['pic']).find_and_check(src)
            assert res

        except Exception as e:
            R_log.info("{0}用例执行失败".format(data['name']))
            P_log.error("{0}用例失败原因:{1}".format(data['name'], e))
            First_Page(login_web).save_picture('用例异常截图')
            raise e
Ejemplo n.º 16
0
 def test_delvideo(self, login_web):  # 删除相机
     First_Page(login_web).manager(3, 'camera')
     P_log.info("*******开始执行删除视频流相机测试用例******")
     Camera(login_web).delvideo(LD.newvideo['devicename'])
     try:
         P_log.info("*******开始执行删除视频流相机测试用例结果校验******")
         assert Camera(login_web).getnodata(
             LD.newvideo['devicename']) == "No Data"
         R_log.info("*******删除视频流相机测试用例执行成功******")
     except Exception as e:
         P_log.info("*******删除视频流相机测试用例执行失败******")
         R_log.info("*******删除视频流相机测试用例执行失败,失败原因{0}******".format(e))
         raise e
Ejemplo n.º 17
0
 def test_freezeuser(self, login_web):
     P_log.info('*******开始执行【冻结用户】测试用例******')
     First_Page(login_web).manager(2, 'user')
     User(login_web).freeze_user()
     try:
         P_log.info("*******开始进行【冻结用户】测试用例结果校验*********")
         assert User(login_web).get_user(7) == '已冻结'
         R_log.info("******【冻结用户】用例执行成功******")
     except Exception as e:
         R_log.info("******【冻结用户】用例执行失败******")
         P_log.error("******【冻结用户】用例失败,失败原因:{0}******".format(e))
         User(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 18
0
 def test_modifycapture_ftp(self, login_web):  #修改智能抓拍机/ftp  修改SN字段
     First_Page(login_web).manager(3, 'camera')
     P_log.info("*******开始执行【编辑ftp智能抓拍机】测试用例******")
     Camera(login_web).modifyftp(LD.newcapture_ftp['devicename'], LD.SN)
     try:
         P_log.info("*******开始执行【编辑ftp智能抓拍机】测试用例结果校验******")
         assert Camera(login_web).getinfo(
             LD.newcapture_ftp['devicename'])[1] == LD.SN  # 设备SN码校验正确
         R_log.info("*******【编辑ftp智能抓拍机】测试用例执行成功******")
     except Exception as e:
         P_log.info("*******【编辑ftp智能抓拍机】测试用例执行失败******")
         R_log.info("*******【编辑ftp智能抓拍机】测试用例执行失败,失败原因{0}******".format(e))
         raise e
Ejemplo n.º 19
0
 def test_all_place(self, login_web):
     self.test_all_place.__func__.__doc__ = E.all_place['dec']
     P_log.info("*******开始执行{0}测试用例******".format(E.all_place['name']))
     try:
         First_Page(login_web).select_item("边缘智能")
         time.sleep(2)
         EdgeIntelligence(login_web).click(EdgeIntelligence.资源按钮)
         time.sleep(1)
         EdgeIntelligence(login_web).click(EdgeIntelligence.全部场所)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(E.all_place['name']))
         P_log.error("{0}用例失败原因:{1}".format(E.all_place['name'], e))
         EdgeIntelligence(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 20
0
 def test_modifyuser(self, login_web):
     P_log.info('*******开始执行【修改用户】测试用例******')
     First_Page(login_web).manager(2, 'user')
     User(login_web).modify_user()
     try:
         P_log.info("*******开始进行【修改用户】测试用例结果校验*********")
         assert User(login_web).get_user(6) == '2022-12-18'
         assert User(login_web).get_user(7) == '已激活'
         R_log.info("******【修改用户】用例执行成功******")
     except Exception as e:
         R_log.info("******【修改用户】用例执行失败******")
         P_log.error("******【修改用户】用例失败,失败原因:{0}******".format(e))
         User(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 21
0
 def test_deluser(self, login_web):
     P_log.info('*******开始执行【删除用户】测试用例******')
     First_Page(login_web).manager(2, 'user')
     User(login_web).del_user()
     try:
         P_log.info("*******开始进行【删除用户】测试用例结果校验*********")
         # sleep(2)
         assert User(login_web).get_user_null() == 'No Data'
         R_log.info('******【删除用户】测试用例执行成功******')
     except Exception as e:
         R_log.info("******【删除用户】用例执行失败******")
         P_log.error("******【删除用户】用例失败,失败原因:{0}******".format(e))
         User(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 22
0
 def test_newuser(self, login_web):
     P_log.info('*******开始执行【新增用户】测试用例******')
     First_Page(login_web).manager(2, 'user')
     User(login_web).add_user(News.newuser['phone'], News.newuser['name'],
                              News.newuser['pwd'], News.newuser['pwd'])
     try:
         P_log.info("*******开始进行【新增用户】测试用例结果校验*********")
         assert User(login_web).get_user(2) == News.newuser['name']
         R_log.info("******【新增用户】用例执行成功******")
     except Exception as e:
         R_log.info("******【新增用户】用例执行失败******")
         P_log.error("******【新增用户】用例失败,失败原因:{0}******".format(e))
         User(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 23
0
 def test_modifyvido(self, login_web):  # 修改视频流相机
     First_Page(login_web).manager(3, 'camera')
     P_log.info("*******开始执行【编辑视频流相机】测试用例******")
     Camera(login_web).modifyvideo(LD.newvideo['devicename'],
                                   LD.newvideo['SN'])
     try:
         P_log.info("*******开始执行【编辑视频流相机】测试用例结果校验******")
         assert Camera(login_web).getinfo(
             LD.newvideo['devicename'])[1] == LD.newvideo['SN']  #设备SN码校验正确
         R_log.info("*******【编辑视频流相机】测试用例执行成功******")
     except Exception as e:
         P_log.info("*******【编辑视频流相机】测试用例执行失败******")
         R_log.info("*******【编辑视频流相机】测试用例执行失败,失败原因{0}******".format(e))
         raise e
Ejemplo n.º 24
0
 def test_fullscreen(self, login_web):
     self.test_fullscreen.__func__.__doc__ = E.full_screen['dec']
     P_log.info("*******开始执行{0}测试用例******".format(E.full_screen['name']))
     try:
         First_Page(login_web).select_item('边缘智能')
         time.sleep(2)
         EdgeIntelligence(login_web).click(EdgeIntelligence.全屏预览)
         time.sleep(1)
         # 判断退出全屏按钮出现在当前的页面中
         assert EC.invisibility_of_element_located(EdgeIntelligence.退出全屏)
     except Exception as e:
         R_log.info("{0}用例执行失败".format(E.full_screen['name']))
         P_log.error("{0}用例失败原因:{1}".format(E.full_screen['name'], e))
         EdgeIntelligence(login_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 25
0
 def test_login_success(self,init_web):
     #动态添加Description中的内容
     self.test_login_success.__func__.__doc__ =LTD.success_data['dec']
     P_log.info("*******开始执行{0}测试用例******".format(LTD.success_data['name']))
     login(init_web).login_system(LTD.success_data['username'],LTD.success_data['pwd'])
     P_log.info("********{0}用例执行完成*******".format(LTD.success_data['name']))
     name = First_Page(init_web).get_login_name()
     try:
         P_log.info("*******开始进行结果校验*********")
         assert name == LTD.success_data['username']
         R_log.info("{0}用例执行成功".format(LTD.success_data['name']))
     except Exception as e:
         R_log.info("{0}用例执行失败".format(LTD.success_data['name']))
         P_log.error("{0}用例失败原因:{1}".format(LTD.success_data['name'],e))
         login(init_web).save_picture('用例异常截图')
         raise e
Ejemplo n.º 26
0
    def test_devices_online(self, login_web):
        self.test_devices_online.__func__.__doc__ = T.devices_online['dec']
        P_log.info("*******开始执行{0}测试用例******".format(T.devices_online['name']))
        try:
            First_Page(login_web).select_laber('设备总览', '在线')
            top_number = First_Page(login_web).get_text(First_Page.top_number)
            视屏流相机在线 = First_Page(login_web).get_text(First_Page.视频流相机在线)
            智能抓拍机在线 = First_Page(login_web).get_text(First_Page.智能抓拍机相机在线)
            GB28181 = First_Page(login_web).get_text(First_Page.GB28181_online)
            视图库在线 = First_Page(login_web).get_text(First_Page.视图库在线)

        except Exception as e:
            R_log.info("{0}用例执行失败".format(T.devices_online['name']))
            P_log.error("{0}用例失败原因:{1}".format(T.devices_online['name'], e))
            First_Page(login_web).save_picture('用例异常截图')
            raise e
Ejemplo n.º 27
0
 def test_newcapture_ga1400(self, login_web):  #新增智能抓拍机/ga1400
     First_Page(login_web).manager(3, 'camera')
     P_log.info("*******开始执行【{0}】测试用例******".format(
         LD.newcapture_ga1400['casename']))
     Camera(login_web).newcapturega1400(LD.newcapture_ga1400['devicename'])
     try:
         P_log.info("*******开始执行【{0}】测试用例结果校验******".format(
             LD.newcapture_private['casename']))
         assert Camera(login_web).getinfo(
             LD.newcapture_ga1400['devicename'])[0] == LD.newcapture_ga1400[
                 'devicename']  # 设备名称校验正确
         R_log.info("*******【{0}】测试用例执行成功******".format(
             LD.newcapture_ga1400['casename']))
     except Exception as e:
         P_log.info("*******【{0}】测试用例执行失败******".format(
             LD.newcapture_ga1400['casename']))
         R_log.info("*******【{0}】测试用例执行失败,失败原因{1}******".format(
             LD.newcapture_ga1400['casename'], e))
Ejemplo n.º 28
0
    def test_newGB(self, login_web):  #新增GB实时
        First_Page(login_web).manager(3, 'camera')
        P_log.info("*******开始执行【{0}】测试用例******".format(LD.newGB['casename']))
        Camera(login_web).newgb(LD.newGB['devicename'])
        try:
            P_log.info("*******开始执行【{0}】测试用例结果校验******".format(
                LD.newGB['casename']))
            assert Camera(login_web).getinfo(
                LD.newGB['devicename'])[0] == LD.newGB[
                    'devicename']  # 设备名称校验正确

            R_log.info("*******【{0}】测试用例执行成功******".format(
                LD.newGB['casename']))
        except Exception as e:
            P_log.info("*******【{0}】测试用例执行失败******".format(
                LD.newGB['casename']))
            R_log.info("*******【{0}】测试用例执行失败,失败原因{1}******".format(
                LD.newGB['casename'], e))
Ejemplo n.º 29
0
 def test_newvideo(self, login_web):  #新增视频流相机
     First_Page(login_web).manager(3, 'camera')
     P_log.info("*******开始执行{0}测试用例******".format(LD.newvideo['casename']))
     Camera(login_web).newvideo(LD.newvideo['devicename'],
                                LD.newvideo['deviceadress'])
     try:
         P_log.info("*******开始执行{0}测试用例结果校验******".format(
             LD.newvideo['casename']))
         assert Camera(login_web).getinfo(
             LD.newvideo['devicename'])[0] == LD.newvideo[
                 'devicename']  #设备名称校验正确
         R_log.info("*******{0}测试用例执行成功******".format(
             LD.newvideo['casename']))
     except Exception as e:
         P_log.info("*******{0}测试用例执行失败******".format(
             LD.newvideo['casename']))
         R_log.info("*******{0}测试用例执行失败,失败原因{1}******".format(
             LD.newvideo['casename'], e))
         raise e
Ejemplo n.º 30
0
 def test_search_outline_device(self, login_web):
     self.test_search_outline_device.__func__.__doc__ = E.search_outline_device[
         'dec']
     P_log.info("*******开始执行{0}测试用例******".format(
         E.search_outline_device['name']))
     try:
         First_Page(login_web).select_item("边缘智能")
         time.sleep(2)
         EdgeIntelligence(login_web).input_text(
             EdgeIntelligence.请输入设备名称, E.search_outline_device['device'])
         device = EdgeIntelligence(login_web).get_text(
             EdgeIntelligence.在线设备标签)
         assert device == E.search_outline_device['device']
     except Exception as e:
         R_log.info("{0}用例执行失败".format(E.search_outline_device['name']))
         P_log.error("{0}用例失败原因:{1}".format(E.search_outline_device['name'],
                                            e))
         EdgeIntelligence(login_web).save_picture('用例异常截图')
         raise e