Example #1
0
 def test_c011_order_pay(self):
     global log, log_exp, log_act
     log_exp = Logger(logger="服务商平台_预期结果").getlog()
     log_act = Logger(logger="服务商平台_实际结果").getlog()
     log = Logger(logger="服务商平台").getlog()
     try:
         conn = MySQL().connect_order()
         cur = conn.cursor()
         sql = "select sp_order_id,order_id,pay_price from sp_order_info where sp_partner_id=" + spId + " and order_state=0"
         print(sql)
         cur.execute(sql)
         ordering = cur.fetchone()[0:3]
         sp_order_id = ordering[0]
         order_id = ordering[1]
         pay_price = ordering[2]
         url = "http://sp.ejw.cn/order/v1/sp/" + spId + "/order/" + sp_order_id + "/paystageinfo"
         print(url)
         params = {"spEmpId": int(spEmpId), "spEmpName": "蒋涛", "orderId": order_id,
                   "spCusContractUrl": "https://bj.bcebos.com/v1/hnjing-test/d45fdb0150674e5baa969192921ad626.rar",
                   "stages": [{"spOrderStageNo": 1, "payDesc": "aaaa", "payAmount": int(pay_price)}]}
         result_act = requests.post(url, data=json.dumps(params), headers=headers).status_code
         result_exp = 200
         self.assertEqual(result_exp, result_act, msg='接单失败')
         log.info("接单成功")
     except TypeError:
         log.info("没有找到需要接单的订单")
Example #2
0
    def test_a001_fws(self):
        global log, log_exp, log_act
        log = Logger(logger="管理平台").getlog()
        log_exp = Logger(logger="管理平台_预期结果").getlog()
        log_act = Logger(logger="管理平台_实际结果").getlog()
        conn = MySQL().connect_bi()
        cur = conn.cursor()
        sql = "select customer_name from bi_ici_customer_info limit 1000;"
        cur.execute(sql)
        name1 = cur.fetchall()

        conn1 = MySQL().connect_os()
        cur1 = conn1.cursor()
        sql1 = "select partner_name from partner;"
        cur1.execute(sql1)
        name2 = cur.fetchall()
        s = tuple(set(name1) - set(name2))
        partner_name = str(s[0][0])

        # 随机生成社会信用代码
        uscCode_01 = ''.join(
            random.sample(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
                          10))
        uscCode_02 = '43062419'
        uscCode = uscCode_01 + uscCode_02
        paramas = {
            "partner": {
                "partnerType": "0110",
                "partnerName": partner_name,
                "area": "湖南/长沙",
                "address": "麓谷",
                "phone": "0731-86241871",
                "level": 5,
                "detail": "楼主"
            },
            "partnerBusiness": {
                "uscCode": "91431300187402930W",
                "beginDate": "1993-04-13",
                "validDate": "2999-12-31",
                "companyType": "集体所有制",
                "registAddress": "娄底市娄星区洪家洲振兴路(涟钢检修厂旁)",
                "legalPerson": "谢国阳",
                "registAuthority": "娄底市工商行政管理局",
                "approvalDate": "2016-03-28",
                "registStatus": "存续(在营、开业、在册)",
                "registCapital": 303,
                "scope":
                "环保设备设计、制造、安装,铆焊机械零配件加工,拉丝,机电设备安装、维修;工业废料回收开发利用,五金、化工产品(不含专控危险品)、金属材料销售;转运装卸、劳务输出(限涟钢厂内);废油回收加工。软化丝、废钢切割,防腐工程,建筑材料,政策允许的矿产品、金属材料;炉料生产销售。",
                "legalPersonIdcode": uscCode
            },
            "partnerExt": {
                "standardIndustry": "552",
                "category": "44"
            },
            "partnerQualifys": [{
                "qualifyType": 1,
                "qualifyImage":
                "https://bj.bcebos.com/v1/hnjing-test/b5f4b5ed46474606b7c603084fb140cd.jpg",
                "qualifyName": "营业执照",
                "qualifyBeginDate": "1993-04-13",
                "qualifyValidDate": "2999-12-31"
            }, {
                "qualifyType": 2,
                "qualifyImage":
                "https://bj.bcebos.com/v1/hnjing-test/21d5c46b4c7543e59be30d435fa7c9c5.jpg,https://bj.bcebos.com/v1/hnjing-test/8288ec28360f4499a76879ddd3ae5d94.jpg",
                "qualifyName": "法人身份证",
                "qualifyBeginDate": "2018-09-30",
                "qualifyValidDate": "2018-09-30"
            }],
            "employees": {
                "empName": "测试",
                "phone": "15814405932",
                "email": "*****@*****.**"
            }
        }
        url = 'http://admin.ejw.cn/platform/v1/partnerall?curEmpId=' + adminEmpId
        # 发送服务商接口请求
        qykh_test_01 = requests.post(url,
                                     data=json.dumps(paramas),
                                     headers=headers)
        print(qykh_test_01.text)
        result_act = qykh_test_01.status_code
        result_exp = 200
        # 判断当前返回码及字段值
        self.assertEqual(result_exp, result_act, msg='审核原因:已存在相同用户企业或其它参数错误')
        log.info("企业客户管理-合作伙伴管理-服务商新增成功")
