作者 bianxinhua

add README

1 -name: 公司悬赏任务 1 +name: 公司任务(进行中)
2 base_url: ${ENV(base_url)} 2 base_url: ${ENV(base_url)}
3 verify: False 3 verify: False
4 variables: 4 variables:
@@ -19,10 +19,12 @@ request: @@ -19,10 +19,12 @@ request:
19 X-MMM-Uuid: $uuid 19 X-MMM-Uuid: $uuid
20 X-MMM-Version: 1.0.0 20 X-MMM-Version: 1.0.0
21 json: 21 json:
  22 + action: 0
  23 + newest: 1
22 pageIndex: 0 24 pageIndex: 0
23 pageSize: 20 25 pageSize: 20
24 method: POST 26 method: POST
25 - url: v1/task/rewards 27 + url: v1/task/currentTasks
26 validate: 28 validate:
27 - eq: 29 - eq:
28 - content.code 30 - content.code
@@ -4,7 +4,7 @@ verify: False @@ -4,7 +4,7 @@ verify: False
4 variables: 4 variables:
5 currtime: ${make_time()} 5 currtime: ${make_time()}
6 uuid: ${make_uuid()} 6 uuid: ${make_uuid()}
7 - access_token: ${get_accesstoken()} 7 + access_token: ${get_task_accesstoken()}
8 sign: ${make_sign($currtime, $uuid, $access_token)} 8 sign: ${make_sign($currtime, $uuid, $access_token)}
9 request: 9 request:
10 headers: 10 headers:
@@ -2,7 +2,7 @@ name: 抢单任务验收 @@ -2,7 +2,7 @@ name: 抢单任务验收
2 base_url: ${ENV(base_worth_url)} 2 base_url: ${ENV(base_worth_url)}
3 verify: False 3 verify: False
4 variables: 4 variables:
5 - taskId: ${get_task_status_4_from_database()} 5 + taskId: ${get_loot_task_id()}
6 remark: 上传报告${get_nowtime()} 6 remark: 上传报告${get_nowtime()}
7 realityTime: ${get_today()} 7 realityTime: ${get_today()}
8 uid0: ${get_uid0()} 8 uid0: ${get_uid0()}
@@ -21,13 +21,13 @@ request: @@ -21,13 +21,13 @@ request:
21 X-Requested-With: XMLHttpRequest 21 X-Requested-With: XMLHttpRequest
22 json: 22 json:
23 receiver: 23 receiver:
24 - uid: $uid15  
25 - name: $name15 24 + uid: $uid0
  25 + name: $name0
26 percent: 25 26 percent: 25
27 reward: 500 27 reward: 500
28 participant: 28 participant:
29 - - uid: $uid0  
30 - name: $name0 29 + - uid: $uid15
  30 + name: $name15
31 percent: ${convert_to_number(25)} 31 percent: ${convert_to_number(25)}
32 reward: ${convert_to_number(500)} 32 reward: ${convert_to_number(500)}
33 - uid: $uid1 33 - uid: $uid1
@@ -44,13 +44,13 @@ request: @@ -44,13 +44,13 @@ request:
44 solution: 44 solution:
45 total: ${convert_to_number(20)} 45 total: ${convert_to_number(20)}
46 receiver: 46 receiver:
47 - uid: $uid15  
48 - name: $name15 47 + uid: $uid0
  48 + name: $name0
49 percent: ${convert_to_number(25)} 49 percent: ${convert_to_number(25)}
50 score: ${convert_to_number(5)} 50 score: ${convert_to_number(5)}
51 participant: 51 participant:
52 - - uid: $uid0  
53 - name: $name0 52 + - uid: $uid15
  53 + name: $name15
