Пример #1
0
    def test_add_entrust(self, case):
        a = json.loads(case["body"])
        if len(a["caseId"]) == 0:
            case["headers"] = self.header
            a["targetTime"] = get_date.GetDate().get_tomorrow_date()
            b = json.dumps(a)
            case.update({"body": b})
        else:
            a["caseId"] = self.caseid
            case["headers"] = self.header
            a["targetTime"] = get_date.GetDate().get_tomorrow_date()
            b = json.dumps(a)
            case.update({"body": b})

        res = base_api.send_requests(self.s, case)

        # 检查点 checkpoint
        check = case["checkpoint"]  #获取检查点中的内容
        check = json.loads(check)  #字符串转为字典
        print("检查点->:%s" % check)

        # 返回结果
        res_text = res["text"]  #获取响应的内容
        res_text = json.loads(res_text)  #将响应的内容转换为字典
        print("返回实际结果->:%s" % res_text)

        # 断言

        if "errMsg" not in res_text.keys():
            self.assertEqual(check.get("errCode"), res_text["errCode"])
        else:
            self.assertEqual(check.get("errCode"), res_text["errCode"])
            self.assertEqual(check.get("errMsg"), res_text["errMsg"])
    def test_PerformanceAssessmentCountList(self, case):
        case["headers"] = self.header
        dic_body = json.loads(case["body"])
        dic_body["assessmentMonth"] = get_date.GetDate().get_local_month()
        str_body = json.dumps(dic_body)
        case.update({"body": str_body})

        res = base_api.send_requests(self.s, case)

        # 检查点 checkpoint
        check = case["checkpoint"]  # 获取检查点中的内容
        check = json.loads(check)  # 字符串转为字典
        print("检查点->:%s" % check)

        # 返回结果
        res_text = res["text"]  # 获取响应的内容
        res_text = json.loads(res_text)  # 将响应的内容转换为字典
        print("返回实际结果->:%s" % res_text)
        lst_user = []
        lst_type = []
        for i in res_text["data"]["dataList"]:
            lst_user.append(i["userPosition"])
            lst_type.append(i["checkType"])

        # 断言
        self.assertEqual(check.get("userPosition"), list(set(lst_user))[0])
        self.assertEqual(check.get("checkType"), list(set(lst_type))[0])
Пример #3
0
    def test_create_rent_customer_zanhuan_trackInfo(self, data):
        a = json.loads(data["body"])
        if "targetTime" in a.keys():
            data["headers"] = self.headers
            # 将caseid重新写入excel中
            a["caseId"] = self.caseid
            a["targetTime"] = get_date.GetDate().get_zanhuan_date()
            b = json.dumps(a)
            data.update({"body": b})
        else:
            data["headers"] = self.headers
            # 将caseid重新写入excel中
            a["caseId"] = self.caseid
            b = json.dumps(a)
            data.update({"body": b})

        res = base_api.send_requests(self.s, data)

        # 检查点 checkpoint
        check = data["checkpoint"]  # 获取检查点中的内容
        check = json.loads(check)  # json字符串转为字典
        print("检查点->:%s" % check)

        # 返回结果
        res_text = res["text"]  # 获取响应的内容
        res_text = json.loads(res_text)  # 将响应的内容转换为字典
        print("返回实际结果->:%s" % res_text)

        # 断言
        if "errMsg" not in res_text.keys():
            self.assertEqual(check.get("errCode"), res_text["errCode"])
        else:
            self.assertEqual(check.get("errCode"), res_text["errCode"])
            self.assertEqual(check.get("errMsg"), res_text["errMsg"])
