Exemple #1
0
class YunQianBaoMan(TaskSet):
    def Setups(self):
        pass
    
    def TearDowns(self):
        pass
    def on_start(self):
        self.header ={
            "Connection":"keep-alive",
            "app-type":"android", #android
            "mobile-unid":str(int(round(time.time() * 100000))),
            "app-version":"5.4.91",
            "mobile-type":"HUAWEIALP-TL00(8.0.0)",
            "mobile-system":"android8.0.0",
            "device-tokens": "",  #AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN
            "User-Agent": "Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)",
            "Content-Type":	"application/x-www-form-urlencoded",
        }
        self.apikey="djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh"
        self.sfz_path = "F:/myTestFile/TestObject/YouTime/yunqianbao/static/shenfenzheng.txt"
        self.public_Data = PublicDataClass(self)
        self.login_res = self.public_Data.login(self.apikey,self.header)  #登录
        
        
    # def on_logout(self):
    #     self.public_Data.userLogout(self.apikey,self.header,self.login_res)
        

    @task
    def huoqurenwu(self):
        is_safe = self.public_Data.index(self.apikey,self.header,self.login_res)  #获取首页
Exemple #2
0
class YunQianBaoMan(TaskSet):
    def on_start(self):
        # self.header ={
        #     "Connection":"keep-alive",
        #     "app-type":"android", #android
        #     "mobile-unid":str(int(round(time.time() * 100000))),
        #     "app-version":"5.5.4.1",
        #     "mobile-type":"HUAWEIALP-TL00(8.0.0)",
        #     "mobile-system":"android8.0.0",
        #     "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN",  #
        #     "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)",
        #     "Content-Type":	"application/x-www-form-urlencoded"
        # }
        self.header ={
            "Connection":"keep-alive",
            "app-type":"android", #android
            "mobile-unid":str(int(round(time.time() * 100000))),
            "app-version":"5.5.4.1",
            "mobile-type":"HUAWEIALP-TL00(8.0.0)",
            "mobile-system":"android8.0.0",
            "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN",  #
            "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)",
            "Content-Type":	"application/x-www-form-urlencoded",
            "app-type":"ios",
            "app-version":"5.6.1",
            "device-tokens":"324bf4fa8b6d8c37b98e86f6366833fa9f2b73df648ee83e062b660f0e19ad43",
            "Content-Type":"application/x-www-form-urlencoded",
            "mobile-unid":"c8eb9ab231654cb58a14bd24f9062781",
            "mobile-system":"12.4.8",
            "User-Agent":"(iPhone; iOS 12.4.8; Scale/2.00) YunZhangBen/5.6.1",
            "mobile-type":"iPhone 6"
        }
        self.apikey="djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh"
        # self.sfz_path = "F:/myTestFile/TestObject/YouTime/yunqianbao/static/shenfenzheng.txt"
        self.publicData = PublicDataClass(self)
        self.rmhd = ReMenHuoDong(self)
        self.login_res = self.publicData.login(self.apikey,self.header)  #登录
        
    
    @task            
    def tiJiaoShenQing(self):
        zmgddbres = self.rmhd.recruitingRepresentatives(self.apikey,self.header,self.login_res) #招募股东代表(申请状态)
        if zmgddbres:
            if zmgddbres["sub_status"] == "1": #申请成为股东代表
                self.rmhd.submitApplication(self.apikey,self.header,self.login_res) #提交申请
            elif zmgddbres["sub_status"] == "2": #已提交表决中
                print("已提交表决中")
            elif zmgddbres["sub_status"] == "3":#表决未通过 重新申请
                tjsqres = self.rmhd.ReSubmitApplication(self.apikey,self.header,self.login_res,zmgddbres["applyInfo"]["applyId"])  
            elif zmgddbres["sub_status"] == "8":
                print("邀请好友投票")
            elif zmgddbres["sub_status"] == "10":#已加入其它合作社
                print("已加入其它合作社")
            else:
                print("状态未知===",zmgddbres["sub_status"])
Exemple #3
0
    def userShiMing(self):
        """
            1.登录
            2.首页
            3.实名
            4.实名状态

        """
        publicData = PublicDataClass(self)
        self.login_res = publicData.login(self.apikey,self.header)  #登录
        if self.login_res:
            # is_safe = self.publicData.index(self.apikey,self.header,self.login_res)  #获取首页
            # self.publicData.setMiBao(self.apikey, self.header,self.login_res,is_safe) # 设置密保
            taskdata = publicData.getUserType(self.apikey,self.header,self.login_res) #查看实名状态/获取任务
Exemple #4
0
class YunQianBaoMan(TaskSet):
    def Setups(self):
        pass

    def TearDowns(self):
        pass

    def on_start(self):
        self.header = {
            "Connection": "keep-alive",
            "app-type": "android",  #android
            "mobile-unid": str(int(round(time.time() * 100000))),
            "app-version": "5.4.91",
            "mobile-type": "HUAWEIALP-TL00(8.0.0)",
            "mobile-system": "android8.0.0",
            "device-tokens": "",  #AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN
            "User-Agent":
            "Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)",
            "Content-Type": "application/x-www-form-urlencoded",
        }
        self.apikey = "djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh"
        self.sfz_path = "F:/myTestFile/TestObject/YouTime/yunqianbao/static/shenfenzheng.txt"
        self.public_Data = PublicDataClass(self)
        self.login_res = self.public_Data.login(self.apikey, self.header)  #登录

    def on_logout(self):
        self.public_Data.userLogout(self.apikey, self.header, self.login_res)

    @task
    def huoqurenwu(self):
        is_safe = self.public_Data.index(self.apikey, self.header,
                                         self.login_res)  #获取首页
        self.public_Data.setMiBao(self.apikey, self.header, self.login_res,
                                  is_safe)  # 设置密保
        taskdata = self.public_Data.getUserType(self.apikey, self.header,
                                                self.login_res)  #获取用户实名状态
        if taskdata["type"] == 3:
            print("实名认证信息已提交====待审核===={}".format(self.login_res))
        elif taskdata["type"] == 1:
            self.public_Data.shiMing(self.apikey, self.header, self.login_res,
                                     self.sfz_path)  #实名认证
        else:
            pass
        taskdata = self.public_Data.getUserType(self.apikey, self.header,
                                                self.login_res)  #查询用户实名状态
        if taskdata and taskdata["type"] == 5:
            dqres = self.public_Data.getDangQiId(self.apikey, self.header,
                                                 self.login_res)  #获取当期id
            self.public_Data.comTask(self.apikey, self.header, self.login_res,
                                     dqres["periodId"])  #进入获取任务页
            self.public_Data.getUserType(self.apikey, self.header,
                                         self.login_res)  #实名状态
            queryRes = self.public_Data.queryPaymentPassword(
                self.apikey, self.header, self.login_res)  #查询用户是否设置了交易密码
            if not queryRes["paypwd_set"]:
                self.public_Data.setPaymentPassword(self.apikey, self.header,
                                                    self.login_res)  #设置支付密码
            money = self.public_Data.selectGoldShares(self.apikey, self.header,
                                                      self.login_res)  #查询账户余额
            if money:
                self.public_Data.paymentTaskMoney(self.apikey, self.header,
                                                  self.login_res)  #支付任务押金