54 percent: ${convert_to_number(25)} 54 percent: ${convert_to_number(25)}
55 score: ${convert_to_number(5)} 55 score: ${convert_to_number(5)}
56 - uid: $uid1 56 - uid: $uid1
@@ -67,10 +67,10 @@ request: @@ -67,10 +67,10 @@ request:
67 taskId: $taskId 67 taskId: $taskId
68 method: POST 68 method: POST
69 url: task/loot/accept 69 url: task/loot/accept
70 -#validate:  
71 - ## - eq:  
72 - ## - content.code  
73 - ## - 0  
74 - ## - eq:  
75 - ## - content.msg  
76 - ## - $msg  
  70 +validate:
  71 + - eq:
  72 + - content.code
  73 + - 0
  74 + - eq:
  75 + - content.msg
  76 + - $msg
1 -name: 任务详情  
2 -base_url: ${ENV(base_url)}  
3 -verify: False  
4 -variables:  
5 - currtime: ${make_time()}  
6 - uuid: ${make_uuid()}  
7 - access_token: ${get_accesstoken()}  
8 - sign: ${make_sign($currtime, $uuid, $access_token)}  
9 -request:  
10 - headers:  
11 - Content-Type: application/json;charset=utf-8  
12 - User-Agent: okhttp/3.12.3  
13 - X-MMM-AccessToken: $access_token  
14 - X-MMM-AppName: com.mmm.ability  
15 - X-MMM-AppProject: ability  
16 - X-MMM-DeviceType: '0'  
17 - X-MMM-Sign: $sign  
18 - X-MMM-Timestamp: $currtime  
19 - X-MMM-Uuid: $uuid  
20 - X-MMM-Version: 1.0.0  
21 - json:  
22 - id: $id  
23 - method: POST  
24 - url: v1/task/taskDetails  
25 -validate:  
26 - - eq:  
27 - - content.code  
28 - - 0  
29 - - eq:  
30 - - content.msg  
31 - - 获取详情成功  
32 -# - $msg  
1 -eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtYnVzaW5lc3MtYWRtaW4tZ2F0ZXdheS10ZXN0LmZqbWFpbWFpbWFpLmNvbVwvYXV0aFwvcHdkTG9naW4iLCJpYXQiOjE1OTg5NDY5NTksImV4cCI6MTU5ODk1Nzc1OSwibmJmIjoxNTk4OTQ2OTU5LCJqdGkiOiIzN1RYSHNmc1hna0F0cnI5Iiwic3ViIjozMjQ4ODE3NjEzNjgxNjY0LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIiwiY29tcGFueUlkIjozNjYsIm5pY2tuYW1lIjoiXHU4Yzc5XHU1YjUwXHU1OTM0IiwicGhvbmUiOiIxOTk5MDAwMDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.xwdYIQhfWtIqKld0ylGyH9LBuZw6kMuqEaBupm5jCWs  
  1 +eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtYnVzaW5lc3MtYWRtaW4tZ2F0ZXdheS10ZXN0LmZqbWFpbWFpbWFpLmNvbVwvYXV0aFwvcHdkTG9naW4iLCJpYXQiOjE1OTkwMzQ4OTMsImV4cCI6MTU5OTA0NTY5MywibmJmIjoxNTk5MDM0ODkzLCJqdGkiOiJVa3RuY0U2T3k1RDk0c250Iiwic3ViIjozMjQ4ODE3NjEzNjgxNjY0LCJwcnY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TkwMzQ4OTMsImV4cCI6MTU5OTA0NTY5MywibmJmIjoxNTk5MDM0ODkzLCJqdGkiOiI1ZTRlV0xLS2lkU0U2MGRiIiwic3ViIjozMjQ4ODE3NjEzNjgxNjY0LCJwcnYiOiI4N2UwYWYxZWY5ZmQxNTgxMmZkZWM5NzE1M2ExNGUwYjA0NzU0NmFhIiwiY29tcGFueUlkIjozNjYsIm5pY2tuYW1lIjoiXHU4Yzc5XHU1YjUwXHU1OTM0IiwicGhvbmUiOiIxOTk5MDAwMDAwOCIsImlkIjozMjQ4ODE3NjEzNjgxNjY0LCJhZG1pblR5cGUiOjF9.tkoNNuALbJhZy7By1GohDSW4pb3LVIx0V1NVSakAdwU
1 -amk7iu8zz8  
  1 +jwbedlg4b0n