Пример #4
0
 def create_transaction_deal(self):
     self.s = requests.session()
     # 登记出售房源并获取房源id
     self.sale_caseid, self.sale_no = HouseManage.HouseManage(
     ).get_saleHouse_caseNo()
     # 登记求购客源并获取id
     self.caseid, self.header = CustomerManage.CustomerManage(
     ).create_BuyCustomer()
     # 获取出售中未使用的合同编号
     self.codeNo, self.headers = CustomerManage.CustomerManage(
     ).get_buyMatchNotAllocatedDealCode()
     # 读取出excel中的测试数据
     case = readexcel.ExcelUtil(CUSTOMER_MANAGE_EXCEL_PATH,
                                sheetName="客源管理-求购-新增合同").dict_data()[1]
     print(case)
     a = json.loads(case["body"])
     case["headers"] = self.headers
     a["custId"] = self.caseid
     a["dealCustomerId"] = self.caseid
     a["signDate"] = get_date.GetDate().get_today_str_data()
     a["contractNo"] = self.codeNo
     a["dealHouseId"] = self.sale_caseid
     a["dealHouseNo"] = self.sale_no
     b = json.dumps(a)
     case.update({"body": b})
     res = base_api.send_requests(self.s, case)
     res_text = json.loads(res["text"])
     return res_text["data"][
         "dealId"], self.headers, self.sale_caseid, self.caseid
    def test_insertContract_rentCustomer(self, case):
        a = json.loads(case["body"])
        if "dealHouseId" not in a.keys():
            case["headers"] = self.headers
            a["custId"] = self.caseid
            a["dealCustomerId"] = self.caseid
            a["rentDate"] = get_date.GetDate().get_today_str_data()
            a["rentOverDate"] = get_date.GetDate().get_zanhuan_date()
            a["contractNo"] = self.codeNo
            b = json.dumps(a)
            case.update({"body": b})
        else:
            case["headers"] = self.headers
            a["custId"] = self.caseid
            a["dealCustomerId"] = self.caseid
            a["signDate"] = get_date.GetDate().get_today_str_data()
            a["rentOverDate"] = get_date.GetDate().get_zanhuan_date()
            a["contractNo"] = self.codeNo
            a["dealHouseId"] = self.lease_caseid
            a["houseId"] = self.lease_caseid

            b = json.dumps(a)
            case.update({"body": b})

        res = base_api.send_requests(self.s, case)

        # 检查点 checkpoint
        check = case["checkpoint"]  #获取检查点中的内容
        check = json.loads(check)  #json字符串转为字典
        print("检查点->:%s" % check)

        # 返回结果
        res_text = res["text"]  #获取响应的内容
        res_text = json.loads(res_text)  #将响应的内容转换为字典
        print("返回实际结果->:%s" % res_text)

        # 断言
        if "errMsg" not in res_text.keys():
            self.assertEqual(check.get("errCode"), res_text["errCode"])
        else:
            self.assertEqual(check.get("errCode"), res_text["errCode"])
            self.assertEqual(check.get("errMsg"), res_text["errMsg"])
Пример #6
0
 def create_yuDing(self, caseid):
     headers = add_clientkey_to_headers.get_clientkey()
     url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
     data = {
         "caseId": caseid,
         "caseType": "1",
         "targetTime": get_date.GetDate().get_fengpan_date(),
         "trackType": "25",
         "trackContent": "该出售的房源已被客户预定了"
     }
     requests.post(url, json=data, headers=headers)
     return caseid
Пример #7
0
 def create_zanHuan(self, caseid):
     headers = add_clientkey_to_headers.get_clientkey()
     url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
     data = {
         "caseId": caseid,
         "caseType": "1",
         "targetTime": get_date.GetDate().get_zanhuan_date(),
         "trackType": "27",
         "trackContent": "业主在外地,近期无法带看"
     }
     requests.post(url, json=data, headers=headers)
     return caseid
Пример #8
0
    def test_getDragonTigerProfitReport(self, case):
        case["headers"]=self.header
        a = json.loads(case["body"])
        a["endTime"] =get_date.GetDate().get_local_month()
        a["startTime"]=get_date.GetDate().get_local_month()
        b = json.dumps(a)
        case.update({"body": b})

        res = base_api.send_requests(self.s,case)

        # 检查点 checkpoint
        check = case["checkpoint"]  #获取检查点中的内容
        check=json.loads(check)         #字符串转为字典
        print("检查点->:%s" % check)

        # 返回结果
        res_text = res["text"]          #获取响应的内容
        res_text=json.loads(res_text)   #将响应的内容转换为字典
        print("返回实际结果->:%s"%res_text)

        # 断言
        self.assertIn(check.get("dimension"),res_text["data"].values())
        self.assertEqual(check.get("errCode"),res_text["errCode"])
