Exemplo n.º 1
0
 def testerpuserlist(self, data):
     '''后台巡检管理:  工单指派人员列表/check/fault/erpuserlist'''
     # 巡检管理 工单指派人员列表
     res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                     data=data['erpuserlist'],
                                     desc=data['Desc'],
                                     url=data['Url'],
                                     instance_pro='post')
     # 断言
     self.assertEqual(res['code'], 0, res['msg'])  # 断言
Exemplo n.º 2
0
    def testadd(self, data):
        '''游戏管理接口:新添加游戏#/project/game/add'''

        # 新添加游戏
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        instance_pro='post',
                                        data=data['Add'],
                                        desc=data['Desc'],
                                        url=data['Url'])
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 3
0
    def testgetlist(self, data):
        '''游戏管理接口:查询游戏详情#/project/game/getlist'''

        # 查询游戏详情
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['Detail'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 4
0
    def testdetail(self, data):
        '''项目管理接口:查看商品详细#/project/goods/detail'''

        # 查看商品详细
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['Detail'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 5
0
    def testdetail(self, data):
        '''后台巡检管理:  查看人员详情/check/user/detail'''

        #巡检管理 查看人员详情
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['detail'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])  #断言
Exemplo n.º 6
0
    def testlist(self, data):
        '''项目管理接口:查询商品列表#/project/goods/list'''

        #查询商品列表
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['List'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])  #断言
Exemplo n.º 7
0
    def testdetail(self, data):
        '''点位管理接口:查看点位详细#/machine/locale/detail'''

        # 查看点位详细
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['Detail'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 8
0
    def testgetlist(self, data):
        '''渠道管理接口:查询渠道列表不分页#/project/channel1/getlist'''

        # 查询渠道列表不分页
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['GetList'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 9
0
    def testupdate(self, data):
        '''渠道管理接口:更新渠道信息#/project/channel1/update'''

        # 更新渠道信息
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['Updata'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 10
0
    def testgetlist(self, data):
        '''点位管理接口:查询点位列表不分页#/machine/locale/getlist'''

        # 查询点位列表不分页
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['GetList'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 11
0
    def testlistyuser(self, data):
        '''后台巡检管理:  故障类型列表/check/user/listyuser'''

        # 巡检管理 故障类型列表
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['listyuser'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        # 断言
        self.assertEqual(res['code'], 0, res['msg'])  # 断言
Exemplo n.º 12
0
    def testgetmachine(self, data):
        '''后台巡检管理:  查看机器/check/user/getUserMachinDetailList'''

        #巡检管理 人员列表
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['getmachine'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])  #断言
Exemplo n.º 13
0
    def testselectmachines(self, data):
        '''后台巡检管理:  选择机器/check/user/selectmachines'''

        # 巡检管理 选择机器
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['selectmachines'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        # 断言
        self.assertEqual(res['code'], 0, res['msg'])  # 断言
Exemplo n.º 14
0
    def testupdatastatus(self, data):
        '''后台巡检管理:  更新人员状态/check/user/updateStatus'''

        #巡检管理 查看人员详情
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['updatastatus'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])  #断言
Exemplo n.º 15
0
    def testupdate(self, data):
        '''点位管理接口:更新点位信息#/machine/locale/update'''

        # 更新点位信息
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['Updata'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 16
0
 def testupstatus(self, data):
     '''机器后台管理接口:更改机器状态#/machine/updateMachineStatus'''
     upstatusdata = json.dumps(data['upstatus'])
     upstatusnew = encrypt.jiami(upstatusdata)
     # 更改机器状态
     res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                     data=upstatusnew,
                                     desc=data['Desc'],
                                     url=data['Url'],
                                     instance_pro='post')
     res2 = json.loads(decrypt.jiemi(res))
     self.assertEqual(res2['code'], 0)  #断言
Exemplo n.º 17
0
 def testgetstatus(self, data):
     '''机器后台管理接口:获取机器状态#/machine/getMachineStatus'''
     getstatusdata = json.dumps(data['getstatus'])
     getstatusnew = encrypt.jiami(getstatusdata)
     # 获取机器状态
     res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                     instance_pro='post',
                                     data=getstatusnew,
                                     desc=data['Desc'],
                                     url=data['Url'])
     res2 = json.loads(decrypt.jiemi(res))
     self.assertEqual(res2['code'], 0)  #断言
Exemplo n.º 18
0
    def testgetapp(self, data):
        '''机器后台管理接口:获取机器上app#/app/getAppByBlong'''
        getappdata = json.dumps(data['getapp'])
        getappnew = encrypt.jiami(getappdata)
        # 获取机器上app
        res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                        data=getappnew,
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')

        res2 = json.loads(decrypt.jiemi(res))
        self.assertEqual(res2['code'], 0)  #断言
Exemplo n.º 19
0
    def testdetele(self,data):
        '''活动排期管理接口:删除活动排期信息#/project/activityPlan/delete'''

        # 删除活动排期
        res = scripts.loadtestInterface(
            instance=HttpWebRequest(),
            data=data['detele'],
            desc=data['Desc'],
            url=data['Url'],
            instance_pro='post'
        )
        #断言
        self.assertEqual(res['code'],0,res['msg'])
Exemplo n.º 20
0
 def testsave(self, data):
     '''后台巡检管理:  新增工单/check/fault/save'''
     b = data['save']['remark']
     newcode = b + str(scripts.sjshu())
     data['save']['remark'] = newcode
     # 巡检管理 更新类型
     res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                     data=data['save'],
                                     desc=data['Desc'],
                                     url=data['Url'],
                                     instance_pro='post')
     # 断言
     self.assertEqual(res['code'], 0, res['msg'])  # 断言
Exemplo n.º 21
0
 def testudpatafault(self, data):
     '''后台巡检管理:  更新类型/check/faultType/udpatafault'''
     b = data['udpatafault']['name']
     newcode = b + str(scripts.sjshu())
     data['udpatafault']['name'] = newcode
     # 巡检管理 更新类型
     res = scripts.loadtestInterface(instance=HttpWebRequests(),
                                     data=json.dumps(data['udpatafault']),
                                     desc=data['Desc'],
                                     url=data['Url'],
                                     instance_pro='post')
     # 断言
     self.assertEqual(res['code'], 0, res['msg'])  # 断言
Exemplo n.º 22
0
    def testgetlist(self,data):
        '''活动排期管理接口:查询活动排期不分页#/project/activityPlan/planMachineDetailList'''

        # 查询活动排期列表不分页
        res = scripts.loadtestInterface(
            instance=HttpWebRequest(),
            data=data['GetList'],
            desc=data['Desc'],
            url=data['Url'],
            instance_pro='post'
        )
        #断言
        self.assertEqual(res['code'],0,res['msg'])
Exemplo n.º 23
0
    def testgetlocale(self, data):
        '''机器后台管理接口:获取机器点位#/machine/getMachineLocale'''
        getlocaledata = json.dumps(data['getlocale'])
        getloaclenew = encrypt.jiami(getlocaledata)
        # 获取机器点位
        res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                        data=getloaclenew,
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')

        res2 = json.loads(decrypt.jiemi(res))
        self.assertEqual(res2['code'], 0)  #断言
Exemplo n.º 24
0
 def testgetid(self, data):
     '''机器后台管理接口:获取机器ID#/machine/generateMachineId'''
     getiddata = json.dumps(data['getid'])
     getidnew = encrypt.jiami(getiddata)
     # 获取机器ID
     res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                     data=getidnew,
                                     desc=data['Desc'],
                                     url=data['Url'],
                                     instance_pro='post')
     #断言
     res2 = json.loads(decrypt.jiemi(res))
     self.assertEqual(res2['code'], 0)  #断言
Exemplo n.º 25
0
    def testupdate(self,data):
        '''活动排期管理接口:更新活动排期信息#/project/activityPlan/update'''

        # 更新活动排期信息
        res = scripts.loadtestInterface(
            instance=HttpWebRequests(),
            #data = '{"activityId":"8c9d37f5481d42d08d0221a4119bc5c2","activityName":"自动化测试活动08","startTimeStr":"2018-08-10 15:04","endTimeStr":"2018-08-31 15:04","gameId":"8cbd9bad1829454c8672f97ff531385d","userMaxTimes":"10000","dayUserMaxTimes":"10000","goods":[{"key":0,"name":"自动化测试","prizeId":"9a6d230c5e1643caa8ead174f3fe059e","prizeType":"1","resultCode":1,"resultRemark":"挑战成功掉货"},{"key":1,"name":"自动化测试","prizeId":"9a6d230c5e1643caa8ead174f3fe059e","prizeType":"1","resultCode":2,"resultRemark":"挑战成功掉货更新"}],"coupons":[],"machines":[{"machineCode":"18205961","machineId":"c67742623b7d492a84ea88be206c6708","state":0}],"id":"849790f5f8424e5ca0d5e3bf46170b72"}',
            data = json.dumps(data['Updata']),
            desc=data['Desc'],
            url=data['Url'],
            instance_pro='post'
        )
        #断言
        self.assertEqual(res['code'],0,res['msg'])
Exemplo n.º 26
0
    def testdetele(self, data):
        '''渠道管理接口:删除渠道信息#/project/channel1/delete'''

        # 删除渠道
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['detele'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])

        @classmethod
        def tearDownClass(cls):
            pass