Example #3
0
#coding=utf-8
#author='Shichao-Dong'

import time, os
from appium import webdriver
from comm.Log import Logger
from selenium.common.exceptions import WebDriverException
from comm.StartAppiumServer import Sp
from comm.readConfig import ReadConfig

conf = ReadConfig()
log = Logger()

app_path = os.path.join(os.path.abspath(os.path.join(os.getcwd(), "../..")),
                        'UI-Test', 'comm', 'apps', 'cibn.apk')
platformName = conf.get_config('platformName')
appPackage = conf.get_config('appPackage')
appActivity = conf.get_config('appActivity')
appium_port = conf.get_config('appium_port')


class webDriver:
    def __init__(self):
        self.get_device = conf.get_cmd('viewDevices')
        self.get_Version = conf.get_cmd('platformVersion')
        self.startServer = conf.get_cmd('startServer')

    def get_deviceName(self):
        values = os.popen(self.get_device).readlines()
        print(values)
        dev = values[1].split()[0]
Example #4
0
# -*- coding:utf-8 -*-
#@Time  : 2019/8/28 11:11
#@Author: pengjuan

# -*- coding:utf-8 -*-
#@Time  : 2019/8/23 17:52
#@Author: pengjuan

from comm.webDriver import webDriver
import pageElement.firstEnterPage as first_enter
from comm.Log import Logger
import comm.common as common
import time, unittest

driver = webDriver()
logger = Logger().get_logger()


