Commit b149b3a3 authored by huangqiang's avatar huangqiang

Merge remote-tracking branch 'origin/liuqin_jyy'

# Conflicts: # .idea/jk_interface_test.iml # .idea/misc.xml # .idea/workspace.xml # run.py # tools/create_case.py
parents 9a32bcb7 6f368e70
common_config = { common_config = {
"host": "http://172.10.62.94", # "host": "http://172.10.62.94",
"host": "http://192.168.32.31",
"db_config": { "db_config": {
'database': 'edu-admin', 'database': 'edu-admin',
"user": 'read_user', "user": 'dev',
"password": 'c5JJUqmtTeaSaOTN2gs7', # "user": 'read_user',
"host": '132.232.15.12', # "password": 'c5JJUqmtTeaSaOTN2gs7',
"password": 'mko0PL<.;?',
# "host": '132.232.15.12',
"host": '192.168.32.31',
"port": 5432 "port": 5432
}, },
"mongo_db_config": { "mongo_db_config": {
......
...@@ -10,7 +10,8 @@ from script.base_api.service_user.wxMini import wxMini_auth_post ...@@ -10,7 +10,8 @@ from script.base_api.service_user.wxMini import wxMini_auth_post
def pytest_addoption(parser): def pytest_addoption(parser):
# 注册一个命令行选项host # 注册一个命令行选项host
parser.addoption("--host", default="http://172.10.62.94", dest="env", help="set test run env") # parser.addoption("--host", default="http://172.10.62.94", dest="env", help="set test run env")
parser.addoption("--host", default="https://yf1.jkwljy.com", dest="env", help="set test run env")
# 注册一个命令行选项db # 注册一个命令行选项db
parser.addoption("--db", default="yf1", dest="db", help="set test database") parser.addoption("--db", default="yf1", dest="db", help="set test database")
# 注册一个命令行选项account # 注册一个命令行选项account
......
...@@ -4,6 +4,7 @@ accounts = { ...@@ -4,6 +4,7 @@ accounts = {
"A": { "A": {
# 极运营默认账号 # 极运营默认账号
"jyy_account": { "jyy_account": {
# "account": "18224499511",
"account": "15360956010", "account": "15360956010",
"password": "88888888" "password": "88888888"
}, },
......
import random
import time
import datetime
def get_mobile():
"""获取手机号"""
mobile = '1' + random.choice(['3','5','7','8','9'])
for i in range(9):
num = random.randint(0,9)
mobile += str(num)
return mobile
def get_time():
# 获取当前时间
ts =str(int(time.time()))
return ts
def get_tomorrow_datetime():
# 获取明天日期
temp_date = datetime.datetime.now() # 获取当前时间 年月日时分秒
date1 = (temp_date + datetime.timedelta(days=+1)).strftime("%Y-%m-%d %H:%M:%S")
return date1
def get_today():
# 获取今天
today = time.strftime("%Y-%m-%d", time.localtime())
return today
def get_this_week():
# 获取当前日期星期
now = datetime.datetime.now()
this_week_start = now - datetime.timedelta(days=now.weekday())
this_week_end = now + datetime.timedelta(days=6 - now.weekday())
week_start = this_week_start.strftime("%Y-%m-%d")
week_end = this_week_end.strftime("%Y-%m-%d")
return {'week_start':week_start,'week_end':week_end}
def get_this_month():
# 获取当前日期月
now = datetime.datetime.now()
this_month_start = datetime.datetime(now.year,now.month,1)
this_month_end = datetime.datetime(now.year,now.month+1,1) - datetime.timedelta(days=1) + datetime.timedelta(hours=23, minutes=59, seconds=59)
month_start = this_month_start.strftime("%Y-%m-%d")
month_end = this_month_end.strftime("%Y-%m-%d")
return {'month_start':month_start,'month_end':month_end}
def time_transform_day(change_time):
# createTime: 1620387156 转换为2021-05-07 (时间戳转换为日期格式)
day = time.localtime(change_time)
day = time.strftime("%Y-%m-%d", day)
return day
def day_transform_time(change_time):
# createTimeStr: "2021-05-07 19:32:36" 转换为 2021-05-07 (格式转换为日期格式)
timeStruct = time.strptime(change_time, "%Y-%m-%d %H:%M:%S")
timeStruct = time.strftime("%Y-%m-%d", timeStruct)
return timeStruct
if __name__ == '__main__':
# print(get_mobile())
# print(get_time())
# print(get_tomorrow_datetime())
# print(get_this_week())
# print(get_this_month())
print(time_transform_day(1620387156))
print(day_transform_time("2021-05-07 19:32:36"))
import pytest
from jsonpath import jsonpath
from script.base_api import clue_manualInputAdd_post, clue_queryAll_post
from script.default_header import jyy_header
from script.ji_yun_ying_pc.service_crm_liuqin.case_data_handler_liuqin.myNewClue_handler import Add_My_New_Clue
@pytest.fixture
def add_my_clue():
"""添加我的新线索"""
json_data = Add_My_New_Clue().add_clue_data
studentName = json_data['studentName']
contactInfo=json_data['contactInfo']
res = clue_manualInputAdd_post(body=json_data,header=jyy_header)
yield {'studentName':studentName,'contactInfo':contactInfo}
@pytest.fixture()
def query_all_following_clues(add_my_clue):
"""查询我的线索-跟进中,返回第一条线索信息"""
query_data = {"belong": "PERSON", "status": "FOLLOWING", "pageNum": 1, "pageSize": 10,
"orderType": "desc", "orderField": "id", "schoolAreas": [3015]}
res_query_data = clue_queryAll_post(body=query_data,header=jyy_header)
contactInfo=jsonpath(res_query_data,'$..contactInfo')[0]
studentName=jsonpath(res_query_data,'$..studentName')[0]
id=jsonpath(res_query_data,'$..id')[0]
yield {'contactInfo':contactInfo,'studentName':studentName,'id':id}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
server: http://172.10.62.94 server: http://172.10.62.94
user: 13555555555 user: 13555555555
- headers: - headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMTc1IiwidGVybWluYWwiOiJwYyIsInV1aWQiOiI0NGIxZTk5ZTJhOTk0ZTVhYmY2MzdiZTFmZGVkN2NiZCIsInRpbWVzdGFtcCI6MTYxODM4NjMyNTk4MX0.vFTRtWmeXXXW9238IaAzIQHuZz6bYTpCLbN1pHcYky0 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiIyMTc1IiwidGVybWluYWwiOiJwYyIsInV1aWQiOiJkMjk5ZWRiNDJlNTU0OTRkYjc3NmE0NTkwM2YwNTIyZCIsInRpbWVzdGFtcCI6MTYxODM5NzI4NDU2Mn0.ZtC_9ky3c_XDMSqL3qfC-YbACj3OOtWyfPhKyzQ5x24
Content-Type: application/json;charset=UTF-8 Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31 server: http://192.168.32.31
user: 13555555555 user: 13555555555
...@@ -1336,3 +1336,51 @@ ...@@ -1336,3 +1336,51 @@
server: http://192.168.32.31 server: http://192.168.32.31
user: '16714154557' user: '16714154557'
userId: 696660 userId: 696660
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzIiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiI4YTEwZDU1Nzk0ODg0ZDA2OWRmY2ZlYzM5MGYyZmVhYyIsInRpbWVzdGFtcCI6MTYxODM5NzY3MTE2NH0.8J6ndWn8PcGu7oWV2fX8nwvetkBUDcs0CYwf0EALXpc
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '18914185429'
userId: 696672
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzMiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiJmNTE1NDVhODU0MWE0MjYwYjg4MGM4N2UxMzI1YTNjMiIsInRpbWVzdGFtcCI6MTYxODM5NzY3OTc3Mn0.5q_Z8bMz_i-4gQ3bgn7fH1PHnwS8LZZlvjIQM2mU7wU
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '13314185438'
userId: 696673
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzQiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiJkNGQ4NzY4N2NlMTI0OTVjOTY3NjFiNmYxZmZlOGEzNyIsInRpbWVzdGFtcCI6MTYxODM5NzY4NjY3NX0.hUTR-us7tDjN6omEvCJdlnbHe1cjW9t2qZywlqgJQyY
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '13314185440'
userId: 696674
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzUiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiJiMWVlYTAxOTc5MGQ0MmIzYmZhMjg1YTcxNDQ3ZTMxNyIsInRpbWVzdGFtcCI6MTYxODM5NzY5MjMyNH0.tYM7B8u9JucPTQNFEbj7wW0mlYI2V62ofEA_gwgdozo
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '16714185448'
userId: 696675
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzYiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiJhYmVlMDZjODJjNTc0NTBhYTJiNDFjZjhlZDY2ODYwMyIsInRpbWVzdGFtcCI6MTYxODM5Nzg1MDczNn0.Qm3mSD5Yr6BTKBcqZdPSSHQ8xGrv9NmiABG08okwszg
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '18914185729'
userId: 696676
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzciLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiJmM2VhY2EyN2VmYmY0OGM3OGQ0MmQyMWUxNTNkMzM1MSIsInRpbWVzdGFtcCI6MTYxODM5Nzg1OTExOX0._srG28HiJVk1yXr2Lo3uBQ36WYm8pxw6JwBBqd0fqBI
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '13314185738'
userId: 696677
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzgiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiI4ZTdkYmI4MTJiZjk0ZjM4YmY4MzNjODk0NzAzOWYyZSIsInRpbWVzdGFtcCI6MTYxODM5Nzg2NjE3MX0.xXWEN_5QE27plPNV_3GkHbEBrPXgZWZSMZscuL24JRM
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '13314185739'
userId: 696678
- headers:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2OTY2NzkiLCJ0ZXJtaW5hbCI6ImFwcCIsInV1aWQiOiI1Y2YyOTg4MWIzNjQ0ZThkODljM2IwY2U3MTBmZjdiYyIsInRpbWVzdGFtcCI6MTYxODM5Nzg3MjEzN30.ibDQY3IGwDnNCC9ng9qAJejEiYWajKkMiSQAh0LVgRo
Content-Type: application/json;charset=UTF-8
server: http://192.168.32.31
user: '16714185748'
userId: 696679
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment