Exemplo n.º 1
0
def test_order_sign_addOrder(pub_data):
    method = "POST"  # 请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '下单'  # allure报告中二级分类
    title = "全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    headers = {"token": pub_data["token"]}
    s="receiver=wxs1234&ordeerPrice=6000&receiverPhone=13245825656&key=guoya"
    sign = md5_passwd(s,"")
    pub_data["sign"]=sign
    #post请求json数据,注意数据格式为字典或者为json串 为空写None
    json_data = '''
 {
  "ordeerPrice": 1000000000,
  "orderLineList": [
    {
      "qty": 2,
      "skuCode": "${pub_data}"
    }
  ],
  "receiver": "string",
  "receiverPhone": "13245825656",
  "receivingAddress": "string",
  "sign": "${sign}",
  "userName": "******"
}   '''
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers, method=method, url=uri, pub_data=pub_data, json_data=json_data,
                         status_code=status_code, expect=expect, feature=feature, story=story, title=title)
Exemplo n.º 2
0
def test_signbody(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "签名下单模块"  # allure报告中一级分类
    story = '签名加密下单'  # allure报告中二级分类
    title = "全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    # post请求json数据,注意数据格式为字典或者为json串 为空写None
    headers = {"token": pub_data["token"]}
    s = "receiver=xuepl1111&ordeerPrice=1&receiverPhone=15216668455&key=guoya"
    sign=md5_passwd(s,"")
    pub_data["sign"] = sign
    json_data = '''
    {
  "ordeerPrice": "1",
  "orderLineList": [
    {
      "qty": 1,
      "skuCode": "${skuCode}"
    }
  ],
  "receiver": "xuepl1111",
  "receiverPhone": "15216668455",
  "receivingAddress": "安徽省",
  "sign": "${sign}",
  "userName": "******"
}
    '''
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,method=method,url=uri,pub_data=pub_data,json_data=json_data,status_code=status_code,expect=expect,feature=feature,story=story,title=title)
#第一次修改
#第三次修改
Exemplo n.º 3
0
def test_post_order_addOrderSignBody(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = 'Sign'  # allure报告中二级分类
    title = "加密全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    # post请求json数据,注意数据格式为字典或者为json串 为空写None

    headers={"token":"$token"}
    s = "receiver=nanakasu11&ordeerPrice=1888&receiverPhone=18817668777&key=guoya"
    sign = md5_passwd(s,"")
    pub_data["sign"] = sign
    status_code = 200  # 响应状态码
    expect = "2000"  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(method=method,url=uri,pub_data=pub_data,data=data,status_code=status_code,expect=expect,feature=feature,story=story,title=title,headers=headers)
Exemplo n.º 4
0
def test_post_json66(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '数字签字'  # allure报告中二级分类
    title = "数字签字_全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    headers = {"token": "${token}"}
    s = "receiver=lst&ordeerPrice=7000&receiverPhone=18888888888&key=guoya"
    sign = md5_passwd(s, "")
    pub_data["sign"] = sign
    # post请求json数据,注意数据格式为字典或者为json串 为空写None
    json_data = '''
    {
  "ordeerPrice": 7000,
  "orderLineList": [
    {
      "qty": 1,
      "skuCode": "${skuCode}"
    }
  ],
  "receiver": "lst",
  "receiverPhone": "188888888888",
  "receivingAddress": "上海市,闵行区",
  "sign": "${sign}",
  "userName": "******"
}
    '''
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,
                         sign=sign,
                         method=method,
                         url=uri,
                         pub_data=pub_data,
                         json_data=json_data,
                         status_code=status_code,
                         expect=expect,
                         feature=feature,
                         story=story,
                         title=title)
Exemplo n.º 5
0
def test_post_05(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '加密用户下单'  # allure报告中二级分类
    title = "全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    headers = {"token": pub_data["token"]}
    s = "receiver=lianpan&ordeerPrice=30000&receiverPhone=15021749462&key=guoya"
    sign = md5_passwd(s, "")
    pub_data["sign"] = sign
    # post请求json数据,注意数据格式为字典或者为json串 为空写None
    json_data = '''
    {
  "ordeerPrice": 30000,
  "orderLineList": [
    {
      "qty": 1,
      "skuCode": "${skuCode}"
    }
  ],
  "receiver": "lianpan",
  "receiverPhone": "15021749462",
  "receivingAddress": "上海,浦东",
  "sign": "${sign}",
  "userName": "******"
}
    '''
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,
                         method=method,
                         url=uri,
                         pub_data=pub_data,
                         json_data=json_data,
                         status_code=status_code,
                         expect=expect,
                         feature=feature,
                         story=story,
                         title=title)
Exemplo n.º 6
0
def test_order_addOrder_sign(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '无秘下单'  # allure报告中二级分类
    title = "无秘下单_全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    # post请求json数据,注意数据格式为字典或者为json串 为空写None
    headers = {"token": pub_data["token"]}
    s = "receiver=str55585&ordeerPrice=5012&receiverPhone=13681662512&key=guoya"
    sign = md5_passwd(s, key="")
    pub_data["sign"] = sign
    json_data = '''
   {
  "ordeerPrice": 5012,
  "orderLineList": [
    {
      "qty": 1,
      "skuCode":"${skuCode}"
    }
  ],
  "receiver": "str55585",
  "receiverPhone": "13681662512",
  "receivingAddress": "上海浦东新区11路",
   "sign": " pub_data["sign"]",
  "userName": "******"
}
    '''
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,
                         method=method,
                         url=uri,
                         pub_data=pub_data,
                         json_data=json_data,
                         status_code=status_code,
                         expect=expect,
                         feature=feature,
                         story=story,
                         title=title)
Exemplo n.º 7
0
def test_post_json_SignBody(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '数字签名下单'  # allure报告中二级分类
    title = "数字签名下单_全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    headers = {"token": pub_data["token"]}
    s = 'receiver=xuepl&ordeerPrice=12999&receiverPhone=18103909786&key=guoya'
    sign = md5_passwd(s, "")
    pub_data['sign'] = sign
    # post请求json数据,注意数据格式为字典或者为json串 为空写None
    json_data = '''
    {
  "ordeerPrice":12999,
  "orderLineList": [
    {
      "qty": 1,
      "skuCode":"${skuCode}"
    }
  ],
  "receiver": "xuepl",
  "receiverPhone": "18103909786",
  "receivingAddress": "上海,闵行区",
  "sign": "${sign}",
  "userName": "******"
}
    '''
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,
                         method=method,
                         url=uri,
                         pub_data=pub_data,
                         json_data=json_data,
                         status_code=status_code,
                         expect=expect,
                         feature=feature,
                         story=story,
                         title=title)
Exemplo n.º 8
0
def test_add_Order_sign(pub_data):  # 签名下单
    method = "POST"  # 请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '签名下单'  # allure报告中二级分类
    title = "全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    # post请求json数据,注意数据格式为字典或者为json串 为空写None
    s = "receiver=15221818789&ordeerPrice=20000&receiverPhone=15221818789&key=guoya"
    sign = md5_passwd(s, "")
    pub_data["sign"] = sign
    json_data = '''
  {
  "ordeerPrice": 2000
  "orderLineList": [
    {
      "qty": 2,
      "skuCode": "mate30_金桔黄_6寸"
    }
  ],
  "receiver": "15221818789",
  "receiverPhone": "15221818789",
  "receivingAddress": "地球村1号",
  "sign": "${sign}",
  "userName": "******"
}
    '''
    headers = {"token": pub_data["token"]}
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,
                         method=method,
                         url=uri,
                         pub_data=pub_data,
                         json_data=json_data,
                         status_code=status_code,
                         expect=expect,
                         feature=feature,
                         story=story,
                         title=title)