1 -b8a8ace231fae55cbad834ad5b66e3d6a560f139581366548d37fe19f52167107b45d02b  
  1 +57276bc0f85217d57aac66c76c540ecf693b5eaa4d972e421f53bea3b526c63b7db79386
1 -akJLKfTT99ux5Pb/hJfAYc8ibr82OYYJRZ7s8yVO81THB4Zq3tkWqy6+nVOzvioN9EgeWrQkQ1CWDr+U4avOBRBnmXgzEwnlx5k10SvrUQA0QFei99aIz3CoLMl04vI3T3p9qV8iMhapaEuwSYM2/ZnMjaZeYCMa+hTLyab4kc0=  
  1 +KdQYph4cXCd0ZIUPvpnlFnFX3bXM1BbbYDK7ggdolQF/W4pdas9QauY54nYH6tqiSmUpHXvIo7Le65l3zfGhrFk07OW9H3IrqCSrCwSssV68XNsiPLauiZ+Uvv+K5rMkuf8NpKEdT2BuoSTPlRElFCxaclAQJOf/hStJSAlQHO8=
1 -3036831452701918208  
  1 +3038263396358685696
1 -3274643368620288  
  1 +3274823457706240
1 -eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9zdXBsdXMtd29ydGgtd2ViLWdhdGV3YXktdGVzdC5mam1haW1haW1haS5jb21cL2F1dGhcL2xvZ2luIiwiaWF0IjoxNTk4OTQ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helpfunc.header_func import *
5 from helpfunc.login_func import * 5 from helpfunc.login_func import *
6 from helpfunc.m_func import * 6 from helpfunc.m_func import *
7 -from helpfunc.pg_db_func import * 7 +from helpfunc.pg_db_loot_func import *
8 # from helpfunc.time_func import * 8 # from helpfunc.time_func import *
9 9
10 import time,datetime,re 10 import time,datetime,re
@@ -145,12 +145,46 @@ def get_task_status_4_from_database(): @@ -145,12 +145,46 @@ def get_task_status_4_from_database():
145 db = GetConnect() 145 db = GetConnect()
146 cursor = db.cursor() 146 cursor = db.cursor()
147 # sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc ' 147 # sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
148 - sql = '''select id from tasks t where t.company_id = 366 and t.task_status = 4 and t.receiver_uid = '3248817613892608' and id = {}'''.format(get_loot_task_id()) 148 + 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_loot_task_id())
149 # print(sql) 149 # print(sql)
150 try: 150 try:
151 cursor.execute(sql) 151 cursor.execute(sql)
152 result = cursor.fetchone() 152 result = cursor.fetchone()
153 - return str(result[0]) 153 + return result[0]
  154 + except Exception as err:
  155 + # 发生错误时回滚
  156 + print(err)
  157 + db.rollback()
  158 + db.close()
  159 +
  160 +#获取任务单的状态:已完成
  161 +def get_task_status_5_from_database():
  162 + db = GetConnect()
  163 + cursor = db.cursor()
  164 + # sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
  165 + sql = '''select task_status from tasks t where t.company_id = 366 and t.task_status = 5 and id = {}'''.format(get_loot_task_id())
  166 + # print(sql)
  167 + try:
  168 + cursor.execute(sql)
  169 + result = cursor.fetchone()
  170 + return result[0]
  171 + except Exception as err:
  172 + # 发生错误时回滚
  173 + print(err)
  174 + db.rollback()
  175 + db.close()
  176 +
  177 +#获取任务单的状态:已关闭
  178 +def get_task_status_6_from_database():
  179 + db = GetConnect()
  180 + cursor = db.cursor()
  181 + # sql= "select id from " + '''"''' + tbl + '''"'''+ ' ' + 'order by id desc '
  182 + sql = '''select task_status from tasks t where t.company_id = 366 and t.task_status = 6 and id = {}'''.format(get_loot_task_id())
  183 + # print(sql)
  184 + try:
  185 + cursor.execute(sql)
  186 + result = cursor.fetchone()
  187 + return result[0]