Пример #9
0
    def test_add_attendance_group(self, case):
        case["headers"] = self.header
        body_dic_data=json.loads(case["body"])
        str_data = body_dic_data["attendanceScheduleList"]
        dic_data = (json.loads(str_data))[0]     #将字符串转化为字典,并组装成了列表后取第一个元素

        dic_data["attClassId"]=str(self.data_id)
        dic_data["attTime"]=get_date.GetDate().get_tomorrow_data_time_hourse()
        lst=[]    # 创建一个空列表,用于存放字典
        lst.append(dic_data)
        b=json.dumps(lst)
        body_dic_data.update({"attendanceScheduleList":b})

        a=json.dumps(body_dic_data)
        case.update({"body": a})

        res = base_api.send_requests(self.s,case)

        # 检查点 checkpoint
        check = case["checkpoint"]      #获取检查点中的内容
        check=json.loads(check)         #字符串转为字典
        print("检查点->:%s" % check)

        # 返回结果
        res_text = res["text"]          #获取响应的内容
        res_text=json.loads(res_text)   #将响应的内容转换为字典
        print("返回实际结果->:%s"%res_text)
        self.res_text = res_text
        if "data" in check.keys():
            check["data"]=res_text["data"]    # 将返回的data写入到检测点中去,方便后面的断言
            self.data = check["data"]
            # 断言
            if "data" in res_text.keys():
                self.assertEqual(check.get("data"), res_text["data"])
                self.assertEqual(check.get("errCode"), res_text["errCode"])
        else:
            self.assertEqual(check.get("errMsg"), res_text["errMsg"])
            self.assertEqual(check.get("errCode"), res_text["errCode"])
Пример #10
0
    def test_create_buyCustomer_trackInfo_yuekan(self):
        url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
        headers = self.headers
        data = {
            "caseId": self.caseid,
            "caseType": "3",
            "houseIds": self.saleHouse_caseid,
            "lookType": "0",
            "targetTime": get_date.GetDate().get_tomorrow_date_time("13:00"),
            "trackTag": "",
            "trackType": "68"
        }
        res = requests.post(url, json=data, headers=headers)

        # 检查点
        check = res.json()  # 获取检查点中的内容
        print("返回实际结果->:%s" % check)

        self.makeLookId = check["data"]["makeLookId"]
        print("约看id:%s" % (self.makeLookId))
        # 断言
        self.assertEqual(200, check["errCode"])

        # 求购客源带看
        url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
        headers = self.headers
        datas = {
            "caseId":
            self.caseid,
            "caseType":
            "3",
            "daiKanHouseList": [{
                "lookType": "0",
                "makeLookId": self.makeLookId,
                "targetId": self.saleHouse_caseid,
                "trackContent": "123456"
            }],
            "isImmediate":
            "0",
            "targetType":
            "1",
            "trackType":
            "4",
            "userIds":
            "20174961",
            "userNames":
            "张小林"
        }

        r = requests.post(url, json=datas, headers=headers)

        # 检查点
        check = r.json()  # 将返回值转换成字典数据类型
        print("带看后返回实际结果->:%s" % check)
        # 断言
        self.assertEqual(200, check["errCode"])

        #求购客源面谈
        url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
        headers = self.headers
        data = {
            "caseId": self.caseid,
            "caseType": "3",
            "trackContent": "客户已锁定意向房源,决策中",
            "trackType": "2"
        }
        rs = requests.post(url, json=data, headers=headers)
        checks = rs.json()
        print("面谈后返回实际结果->:%s" % checks)
        # 断言
        self.assertEqual(200, checks["errCode"])

        #求购客源预定
        url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
        headers = self.headers
        data = {
            "caseId": self.caseid,
            "caseType": "3",
            "targetTime": get_date.GetDate().get_fengpan_date(),
            "trackContent": "客户意向强烈,已进入预定阶段",
            "trackType": "25"
        }
        rs = requests.post(url, json=data, headers=headers)
        checks = rs.json()
        print("客源预定后返回实际结果->:%s" % checks)
        # 断言
        self.assertEqual(200, checks["errCode"])