Exemple #1
0
import json
from faker import Factory
from common.myCommon import Assertion
from common.myCommon.TestBaseCase import TestBaseCase
from ymjry.query import xqkj_query
from ymjry.testAction import WebAction
from ymjry.testAction import loginAction
from ymjry.testAction import specialAction

global_dict = loginAction.global_dict
fake = Factory().create('zh_CN')
# 系统用户基本信息
name = loginAction.sign + fake.name_male()
idcard = fake.ssn(min_age=18, max_age=20)
email = loginAction.sign + fake.email()
phone = '131' + fake.ean8()

# 修改用户信息
name3 = loginAction.sign + 'modify' + fake.name_male()
phone3 = '131' + fake.ean8()
email3 = loginAction.sign + fake.email()

# 新增用户测试--非email
name4 = loginAction.sign + 'mail' + fake.name_male()
phone4 = '131' + fake.ean8()
email4 = loginAction.sign + fake.email()

# 新增报表
name_report = fake.name_male() + 'vcvdsfsdfsdfdsfsdfdsfxx报表'
address_report = 'www.baidu.com'
Exemple #2
0
        if obj_name not in obj_name_:
            obj_name_.append(obj_name)
            break
    users.append(User(name, fake.password(), fake.email(), fake.address()))
    objs.append(
        Obj(temp_obj[random.randint(0, 3)], obj_name, random.randint(1, 1000)))
    shops.append(
        Shop(name=name,
             obj_name='None',
             number=random.randint(1, 500),
             status=temp_shop[random.randint(0, 1)]))
#print("INSERT INTO `用户` (`用户名`, `密码`, `邮箱`) VALUES ",end="")

for index in range(30):
    i = random.randint(0, 29)
    id = fake.ean8()
    shops[index].obj_name = objs[i].obj_name
    orders.append(
        Order(id, users[i].name, users[i].address, random.randint(1, 1000),
              temp_order[random.randint(0, 1)]))
    orders_chl.append(Order_chl(id, users[i].name, fake.color_name()))
    pays.append(
        Pay(id, users[random.randint(0, 29)].name,
            temp_pay_en[random.randint(0, 3)], temp_pay[random.randint(0, 1)]))

print("INSERT INTO `商品表` (`分类`, `商品名称`, `商品单价`) VALUES('a','A','1') ", end="")
for each in objs:
    print(",\n('%s','%s','%s')" % (each.sort, each.obj_name, each.obj_pri),
          end="")
print(';\n')
print(
Exemple #3
0
@File       : test_006_sht_audit.py
@desc       : 签约商户审核及后续操作测试用例
"""
import json
from faker import Factory

from common.myCommon import Assertion
from common.myCommon.TestBaseCase import TestBaseCase
from xqkj.query import sht_query
from xqkj.testAction import ShtAction
from xqkj.testAction import loginAction
from xqkj.testAction import Xqkj_web_finance_consumptionAction as PlatformAction


fake = Factory().create('zh_CN')
mobile = '131' + fake.ean8()
idcard = fake.ssn(min_age=18, max_age=100)
name = fake.name()


class test_006_sht_audit(TestBaseCase):
    def test_001_api_78dk_sht_merchant_signing_merchantname_audit_state_pending(self):
        """
        商户名称是否已经在申请中、待审核、资料未完善、被拒绝、已经有存在的商户(审核通过的商户)
        立即签约,手机号正常,商户名称是否已经在申请中(微信申请、后台申请),名字正常
        :return:
        """
        global merchantname
        merchantname = loginAction.global_dict.get("sht_merchantName")
        sht_query.update_wx_merchart_null()
        res = json.loads(ShtAction.test_api_78dk_sht_merchant_signing(signname=name + '1', merchantname=merchantname,
Exemple #4
0
# -*- coding: utf-8 -*-

import json

from faker import Factory

from common.myCommon import Assertion
from common.myCommon.TestBaseCase import TestBaseCase
from common.mydb import MysqlClent
from reborn.testAction import PlatformAction as JtlbasicAction, loginAction

fake = Factory().create('zh_CN')
name = fake.name_male()
name = name + 'test'
idcard = fake.ssn(min_age=18, max_age=20)
phone = fake.ean8()
email = fake.email()
phone = '135' + phone

# 删除用户
name1 = fake.name_male()
name1 = name1 + 'dele'
phone1 = fake.ean8()
email1 = fake.email()
phone1 = '135' + phone1

# 清除用户权限
name2 = fake.name_male()
name2 = name2 + 'clear'
phone2 = fake.ean8()
email2 = fake.email()
Exemple #5
0
@Time       :2019-03-20 下午 3:10
@Author     : 罗林
@File       : loginAction.py
@desc       : 
"""

import requests
import json
from common.myConfig import ConfigUtils as conf
from common.myConfig import MysqlConfig
from common.mydb import MysqlClent
from faker import Factory

fake = Factory().create('zh_CN')
nameadmin = fake.name_male() + 'stream管理员'
phoneadmin = fake.ean8()
emailadmin = fake.email()
phoneadmin = '135' + phoneadmin
DB = MysqlClent.get_conn('192.168.15.129', 3306, 'cgi78dkv23', 'cgi78dk', 'dfljlcl39*33$@e')
# baseUrl = "http://test.jtlservice.78dk.cgi78dkom"
baseUrl = MysqlConfig.get('platform_apiURL', 'reborn')
sign = conf.get('report', 'sign')


def login():
    # 管理员用户
    # 新增用户测试--非email
    url = baseUrl + '/api/78dk/platform/sys/user/login'
    payload = {"email": "*****@*****.**", "password": "******"}
    headers = {'content-type': 'application/json'}
    r = requests.post(url, data=json.dumps(payload), headers=headers)