作者 bianxinhua

add README

... ... @@ -30,7 +30,7 @@ request:
serial: ${get_serialNo()}
customerValue:
- 31
taskCharacter: 12
taskCharactor: 12
reward: 2000
acceptanceCriteria: $acceptanceCriteria
description: $description
... ...
name: 关闭任务
base_url: ${ENV(base_worth_url)}
verify: False
variables:
id: ${get_loot_task_id()}
reason: 测试关闭任务${get_nowtime()}
msg: ok
request:
headers:
Content-Type: application/json; charset=UTF-8
Authorization: Bearer ${get_task_Authorization()}
Origin: https://value-test.fjmaimaimai.com
Referer: https://value-test.fjmaimaimai.com/
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36
X-Requested-With: XMLHttpRequest
json:
id: $id
reason: $reason
method: POST
url: task/close
validate:
- eq:
- content.code
- 0
- eq:
- content.msg
- $msg
\ No newline at end of file
... ...
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtYnVzaW5lc3MtYWRtaW4tZ2F0ZXdheS10ZXN0LmZqbWFpbWFpbWFpLmNvbVwvYXV0aFwvcHdkTG9naW4iLCJpYXQiOjE1OTkwMzQ4OTMsImV4cCI6MTU5OTA0NTY5MywibmJmIjoxNTk5MDM0ODkzLCJqdGkiOiJVa3RuY0U2T3k1RDk0c250Iiwic3ViIjozMjQ4ODE3NjEzNjgxNjY0LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIiwiY29tcGFueUlkIjozNjYsIm5pY2tuYW1lIjoiXHU4Yzc5XHU1YjUwXHU1OTM0IiwicGhvbmUiOiIxOTk5MDAwMDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.D_WMnRvJui4cg5dmnTxUDrgz6W1jw4y5T8wOdnfBIqQ
\ No newline at end of file
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUz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MDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.tkoNNuALbJhZy7By1GohDSW4pb3LVIx0V1NVSakAdwU
\ No newline at end of file
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtYnVzaW5lc3MtYWRtaW4tZ2F0ZXdheS10ZXN0LmZqbWFpbWFpbWFpLmNvbVwvYXV0aFwvYW5vbnltb3VzTG9naW4iLCJpYXQiOjE1OTkxMTc5ODAsImV4cCI6MTU5OTEyODc4MCwibmJmIjoxNTk5MTE3OTgwLCJqdGkiOiJhRXlHZWNVaEkzZ3l2Z0V3Iiwic3ViIjozMjQ4ODE3NjEzNjgxNjY0LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIiwiY29tcGFueUlkIjozNjYsIm5pY2tuYW1lIjoiXHU4Yzc5XHU1YjUwXHU1OTM0IiwicGhvbmUiOiIxOTk5MDAwMDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.rt3wdIr2YFcYjZjpXuBCqqYSfL8ia_ofS29CtzZl5Fg
\ No newline at end of file
... ...
jwbedlg4b0n
\ No newline at end of file
ysbfuexqbrb
\ No newline at end of file
... ...
3039444006263587840
\ No newline at end of file
... ...
57276bc0f85217d57aac66c76c540ecf693b5eaa4d972e421f53bea3b526c63b7db79386
\ No newline at end of file
1ad12e2680e7833bf77feaa9bb1f02e66b1b6aa17b13c019420f864cf34b520fac9956e0
\ No newline at end of file
... ...
3679205383782400
\ No newline at end of file
3679205371953152
\ No newline at end of file
... ...
KdQYph4cXCd0ZIUPvpnlFnFX3bXM1BbbYDK7ggdolQF/W4pdas9QauY54nYH6tqiSmUpHXvIo7Le65l3zfGhrFk07OW9H3IrqCSrCwSssV68XNsiPLauiZ+Uvv+K5rMkuf8NpKEdT2BuoSTPlRElFCxaclAQJOf/hStJSAlQHO8=
\ No newline at end of file
GS3oekoZEnYJMuCekvInSC5XvZXVD+ipuFpWJytJLrepJXECA4YaT8a+2AalGBlKLVSP70Ss70w73d28v95g4/7aM2Lzejo8aYb8Jrmvjs20rDMwqY9r/awiw8gZuID52/7f2Tl6nq+VVzJTc5KTvI8NZ9qsovGdoXXORaRNtnA=
\ No newline at end of file
... ...
3038263396358685696
\ No newline at end of file
3039395831662248960
\ No newline at end of file
... ...
3248817613892608
\ No newline at end of file
3248817613779968
\ No newline at end of file
... ...
мֵ31
\ No newline at end of file
мֵ18
\ No newline at end of file
... ...
3274823457706240
\ No newline at end of file
3274993621020928
\ No newline at end of file
... ...
мֵ31
\ No newline at end of file
мֵ18
\ No newline at end of file
... ...
11011
\ No newline at end of file
11029
\ No newline at end of file
... ...
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk5MDM0ODkzLCJleHAiOjE1OTkwNDU2OTMsIm5iZiI6MTU5OTAzNDg5MywianRpIjoiMEZOd3JOOEd0NTJVUWFjQyIsInN1YiI6MzI0ODgxNzYxMzY4MTY2NCwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSIsImNvbXBhbnlJZCI6MzY2LCJuaWNrbmFtZSI6Ilx1OGM3OVx1NWI1MFx1NTkzNCIsInBob25lIjoiMTk5OTAwMDAwMDgiLCJ1aWQiOjMyNDg4MTc2MTM2ODE2NjQsImFkbWluVHlwZSI6Mn0.5mhMghMPFP8ZZcAeH2EkWsooDol1K6df8a5Oe0C_rlI
\ No newline at end of file
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk5MTE3OTgxLCJleHAiOjE1OTkxMjg3ODEsIm5iZiI6MTU5OTExNzk4MSwianRpIjoiUlU0RzVSRkFRenYyWlYyaSIsInN1YiI6MzI0ODgxNzYxMzY4MTY2NCwicHJ2IjoiODdlMGFmMWVmOWZkMTU4MTJmZGVjOTcxNTNhMTRlMGIwNDc1NDZhYSIsImNvbXBhbnlJZCI6MzY2LCJuaWNrbmFtZSI6Ilx1OGM3OVx1NWI1MFx1NTkzNCIsInBob25lIjoiMTk5OTAwMDAwMDgiLCJ1aWQiOjMyNDg4MTc2MTM2ODE2NjQsImFkbWluVHlwZSI6Mn0.5eXGpnIHhI71V2ek9QIhIyI-gxktFeh26YQMTJcHSv8
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@ from helpfunc.header_func import *
from helpfunc.login_func import *
from helpfunc.m_func import *
from helpfunc.pg_db_loot_func import *
from helpfunc.pg_db_bid_func import *
# from helpfunc.time_func import *
import time,datetime,re
... ... @@ -44,4 +45,4 @@ def get_second():
def get_tomorrow():
td = datetime.timedelta(days=1)
tomorrow = (datetime.datetime.utcnow() + td).isoformat()
print(tomorrow)
return tomorrow
... ...
... ... @@ -261,11 +261,12 @@ def teardown_hook_get_cid(response):
#————————————————————————————————————————————————————————————————————————————————————————————————————————————
#引用资源模块
def teardown_hook_get_resource_id(response):
global resource_id
resource_id = ''
if response.status_code ==200:
jsondata = json.loads(response.text)
resource_id = str(jsondata['data']['list'][0]['id'])
try:
with open(path + "config/resource_id.txt", 'w+') as f:
f.write(resource_id)
print('写入成功,resource_id:{}'.format(resource_id))
... ... @@ -289,6 +290,8 @@ def get_resource_id_to_int():
return int(get_resource_id())
def teardown_hook_get_resource_title(response):
global resource_title
resource_title = ''
if response.status_code ==200:
jsondata = json.loads(response.text)
resource_title = jsondata['data']['list'][0]['title']
... ... @@ -314,6 +317,8 @@ def get_resource_title():
return resource_title
def teardown_hook_get_resource_content(response):
global resource_content
resource_content = ''
if response.status_code ==200:
jsondata = json.loads(response.text)
resource_content = jsondata['data']['list'][0]['content']
... ...
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Date: 2020/7/12 16:27
# @Author:bxh
# @file: pg_db_func.py
from helpfunc.m_func import *
import psycopg2
from datetime import *
# 获得连接
def GetConnect():
conn = False
try:
conn = psycopg2.connect(database="mmmworthtest",
user="bianxinhua",
password="bianxinhua_123",
host="114.55.200.59",
port="31543")
except Exception as err:
print("连接数据库失败,%s" % err)
return conn
#获取抢单任务单的状态:待发布
def get_bid_task_status_1_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks where company_id = 366 and task_type = 2 and task_status = 1 and id = {} '''.format(get_bid_task_id())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
#获取抢单任务单的状态:待领取
def get_task_status_2_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks where company_id = 366 and task_type = 2 and task_status = 2 and id = {} '''.format(get_bid_task_id())
print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
#获取抢单任务单的状态:进行中
def get_task_status_3_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks where company_id = 366 and task_type = 2 and task_status = 3 and id = {} '''.format(get_bid_task_id())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
# #获取抢单任务单的状态:待确认
def get_task_status_7_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks where company_id = 366 and task_status = 7 and id = {}'''.format(get_bid_task_id())
print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
#获取任务单的状态:待验收
def get_task_status_4_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks t where t.company_id = 366 and t.task_status = 4 and t.receiver_uid = '3248817613892608' and id = {}'''.format(get_bid_task_id())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
#获取任务单的状态:已完成
def get_task_status_5_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks t where t.company_id = 366 and t.task_status = 5 and id = {}'''.format(get_bid_task_id())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
#获取任务单的状态:已关闭
def get_task_status_6_from_database():
db = GetConnect()
cursor = db.cursor()
# sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
sql = '''select task_status from tasks t where t.company_id = 366 and t.task_status = 6 and id = {}'''.format(get_bid_task_id())
# print(sql)
try:
cursor.execute(sql)
result = cursor.fetchone()
return result[0]
except Exception as err:
# 发生错误时回滚
print(err)
db.rollback()
db.close()
\ No newline at end of file
... ...
... ... @@ -22,7 +22,7 @@ teststeps:
- eq:
- content.msg
- ok
#
- name: 保存任务
api: api/m_api/loot/loot_update_false_api.yml
teardown_hooks:
... ...
... ... @@ -7,8 +7,8 @@ teststeps:
testcase: testcases/common/COM008_loot_open_status_2_testcase.yml
- name: 抢单任务验收
api: api/m_api/loot/loot_task_accept_api.yml
- name: 关闭任务
api: api/m_api/loot/loot_task_close_api.yml
validate:
- eq:
- content.code
... ... @@ -20,7 +20,7 @@ teststeps:
- name: 查看详情中的状态
api: api/m_api/loot/loot_detail_api.yml
variables:
status: ${get_task_status_5_from_database()}
status: ${get_task_status_6_from_database()}
msg: ok
varidate:
validate:
... ...
config:
name: 竞标任务状态验证-待发布
teststeps:
- name: 提问问题-审核问题-获取资源
testcase: testcases/permission/ques_pf_permission/QX001_pf_permission.yml
- name: 登录系统
variables:
phone: ${ENV(wpftwphone)}
testcase: testcases/common/COM002_m_login_testcases.yml
- name: 引用资源
api: api/m_api/task_resource_api.yml
teardown_hooks:
- ${teardown_hook_get_resource_id($response)}
- ${teardown_hook_get_resource_title($response)}
- ${teardown_hook_get_resource_content($response)}
varidate:
validate:
- eq:
- content.msg
- ok
- name: 保存任务
api: api/m_api/bid/bid_update_api.yml
teardown_hooks:
- ${teardown_hook_get_bid_task_id($response)}
varidate:
validate:
- eq:
- content.msg
- ok
#- name: 查看详情
# api: api/m_api/loot/loot_detail_api.yml
# variables:
# status: ${get_bid_task_status_1_from_database()}
# msg: ok
# varidate:
# validate:
# - eq:
# - content.msg
# - $msg
# - eq:
# - content.data.status
# - $status
\ No newline at end of file
... ...
... ... @@ -13,5 +13,5 @@ testcases:
#- name: member_set_permission 成员管理设置权限
# testcase: testcases/task/member/member_set_permission_testcases.yml
- name: 任务状态验证-已验收,已完成
testcase: testcases/common/COM012_loot_open_status_5_testcase.yml
\ No newline at end of file
- name: 任务状态验证-已关闭
testcase: testcases/common/COM014_bid_update_status_1_testcase.yml
\ No newline at end of file
... ...