Exemplo n.º 9
0
def test_post_ordeerPrice(pub_data):
    method = "POST"  #请求方法,全部大写
    feature = "订单模块"  # allure报告中一级分类
    story = '签名下单接口'  # allure报告中二级分类
    title = "全字段正常流_1"  # allure报告中用例名字
    uri = "/order/addOrderSignBody"  # 接口地址
    #headers = {"token": pub_data["token"]}
    s = "receiver=15295292396&ordeerPrice=5000&receiverPhone=15295292396&key=guoya"
    sign = md5_passwd(s, "")
    pub_data["sign"] = sign
    # post请求json数据,注意数据格式为字典或者为json串 为空写None

    json_data = {
        "ordeerPrice": 5000,
        "orderLineList": [{
            "qty": 1,
            "skuCode": "ljujj_土豪金_6寸"
        }],
        "receiver": "15295292396",
        "receiverPhone": "15295292396",
        "receivingAddress": "闵行区",
        "sign": "${sign}",
        "userName": "******"
    }
    headers = {"token": pub_data["token"]}
    status_code = 200  # 响应状态码
    expect = ""  # 预期结果
    # --------------------分界线,下边的不要修改-----------------------------------------
    # method,pub_data和url为必传字段
    request_tool.request(headers=headers,
                         method=method,
                         url=uri,
                         pub_data=pub_data,
                         json_data=json_data,
                         status_code=status_code,
                         expect=expect,
                         feature=feature,
                         story=story,
                         title=title)