config.py 3.73 KB
Newer Older
1
#coding:utf-8
2
import os
3

fanxun committed
4 5 6
class BaseConfig():
    """基础配置类"""
    # 请求头
fanxun committed
7
    headers = {'Content-Type': 'application/json'}
8
    # 当前运行的产品名 #auto
taoke committed
9
    current_name = "bmc"
jiaqiying committed
10
    test_case_dir = "test_case/"
fanxun committed
11

12 13
    secs=0.1                    # 测试用例间隔运行时间
    test_redis = {"host": "10.197.236.197", "port": 6379, "password": "123456"}
14
    root_path = os.path.abspath(os.path.dirname(__file__))          # 项目根目录
jiaqiying committed
15

fanxun committed
16 17 18
    # 钉钉相关
    webhook = ''

fanxun committed
19
    # 日志相关
fanxun committed
20
    log_path = r''  # 日志路径
fanxun committed
21

jiaqiying committed
22

23 24
class BMCConfig(BaseConfig):
    """斑马信用app的配置类"""
25 26 27
    # 测试用例目录
    name = "bmc"
    test_case_dir = "test_case/bmc/"
jiaqiying committed
28
    test_case_data_dir = "test_case_data/bmc/"
dengmaosheng committed
29
    bmcphone = "17822000000"  #已激活已有车
dengmaosheng committed
30
    Registerphone = "17822220000"   #未注册用户
31
    NoactivePhone = "17811000000 "  # 未激活用户
dengmaosheng committed
32
    encodedGesture = "67e6d10010533eed4bbe9659863bf6ee"
dengmaosheng committed
33 34 35 36
    bmc_login_url = "http://testbmcapp.hikcreate.com/v1/user/login/gesture"
    bmc_token = ""  #公网加密token
    bmc_pvt_token = ""  #专网token
    host = "http://testbmcapp.hikcreate.com"  #bmc业务所有URL的host
37
    pvthost = "http://testbmcpvtapp.hikcreate.com"
dengmaosheng committed
38
    #bmc除登录外所有的header
39
    headers = {
dengmaosheng committed
40 41 42 43 44 45 46 47 48 49 50
        'City-Code': "520100",
        'Device-Brand': "vivo",
        'Device-Code': "000000001e167ed7000000001e167ed7",
        'Device-Model': "vivo vivo X20",
        'Device-Name': "vivo+X20",
        'Device-Type': "Android",
        'Mac': "38:6E:A2:A0:0E:AF",
        'mimeType': "application/json",
        'Net': "wifi",
        'OS-Type': "Android",
        'OS-Version': "27",
taoke committed
51
        'Pvt-Token': f"{bmc_pvt_token}",
dengmaosheng committed
52
        'Resolution': "2034x1080",
taoke committed
53
        'Token': f"{bmc_token}",
dengmaosheng committed
54
        'Version': "2.2.6"
dengmaosheng committed
55
    }
dengmaosheng committed
56
    #注册和注销专用账号
dengmaosheng committed
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
    loginheader = {
        'City-Code': "520100",
        'Device-Brand': "vivo",
        'Device-Code': "000000001e167ed7000000001e167ed7",
        'Device-Model': "vivo vivo X20",
        'Device-Name': "vivo+X20",
        'Device-Type': "Android",
        'Mac': "38:6E:A2:A0:0E:AF",
        'mimeType': "application/json",
        'Net': "wifi",
        'OS-Type': "Android",
        'OS-Version': "27",
        'Resolution': "2034x1080",
        'Version': "2.2.6"
    }
    logoutheader = {
        'City-Code': "520100",
        'Device-Brand': "vivo",
        'Device-Code': "000000001e167ed7000000001e167ed7",
        'Device-Model': "vivo vivo X20",
        'Device-Name': "vivo+X20",
        'Device-Type': "Android",
        'Mac': "38:6E:A2:A0:0E:AF",
        'mimeType': "application/json",
        'Net': "wifi",
        'OS-Type': "Android",
        'OS-Version': "27",
        'Resolution': "2034x1080",
        'Token': bmc_token,
        'Version': "2.2.6"
    }
jiaqiying committed
88

taoke committed
89 90 91
class BmyConfig(BaseConfig):
    """企业云的配置类"""
    name = "bmy"
jiaqiying committed
92 93
    test_case_dir = "test_case/bmy/"
    test_case_data_dir = "test_case_data/bmy/"
taoke committed
94 95 96 97 98
    # 获取token和密码加密原始密钥
    key = "Jv+h&c0A"
    # 获取token 原始token
    defaultToken = "Basic aHpjcF93ZWI6MTIzNDU2"
    # 测试环境host
99
    test_host = "http://testyun.banmago.com/api"
taoke committed
100
    # 登录账号
taoke committed
101
    test_name_password = {"username": "15151500000", "password": "bmy123456"}
taoke committed
102
    # 企业云接口的Authorization
taoke committed
103
    bmy_token = ''
104
    headers = {"Content-Type":"application/json"}
fanxun committed
105

fanxun committed
106

fanxun committed
107 108
class SSOConfig(BaseConfig):
    """SSO配置类"""
jiaqiying committed
109
    name = "sso"
fanxun committed
110 111 112 113 114
    sso_username = 'robot_fanxun'  # SSO登录名
    sso_password = 'fx123456'  # sso密码
    sso_url = r'http://testtbdzj.hikcreate.com/web/auth/users/login'  # sso登录地址
    sso_salt = 'hikcreate_xj'  # SSO盐值
    sso_token = ''
fanxun committed
115 116
    headers = {'Content-Type': 'application/json',
               'token': sso_token}