Exemplo n.º 27
0
 def testadd(self, data):
     '''项目管理接口:新添加商品#/project/goods/add'''
     b = data['Add']['code']
     print b
     newcode = b + str(scripts.sjshu())
     print newcode
     data['Add']['code'] = newcode
     # 新添加商品
     res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                     instance_pro='post',
                                     data=data['Add'],
                                     desc=data['Desc'],
                                     url=data['Url'])
     #断言
     self.assertEqual(res['code'], 0, res['msg'])
Exemplo n.º 28
0
    def testdetele(self, data):
        '''点位管理接口:删除点位信息#/machine/locale/delete'''

        # 更新点位信息
        res = scripts.loadtestInterface(instance=HttpWebRequest(),
                                        data=data['detele'],
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        self.assertEqual(res['code'], 0, res['msg'])

        @classmethod
        def tearDownClass(cls):
            pass
Exemplo n.º 29
0
    def testint(self, data):
        '''机器后台管理接口:初始化机器#/machine/initMachine'''
        intdata = json.dumps(data['int'])
        intnew = encrypt.jiami(intdata)

        #初始化机器
        res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                        data=intnew,
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        #断言
        # print res
        res2 = json.loads(decrypt.jiemi(res))
        self.assertEqual(res2['code'], 0)  #断言
Exemplo n.º 30
0
    def testsetchannel(self, data):
        '''机器后台管理接口:合并拆分货道#//machine/setMachineChannel'''
        setchanneldata = json.dumps(data['setchannel'])
        setchannelnew = encrypt.jiami(setchanneldata)
        # 合并拆分货道
        res = scripts.loadtestInterface(instance=HttpWebRequestss(),
                                        data=setchannelnew,
                                        desc=data['Desc'],
                                        url=data['Url'],
                                        instance_pro='post')
        res2 = json.loads(decrypt.jiemi(res))
        self.assertEqual(res2['code'], 0)  #断言

        @classmethod
        def tearDownClass(cls):
            pass