154 except Exception as err: 188 except Exception as err:
155 # 发生错误时回滚 189 # 发生错误时回滚
156 print(err) 190 print(err)
  1 +config:
  2 + name: 抢单任务状态验证-已验收,已完成
  3 +
  4 +teststeps:
  5 +
  6 +- name: 抢单任务状态验证-已完成,待验收
  7 + testcase: testcases/common/COM011_loot_open_status_4_testcase.yml
  8 +
  9 +- name: 用户列表
  10 + output:
  11 + - uid0
  12 + - name0
  13 + - uid1
  14 + - name1
  15 + - uid2
  16 + - name2
  17 + - uid15
  18 + - name15
  19 + api: api/m_api/common/user_api.yml
  20 + extract:
  21 + uid0: content.data.list.0.uid
  22 + name0: content.data.list.0.name
  23 + uid1: content.data.list.1.uid
  24 + name1: content.data.list.1.name
  25 + uid2: content.data.list.2.uid
  26 + name2: content.data.list.2.name
  27 + uid15: content.data.list.15.uid
  28 + name15: content.data.list.15.name
  29 +
  30 +- name: 抢单任务验收
  31 + api: api/m_api/loot/loot_task_accept_api.yml
  32 + validate:
  33 + - eq:
  34 + - content.code
  35 + - 0
  36 + - eq:
  37 + - content.msg
  38 + - ok
  39 +
  40 +- name: 查看详情中的状态
  41 + api: api/m_api/loot/loot_detail_api.yml
  42 + variables:
  43 + status: ${get_task_status_5_from_database()}
  44 + msg: ok
  45 + varidate:
  46 + validate:
  47 + - eq:
  48 + - content.msg
  49 + - $msg
  50 + - eq:
  51 + - content.data.status
  52 + - $status
  1 +config:
  2 + name: 抢单任务状态验证-已验收,已完成
  3 +
  4 +teststeps:
  5 +
  6 +- name: 抢单任务状态验证-已发布,待领取
  7 + testcase: testcases/common/COM008_loot_open_status_2_testcase.yml
  8 +
  9 +
  10 +- name: 抢单任务验收
  11 + api: api/m_api/loot/loot_task_accept_api.yml
  12 + validate:
  13 + - eq:
  14 + - content.code
  15 + - 0
  16 + - eq:
  17 + - content.msg
  18 + - ok
  19 +
  20 +- name: 查看详情中的状态
  21 + api: api/m_api/loot/loot_detail_api.yml
  22 + variables:
  23 + status: ${get_task_status_5_from_database()}
  24 + msg: ok
  25 + varidate:
  26 + validate:
  27 + - eq:
  28 + - content.msg
  29 + - $msg
  30 + - eq:
  31 + - content.data.status
  32 + - $status
@@ -10,10 +10,10 @@ teststeps: @@ -10,10 +10,10 @@ teststeps:
10 - name: 登录价值系统 10 - name: 登录价值系统
11 testcase: testcases/common/COM001_task_login_testcases.yml 11 testcase: testcases/common/COM001_task_login_testcases.yml
12 12
13 -- name: 公司任务(抢单任务 13 +- name: 公司任务(进行中
14 output: 14 output:
15 - id 15 - id
16 - api: api/m_api/loot/loot_contendTasks_api.yml 16 + api: api/m_api/loot/loot_currentTasks_api.yml
17 extract: 17 extract:
18 id: content.data.tasks.0.id 18 id: content.data.tasks.0.id
19 validate: 19 validate:
@@ -13,5 +13,5 @@ testcases: @@ -13,5 +13,5 @@ testcases:
13 #- name: member_set_permission 成员管理设置权限 13 #- name: member_set_permission 成员管理设置权限
14 # testcase: testcases/task/member/member_set_permission_testcases.yml 14 # testcase: testcases/task/member/member_set_permission_testcases.yml
15 15
16 -- name: 任务状态验证-已完成,待验收  
17 - testcase: testcases/common/COM011_loot_open_status_4_testcase.yml  
  16 +- name: 任务状态验证-已验收,已完成
  17 + testcase: testcases/common/COM012_loot_open_status_5_testcase.yml