class TestFirstEnterPage(webDriver, unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        pass

    @classmethod
    def tearDownClass(cls):
        pass

    def test_first_enter_page(self):
        """
        用户下载后,首次打开APP
        :return:
Example #5
0
 def test_a003_role_add(self):
     global log, log_exp, log_act
     log_exp = Logger(logger="供应商平台_预期结果").getlog()
     log_act = Logger(logger="供应商平台_实际结果").getlog()
     log = Logger(logger="供应商平台").getlog()
     name_02 = ''.join(random.sample(['a', 'b', 'c', 'd', 'e', '1', '5', '6', 'x', 'aaa'], 6))
     name_01 = '自动化测试角色'
     Name = name_01 + name_02
     # print(Name)
     url = "http://cp.ejw.cn/os/v1/partner/" + cpComId + "/role"
     params = {"roleName": Name, "appName": "cp"}
     # print(params)
     role_code_act = requests.post(url, data=json.dumps(params), headers=headers)
     role_code_exp = 200
     self.assertEqual(role_code_exp, role_code_act.status_code)
     log.info("企业设置-部门及员工管理, 新增角色结果如下:")
     log_exp.info(role_code_exp)
     log_act.info(role_code_act.text)
Example #6
0
 def test_a001_bmyg_serach(self):
     global log, log_exp, log_act
     log_exp = Logger(logger="供应商平台_预期结果").getlog()
     log_act = Logger(logger="供应商平台_实际结果").getlog()
     log = Logger(logger="供应商平台").getlog()
     try:
         conn = MySQL.connect_os()
         cur = conn.cursor()
         sql = "select a.emp_name,b.dep_id from employee a,department b where a.partner_id=b.partner_id and a.emp_id=" + cpEmpId
         cur.execute(sql)
         sql_result = cur.fetchone()[0:2]
         emp_name = sql_result[0]
         dep_id = str(sql_result[1])
         url = "http://cp.ejw.cn/cp/v1/partner/" + cpComId + "/employees?&pageNo=1&pageSize=10&sort=%7B%22gmtCreate%22%3A%22desc%22%7D&curEmpId=" + cpEmpId + "&jobNoOrEmpName=" + emp_name
         result = requests.get(url, headers=headers)
         result_act = result.text
         self.assertIn(emp_name, result_act, msg="没有查询到该用户信息")
         log.info("企业设置-部门员工管理, 已存在的员工信息查询信息如下:")
         log_exp.info(emp_name)
         log_act.info(result_act)
     except TypeError:
         log.info("该企业不存在用户信息")
Example #7
0
 def test_b001_fbcp(self):
     global log, log_exp, log_act
     log_exp = Logger(logger="供应商平台_预期结果").getlog()
     log_act = Logger(logger="供应商平台_实际结果").getlog()
     log = Logger(logger="供应商平台").getlog()
     name_02 = ''.join(random.sample(['a', 'b', 'c', 'd', 'e', '1', '5', '6', 'x'], 6))
     name_01 = '供_自动化测试勿删'
     productName = name_01 + name_02
     # 请求下单功能
     url = "http://cp.ejw.cn/cp/v1/partner/"+cpComId+"/product?curEmpId="+cpEmpId
     parms = {"typeId": 136, "productInfo": "<p>塑料袋</p>",
              "images": "https://bj.bcebos.com/v1/hnjing-test/cb4ef37d38ff46c8bc74fdfc2bed6899.jpg",
              "qualification": "135", "tempStatus": "1", "flowId": 135, "specMinPrice": 0.1, "specMaxPrice": 0.1,
              "cpPartnerName": cpComName, "buyType": "0", "cpCommonAttrInfos": [
             {"cpCommonAttrId": None, "attrFormType": "text", "attrLayerType": "2", "attrIsValid": "1",
              "required": "1", "attrOrder": None, "attrType": "0", "attrValue": "", "fillValue": "颜色标准尺寸",
              "cpCommonAttrName": "域名描述", "isTemp": "1"},
             {"cpCommonAttrId": None, "cpCommonAttrName": "空间", "attrValue": "500M,1G,10G",
              "attrFormType": "checkbox", "attrLayerType": "1", "attrType": "1", "fillValue": "500M", "attrOrder": 2,
              "required": "1", "customAttrValue": "", "isTemp": "1"},
             {"cpCommonAttrId": None, "cpCommonAttrName": "域名", "attrValue": "中文域名,英文域名", "attrFormType": "checkbox",
              "attrLayerType": "1", "attrType": "1", "fillValue": "中文域名", "attrOrder": 1, "required": "1",
              "customAttrValue": "", "isTemp": "1"}], "cpProductName": productName, "productSpecs": [
             {"specSort": 0, "sellPrice": "0.10", "cpProductSpecAttrs": [{"attrValue": "500M", "attrName": "空间"},
                                                                         {"attrValue": "中文域名", "attrName": "域名"}]}]}
     values = json.dumps(parms)
     # 返回状态码信息
     respon_act = requests.post(url, data=values, headers=headers)
     self.assertIn(productName, respon_act.text, msg="参数异常")
     log.info("产品" + productName + "发布结果如下:")
     log_exp.info(productName)
     log_act.info(respon_act.text)
Example #8
0
# 服务商平台
import requests
import random
import json
import unittest
from comm.login import testlogin_001
import readConfig as readConfig
from comm.public_data import MySQL
from comm.Log import Logger
from urllib.parse import quote

localReadConfig = readConfig.ReadConfig()
token = testlogin_001().test_cplogin('token')
log = Logger(logger="供应商平台").getlog()
log_exp = Logger(logger="供应商平台_预期结果").getlog()
log_act = Logger(logger="供应商平台_实际结果").getlog()
# 指定头文件
headers = {
    'Content-Type': 'application/json;charset=UTF-8',
    'token': token
}


class Cpgl_cpsxj(unittest.TestCase):
    # 智营销平台-产品管理-产品名称查询
    def test_b002_cpmc_search(self):
        # 请求下单功能
        headers = {
            'Content-Type': 'application/json;charset=UTF-8',
            'token': token
        }
Example #9
0
 def test_c004_search(self):
     try:
         # 连接到数据库ps1(分支产品库)
         conn = MySQL().connect_ps()
         # 定义一个游标赋值给变量cur,cur才有权限去执行数据库
         cur = conn.cursor()
         # 数据库中查询服务商id为502,审核状态为1的产品
         cur.execute(
             'select sp_product_code from sp_product  where sale_flag = 1 and sp_partner_id = 502 and examine_state = 0')
         spProductCode = str(cur.fetchall()[0][0])
         url_01 = 'http://sp.ejw.cn/platform/v1/product/'
         url = url_01 + spProductCode + '/canel-verify'
         # 发送下架取消接口请求
         result_act = requests.delete(url, headers=headers).text
         # 设置预期设为1
         result_exp = 1
         # 判断实际返回码是否与预期的一致
         self.assertEqual(result_exp, int(result_act))
         print(result_act)
         global log, log_exp, log_act
         log_exp = Logger(logger="服务商平台_预期结果").getlog()
         log_act = Logger(logger="服务商平台_实际结果").getlog()
         log = Logger(logger="服务商平台").getlog()
         log_exp.info(result_exp)
         log_act.info(result_act)
         log.info(spProductCode + "下架审核取消操作成功")
     except LookupError:
         print("没有需要下架的方案数据")
Example #10
0
 def test_a001_role_add(self):
     global log, log_exp, log_act
     log_exp = Logger(logger="服务商平台_预期结果").getlog()
     log_act = Logger(logger="服务商平台_实际结果").getlog()
     log = Logger(logger="服务商平台").getlog()
     # 设置案例名称
     caseName_01 = ''.join(random.sample(['8', '6', '3', '2', '5', '6'], 4))
     caseName_02 = '案例生成'
     caseName = caseName_02 + caseName_01
     url = "http://sp.ejw.cn/mall/v1/classcaseinfo"
     params = {"createUser": createUser, "industryId": 22, "caseName": caseName,
               "caseImage": "http://hnjing-test.bj.bcebos.com/v1/hnjing-test/416e56edd49d453395f99bcac6757777.jpg",
               "caseDesc": "111", "caseDetail": "<p>1111</p>", "salesStatu": "111", "caseState": "2",
               "spId": int(spId)}
     result_act = requests.post(url, data=json.dumps(params), headers=headers).text
     self.assertIn(caseName, result_act, msg="新增案例失败")
     log_exp.info(caseName)
     log_act.info(result_act)
     log.info(caseName + "新增成功")
Example #11
0
 def test_c003_search(self):
     try:
         # 连接到数据库ps1(分支产品库)
         conn = MySQL().connect_ps()
         # 定义一个游标赋值给变量cur,cur才有权限去执行数据库
         cur = conn.cursor()
         # 数据库中查询服务商id为502,审核状态为-1的产品
         cur.execute(
             'select sp_product_code,sp_product_name from sp_product  where sale_flag = 1 and sp_partner_id = 502 and examine_state = -1')
         # 定义查询数据库表中2个字段sp_product_code,sp_product_name
         cur_data = cur.fetchone()[0:2]
         # 第一个字段赋给变量sp_product_code
         spProductCode = str(cur_data[0])
         # 第二个字段赋给变量sp_product_name
         productName = cur_data[1]
         # 打印查询出来的sp_product_code,sp_product_name这2个字段内容
         print(spProductCode, productName)
         # url地址
         url = 'http://sp.ejw.cn/sp/v1/verify-saleflag'
         # 参数信息
         params = {"spPartnerId": 502, "spProductCode": spProductCode, "productType": "group", "verifyType": 2,
                   "createUser": 164,
                   "productName": productName, "partnerName": "竞网自动化勿删"}
         # 发送上架审核接口请求
         result_act = requests.post(url, data=json.dumps(params), headers=headers)
         # 设置预期返回码200
         result_exp = 200
         # 实际返回码
         result_act_act = result_act.status_code
         # 判断实际返回码是否与预期的一致
         self.assertEqual(result_exp, result_act_act)
         global log, log_exp, log_act
         log_exp = Logger(logger="服务商平台_预期结果").getlog()
         log_act = Logger(logger="服务商平台_实际结果").getlog()
         log = Logger(logger="服务商平台").getlog()
         log_exp.info(result_exp)
         log_act.info(result_act_act)
         log.info(productName + "下架提交成功")
     except LookupError:
         print("没有需要下架的方案数据")
Example #12
0
import requests
import unittest
import json
import random
from emp.login_emp import Emp
from comm.public_data import MySQL
from comm.Log import Logger

log = Logger(logger="EMP").getlog()

# 请求头信息
token = Emp().emp_login()
headers = {
    'cache-control': 'no-cache',
    'Host': 'emp.hnjing.com',
    'Connection': 'keep-alive',
    'Accept': 'application/json, text/plain, */*',
    'User-Agent':
    'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3554.0 Safari/537.36',
    'Content-Type': 'application/json',
    'Refere': 'http://emp.hnjing.com/',
    'Accept-Encoding': 'gzip, deflate',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'token': token
}
# 操作员工id
oper_id = 68


class organ01(unittest.TestCase):
    # 系统管理-组织管理-机构管理-新增机构
Example #13
0
    def test_a002_yygl(self):
        global log
        log = Logger(logger="管理平台").getlog()
        name_01 = "湖南天劲制药有限责任公司"
        conn_partner = MySQL().connect_os1('conn')
        cur1 = conn_partner.cursor()
        cur1.execute('select partner_id from partner where partner_name ="' +
                     name_01 + '"')
        par_result = cur1.fetchone()

        if par_result == None:
            # 随机生成社会信用代码
            uscCode_01 = ''.join(
                random.sample(
                    ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 10))
            uscCode_02 = '43062419'
            uscCode = uscCode_01 + uscCode_02
            paramas = {
                "partner": {
                    "partnerType": "0010",
                    "partnerName": name_01,
                    "area": "湖南/长沙",
                    "address": "麓谷",
                    "phone": "0731-86241871",
                    "level": 5,
                    "detail": "楼主"
                },
                "partnerBusiness": {
                    "uscCode": "91431300187402930W",
                    "beginDate": "1993-04-13",
                    "validDate": "2999-12-31",
                    "companyType": "集体所有制",
                    "registAddress": "娄底市娄星区洪家洲振兴路(涟钢检修厂旁)",
                    "legalPerson": "谢国阳",
                    "registAuthority": "娄底市工商行政管理局",
                    "approvalDate": "2016-03-28",
                    "registStatus": "存续(在营、开业、在册)",
                    "registCapital": 303,
                    "scope":
                    "环保设备设计、制造、安装,铆焊机械零配件加工,拉丝,机电设备安装、维修;工业废料回收开发利用,五金、化工产品(不含专控危险品)、金属材料销售;转运装卸、劳务输出(限涟钢厂内);废油回收加工。软化丝、废钢切割,防腐工程,建筑材料,政策允许的矿产品、金属材料;炉料生产销售。",
                    "legalPersonIdcode": uscCode
                },
                "partnerExt": {
                    "standardIndustry": "552",
                    "category": "44"
                },
                "partnerQualifys": [{
                    "qualifyType": 1,
                    "qualifyImage":
                    "https://bj.bcebos.com/v1/hnjing-test/b5f4b5ed46474606b7c603084fb140cd.jpg",
                    "qualifyName": "营业执照",
                    "qualifyBeginDate": "1993-04-13",
                    "qualifyValidDate": "2999-12-31"
                }, {
                    "qualifyType": 2,
                    "qualifyImage":
                    "https://bj.bcebos.com/v1/hnjing-test/21d5c46b4c7543e59be30d435fa7c9c5.jpg,https://bj.bcebos.com/v1/hnjing-test/8288ec28360f4499a76879ddd3ae5d94.jpg",
                    "qualifyName": "法人身份证",
                    "qualifyBeginDate": "2018-09-30",
                    "qualifyValidDate": "2018-09-30"
                }],
                "employees": {
                    "empName": "测试",
                    "phone": "15814405932",
                    "email": "*****@*****.**"
                }
            }
            url = 'http://admin.ejw.cn/platform/v1/partnerall?curEmpId=1699'
            # 发送服务商接口请求
            qykh_test_01 = requests.post(url,
                                         data=json.dumps(paramas),
                                         headers=headers)
            print(qykh_test_01.text)
            result_act = qykh_test_01.status_code
            result_exp = 200
            # 判断当前返回码及字段值
            self.assertEqual(result_exp,
                             result_act,
                             msg='审核原因:已存在相同用户企业或其它参数错误')
            log.info("企业客户管理-合作伙伴管理-供应商新增成功")

        else:
            # 获取partner_id的值
            partner_id = par_result[0]
            name_id = str(partner_id)
            print(name_id)
            # 获取emp_id的值
            cur1.execute('select emp_id from employee where partner_id = "' +
                         name_id + '"')
            results_data_01 = cur1.fetchone()
            # print(results_data_01)
            employee_id = results_data_01[0]
            emp_id = str(employee_id)
            print(emp_id)
            # 删除除长沙艾客美食文化传播有限公司相关联的数据用户信息
            cur1.execute('delete from employee_link_role where emp_id = "' +
                         emp_id + '"')
            cur1.execute('delete from employee where partner_id = "' +
                         name_id + '"')
            cur1.execute('delete from partner_business where partner_id = "' +
                         name_id + '"')
            cur1.execute('delete from partner_ext where partner_id= "' +
                         name_id + '"')
            cur1.execute('delete from partner_qualify where partner_id= "' +
                         name_id + '"')
            cur1.execute('delete from partner where partner_name="' + name_01 +
                         '"')
            conn_partner.commit()
            cur1.close()
            conn_partner.close()
            # 随机生成社会信用代码
            uscCode_01 = ''.join(
                random.sample(
                    ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'], 10))
            uscCode_02 = '43062419'
            uscCode = uscCode_01 + uscCode_02
            paramas = {
                "partner": {
                    "partnerType": "0111",
                    "partnerName": name_01,
                    "area": "湖南/长沙",
                    "address": "麓谷",
                    "phone": "0731-86241871",
                    "level": 5,
                    "detail": "楼主"
                },
                "partnerBusiness": {
                    "uscCode": "91431300187402930W",
                    "beginDate": "1993-04-13",
                    "validDate": "2999-12-31",
                    "companyType": "集体所有制",
                    "registAddress": "娄底市娄星区洪家洲振兴路(涟钢检修厂旁)",
                    "legalPerson": "谢国阳",
                    "registAuthority": "娄底市工商行政管理局",
                    "approvalDate": "2016-03-28",
                    "registStatus": "存续(在营、开业、在册)",
                    "registCapital": 303,
                    "scope":
                    "环保设备设计、制造、安装,铆焊机械零配件加工,拉丝,机电设备安装、维修;工业废料回收开发利用,五金、化工产品(不含专控危险品)、金属材料销售;转运装卸、劳务输出(限涟钢厂内);废油回收加工。软化丝、废钢切割,防腐工程,建筑材料,政策允许的矿产品、金属材料;炉料生产销售。",
                    "legalPersonIdcode": uscCode
                },
                "partnerExt": {
                    "standardIndustry": "552",
                    "category": "44"
                },
                "partnerQualifys": [{
                    "qualifyType": 1,
                    "qualifyImage":
                    "https://bj.bcebos.com/v1/hnjing-test/b5f4b5ed46474606b7c603084fb140cd.jpg",
                    "qualifyName": "营业执照",
                    "qualifyBeginDate": "1993-04-13",
                    "qualifyValidDate": "2999-12-31"
                }, {
                    "qualifyType": 2,
                    "qualifyImage":
                    "https://bj.bcebos.com/v1/hnjing-test/21d5c46b4c7543e59be30d435fa7c9c5.jpg,https://bj.bcebos.com/v1/hnjing-test/8288ec28360f4499a76879ddd3ae5d94.jpg",
                    "qualifyName": "法人身份证",
                    "qualifyBeginDate": "2018-09-30",
                    "qualifyValidDate": "2018-09-30"
                }],
                "employees": {
                    "empName": "测试",
                    "phone": "15814405932",
                    "email": "*****@*****.**"
                }
            }
            url = 'http://admin.ejw.cn/platform/v1/partnerall?curEmpId=1699'
            # 发送服务商接口请求
            qykh_test_01 = requests.post(url,
                                         data=json.dumps(paramas),
                                         headers=headers)
            print(qykh_test_01.text)
            result_act = qykh_test_01.status_code
            result_exp = 200
            # 判断当前返回码及字段值
            # 判断当前返回码及字段值
            self.assertEqual(result_exp,
                             result_act,
                             msg='审核原因:已存在相同用户企业或其它参数错误')
            log.info("企业客户管理-合作伙伴管理-供应商新增成功")
Example #14
0
 def test_a001_search(self):
     global log, log_exp, log_act
     log_exp = Logger(logger="企业平台_预期结果").getlog()
     log_act = Logger(logger="企业平台_实际结果").getlog()
     log = Logger(logger="企业平台").getlog()
     # 设置企业客户名称
     customName_01 = ''.join(random.sample(['1', '2', '3', '4', '5', '6', '7', '8', '9'], 3))
     customName_02 = '企业入驻申请自动化测试'
     customName = customName_02 + customName_01
     url = 'http://auth.ejw.cn/portal/v1/partnerall'
     paramas = {"partner": {"partnerName": customName, "area": "湖南/长沙/岳麓区", "address": "麓谷广场",
                            "phone": "0731-2574155", "organizeType": 1, "status": 0, "detail": ""},
                "partnerExt": {"standardIndustry": "9"},
                "partnerQualify": {
                    "qualifyImage": "https://bj.bcebos.com/v1/hnjing-test/621fe6470e7c469082d5d4cc87363697.jpg?authorization=bce-auth-v1%2Fed6cb82c3c054636aec25bdbc65d7c10%2F2018-11-20T06%3A32%3A03Z%2F-1%2F%2Fcae98671ac479f0dfb7ce7c0cba734c770d1f583fc275424ce2a9f9b41879012"},
                "employee": {"empName": "盛秀玲", "phone": "15074980908", "status": 1, "sex": 1, "userId": 164}}
     # 发送接口请求
     qyrz = requests.post(url, data=json.dumps(paramas), headers=headers)
     # 设置预期的状态码是 200
     result_exp = 200
     # 获取实际返回的状态码
     result_act = qyrz.status_code
     # 判断实际返回的状态码是否与预期设置的状态码相同
     self.assertEqual(result_exp, result_act)
     log_exp.info(customName)
     log_act.info(qyrz.text)
     log.info("企业客户名称为:" + customName)
Example #15
0
    def test_d001_pay(self):
        global log, log_exp, log_act
        log_exp = Logger(logger="企业平台_预期结果").getlog()
        log_act = Logger(logger="企业平台_实际结果").getlog()
        log = Logger(logger="企业平台").getlog()
        try:
            # 获取当前已加入购物车的spid
            conn_mail = MySQL().connect_mall()
            cur_mail = conn_mail.cursor()
            sql = "select sp_id from shoping_info where comp_id =" + cuComId + " and emp_id= " + cuEmpId + " and sp_id=" + spId
            cur_mail.execute(sql)
            result_sql = cur_mail.fetchone()[0:1]
            sp_id = result_sql[0]
            print(sp_id)

            # 查询需要付款的订单
            conn = MySQL().connect_order()
            cur = conn.cursor()
            sql = "select b.sp_order_id,b.sp_order_stage_no from sp_order_info a, pay_stage_info b where a.sp_partner_id=" + sp_id + " and a.sp_order_id=b.sp_order_id and b.pay_state=0;"
            print(sql)
            cur.execute(sql)
            ordering = cur.fetchone()[0:2]
            sp_order_id = str(ordering[0])
            sp_order_stage_no = str(ordering[1])
            url = "http://cu.ejw.cn/order/v1/cu/" + cuComId + "/pay/" + sp_order_id + "/stage/" + sp_order_stage_no
            # print(url)
            params = {"cuPartnerName": "湖南竞网智赢网络技术有限公司", "cuEmpId": int(cuEmpId), "cuEmpName": "竞网企业", "cuAccountPwd": "a123456",
                      "cuEntrustUrl": "", "cuAccountId": "1829615000103289", "cuAccountName": "湖南竞网智赢网络技术有限公司"}
            result_act = requests.post(url, data=json.dumps(params), headers=headers)
            print(result_act.text)
            result_exp = 200
            self.assertEqual(result_exp, result_act.status_code, msg='接单失败')
            log.info("企业后台-订单管理-标准订单管理-付款")
            log_exp.info(result_exp)
            log_act.info(result_act.text)
        except TypeError:
            log.info("没有找到需要付款的订单")