Commit de9b565a by zhaihuitao

update

parent 9f58a956
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.4 (/anaconda3/bin/python3.6)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
......
......@@ -21,11 +21,13 @@ url = rc.get("env", "click_url")
print(url)
click_url = 'http://uri6.com/tkio/fMnmYba'
prod_event_url = 'http://log.trackingio.com'
# click_url = 'http://10.3.20.42:8083/tkio/JjuUb2a'
click_url = 'http://10.3.20.42:8083/tkio/ye6zEja'
# prod_event_url = 'http://log.trackingio.com'
prod_event_url = 'http://log.reyun.com'
# prod_event_url = 'http://10.3.20.42:8080'
test_event_url = 'http://10.3.20.42:8080'
prod_appkey = "895c5256a7f47bd2cca88a29da9e978a"
# test_event_url = 'http://10.3.20.42:8080'
prod_appkey = "426fb8e0d9879ebe739cc2a48585bf14"
# prod_appkey = "57ed2dd31596bb4682471e82c0c73c1a"
event_interface = dict(install='/receive/tkio/install', loggedin='/receive/tkio/loggedin',
pageduration='/receive/tkio/pageduration', payment='/receive/tkio/payment',
......
{
"imei": "400-000-000-000-001"
}
\ No newline at end of file
......@@ -9,13 +9,15 @@
import time
from config.envcfg import prod, prod_appkey
from common import randomUtil
from testcase.run_all_cases import IMEI
params_click = {
# 'androidid': "43214532142142",
# 'imei': "881554685049",
"idfa": 'DBC43622-E38B-440C-B7A7-FB6641D0D9AB',
'imei': IMEI,
# "idfa": 'DBC43622-E38B-440C-B7A7-FB6641D0D9AB',
'ip': randomUtil.r.randip(),
'vid': "test_vid"
# "idfa": "00000000-0000-0000-0000-000000000000",
# "idfv": ""
# "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 8_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3",
......@@ -64,8 +66,8 @@ params_install = {
"_model": "test1",
"_pkgname": "com.yanjing.yami",
"_campaignid": 'default',
"_deviceid": "881554685049",
"_imei": "881554685049",
"_deviceid": IMEI,
"_imei": IMEI,
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
# "_androidid": "43214532142142",
# "_imei2":"324323AAAA",
......@@ -96,16 +98,16 @@ params_startup = {
'what': 'startup',
'appid': prod_appkey,
'context': {
'_deviceid': "CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1",
# '_imei': "cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1",
# '_deviceid': "CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1",
'_imei': IMEI,
# '_androidid': "43214532142142",
'_ip': "119.57.108.226",
'_ip': randomUtil.r.randip(),
'_timestamp': int(round(time.time() * 1000)),
"_lib_version": "1.5.0",
"_campaignid": 'default',
# "_deviceid": i,
"_deviceid": IMEI,
# "_imei": i,
"_idfa": 'CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1',
# "_idfa": 'CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1',
# "_androidid": "424653325643",
# # "_imei2":"324323AAAA",
# # "_meid": "CCC324323",
......@@ -140,8 +142,8 @@ params_login = {
# 'what': 'loggedin',
'appid': prod_appkey,
'context': {
'_deviceid': randomUtil.r.randimei(),
'_imei': randomUtil.r.randimei(),
'_deviceid': IMEI,
'_imei': IMEI,
'_androidid': randomUtil.r.randimei(),
'_ip': randomUtil.r.randip(),
'_ryos': "Android",
......@@ -160,8 +162,8 @@ params_formate = {
"appid": prod_appkey,
"context": {
"_campaignid": 'default',
"_deviceid": randomUtil.r.randimei(),
"_imei": randomUtil.r.randimei(),
"_deviceid": IMEI,
"_imei": IMEI,
# "_imei2":i,
# "_oaid":i,
# "_meid":i,
......@@ -186,8 +188,8 @@ params_register = {
'what':'register',
'appid': prod_appkey,
'context': {
'_deviceid': randomUtil.r.randimei(),
# '_imei':i,
'_deviceid': IMEI,
'_imei':IMEI,
# '_androidid':i,
'_ip': randomUtil.r.randip(),
'_timestamp': int(round(time.time() * 1000)),
......@@ -206,16 +208,16 @@ params_pay = {
'what': 'payment',
'appid': prod_appkey,
'context': {
'_deviceid': randomUtil.r.randimei(),
'_imei': randomUtil.r.randimei(),
'_androidid': randomUtil.r.randimei(),
'_deviceid': IMEI,
'_imei': IMEI,
# '_androidid': randomUtil.r.randimei(),
'_ip': randomUtil.r.randip(),
'_timestamp': int(round(time.time() * 1000)),
'_transactionid': randomUtil.r.transactionid(),
'_paymenttype': "alipay",
'_ryos': "android",
'_currencytype': "CNY",
'_currencyamount': "10",
'_currencyamount': "30",
"_lib_version": "1.5.0",
'_oaid': "unknow",
# "_idfa": "00000000-0000-0000-0000-000000000000",
......@@ -231,9 +233,9 @@ params_payorder = {
'what': "order",
'appid': prod_appkey,
'context': {
'_deviceid': randomUtil.r.randimei(),
'_imei': randomUtil.r.randimei(),
'_androidid': randomUtil.r.randimei(),
'_deviceid': IMEI,
'_imei': IMEI,
# '_androidid': randomUtil.r.randimei(),
'_ip': randomUtil.r.randip(),
'_timestamp': int(round(time.time() * 1000)),
'_transactionid': randomUtil.r.transactionid(),
......@@ -253,9 +255,9 @@ params_custom = {
'what': "event",
'appid': prod_appkey,
'context': {
'_deviceid': randomUtil.r.randimei(),
'_imei': randomUtil.r.randimei(),
'_androidid': randomUtil.r.randimei(),
'_deviceid': IMEI,
'_imei': IMEI,
# '_androidid': randomUtil.r.randimei(),
'_ip': randomUtil.r.randip(),
'_ryos': "android",
"_lib_version": "1..5.0",
......@@ -270,13 +272,15 @@ params_custom = {
params_adshow = {
"appid": prod_appkey,
"context": {
'_adPlatform': "mintegral",
'_adId': "adid",
'_adPlatform': "ADTiming",
'_adId': "8205",
"_campaignid": 'default',
"_deviceid": randomUtil.r.randimei(),
"_imei": randomUtil.r.randimei(),
# "_deviceid": randomUtil.r.randimei(),
"_deviceid": IMEI,
# "_imei": randomUtil.r.randimei(),
"_imei": IMEI,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": randomUtil.r.randip(),
......@@ -300,13 +304,15 @@ params_adshow = {
params_adclick = {
"appid": prod_appkey,
"context": {
'_adPlatform': "mintegral",
'_adId': "adid",
'_adPlatform': "ADTiming",
'_adId': "8205",
"_campaignid": 'default',
"_deviceid": randomUtil.r.randimei(),
"_imei": randomUtil.r.randimei(),
# "_deviceid": randomUtil.r.randimei(),
"_deviceid": IMEI,
# "_imei": randomUtil.r.randimei(),
"_imei": IMEI,
# "_idfa": '75463565745634546',
"_androidid": "424653325643",
# "_androidid": "424653325643",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip": randomUtil.r.randip(),
......
aiocontextvars==0.2.2
alabaster==0.7.10
allure-pytest==2.8.17
allure-python-commons==2.8.17
anaconda-client==1.6.9
anaconda-navigator==1.7.0
anaconda-project==0.8.2
appnope==0.1.0
appscript==1.0.1
asn1crypto==0.24.0
astroid==1.6.1
astropy==2.0.3
atomicwrites==1.3.0
attrs==17.4.0
Babel==2.5.3
backports.csv==1.0.7
backports.shutil-get-terminal-size==1.0.0
beautiful==0.0.2
beautifulsoup4==4.6.0
bitarray==0.8.1
bkcharts==0.2
blaze==0.11.3
bleach==2.1.2
bokeh==0.12.13
boto==2.48.0
Bottleneck==1.2.1
bs4==0.0.1
certifi==2018.1.18
cffi==1.11.4
chardet==3.0.4
cheroot==8.2.1
CherryPy==18.5.0
click==6.7
client==0.0.1
cloudpickle==0.5.2
clyent==1.2.2
colorama==0.3.9
conda==4.4.10
conda-build==3.4.1
conda-verify==2.0.0
configparser==3.5.0
confuse==1.0.0
contextlib2==0.5.5
contextvars==2.4
cryptography==2.1.4
cycler==0.10.0
Cython==0.27.3
cytoolz==0.9.0
dask==0.16.1
datashape==0.5.4
decorator==4.2.1
distributed==1.20.2
Django==2.0.2
docutils==0.14
entrypoints==0.2.3
et-xmlfile==1.0.1
fastcache==1.0.2
feedparser==5.2.1
filelock==2.0.13
Flask==0.12.2
Flask-Cors==3.0.3
future==0.18.2
gevent==1.2.2
glob2==0.6
gmpy2==2.0.8
greenlet==0.4.12
h5py==2.7.1
heapdict==1.0.0
html5lib==1.0.1
htmlmin==0.1.12
idna==2.6
imageio==2.2.0
imagesize==0.7.1
immutables==0.14
importlib-metadata==0.18
importlib-resources==1.0.2
iniconfig==1.1.1
ipykernel==4.8.0
ipython==6.2.1
ipython-genutils==0.2.0
ipywidgets==7.1.1
isort==4.2.15
itsdangerous==0.24
jaraco.classes==3.1.0
jaraco.collections==3.0.0
jaraco.functools==3.0.0
jaraco.text==3.2.0
jdcal==1.3
jedi==0.11.1
Jinja2==2.10
jsonpath==0.82
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.4
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyterlab==0.31.5
jupyterlab-launcher==0.10.2
jupyterthemes==0.20.0
lazy-object-proxy==1.3.1
lesscpy==0.13.0
llvmlite==0.29.0
locket==0.2.0
loguru==0.5.1
lxml==4.1.1
MarkupSafe==1.0
matplotlib==2.1.2
mccabe==0.6.1
missingno==0.4.1
mistune==0.8.3
more-itertools==7.0.0
mpmath==1.0.0
msgpack-python==0.5.1
multipledispatch==0.4.9
mysqlclient==1.4.6
navigator-updater==0.1.0
nbconvert==5.3.1
nbformat==4.4.0
networkx==2.1
nltk==3.2.5
nose==1.3.7
notebook==5.7.8
numba==0.44.1
numexpr==2.6.4
numpy==1.14.0
numpydoc==0.7.0
odo==0.5.1
olefile==0.45.1
openpyxl==2.4.10
packaging==16.8
pandas==0.22.0
pandas-profiling==2.0.3
pandoc==1.0.2
pandocfilters==1.4.2
parso==0.1.1
partd==0.3.8
path.py==10.5
pathlib2==2.3.0
patsy==0.5.0
Pattern==3.6
pdfminer.six==20200104
pep8==1.7.1
pexpect==4.3.1
phik==0.9.8
pickleshare==0.7.4
Pillow==5.0.0
pkginfo==1.4.1
pluggy==0.12.0
ply==3.10
portend==2.6
prometheus-client==0.7.1
prompt-toolkit==1.0.15
psutil==5.4.3
ptyprocess==0.5.2
py==1.9.0
pycodestyle==2.3.1
pycosat==0.6.3
pycparser==2.18
pycrypto==2.6.1
pycryptodome==3.9.4
pycurl==7.43.0.1
pyflakes==1.6.0
Pygments==2.2.0
pylint==1.8.2
PyMySQL==0.7.9
pyodbc==4.0.22
pyOpenSSL==17.5.0
pyparsing==2.2.0
PySocks==1.6.7
pytest==6.0.1
pytest-pylint==0.14.0
python-dateutil==2.6.1
python-docx==0.8.10
pytz==2017.3
PyWavelets==0.5.2
PyYAML==3.12
pyzmq==18.0.1
QtAwesome==0.4.4
qtconsole==4.3.1
QtPy==1.3.1
requests==2.18.4
rope==0.10.7
ruamel-yaml==0.15.35
scikit-image==0.13.1
scikit-learn==0.19.1
scipy==1.0.0
seaborn==0.8.1
selenium==3.11.0
Send2Trash==1.4.2
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.11.0
snowballstemmer==1.2.1
sortedcollections==0.5.3
sortedcontainers==1.5.9
soup==0.1.0
Sphinx==1.6.6
sphinxcontrib-websupport==1.0.1
spyder==3.2.6
SQLAlchemy==1.2.1
statsmodels==0.8.0
suds==0.4
sympy==1.1.1
tables==3.4.2
tblib==1.3.2
tempora==2.1.0
terminado==0.8.1
testpath==0.3.1
toml==0.10.2
toolz==0.9.0
tornado==4.5.3
traitlets==4.3.2
typing==3.6.2
unicodecsv==0.14.1
urllib3==1.22
wcwidth==0.1.7
webencodings==0.5.1
websocket-client==0.57.0
Werkzeug==0.14.1
widgetsnbextension==3.1.0
wrapt==1.10.11
xlrd==1.1.0
XlsxWriter==1.0.2
xlwings==0.11.5
xlwt==1.2.0
zc.lockfile==2.0
zict==0.1.3
zipp==0.5.1
......@@ -20,7 +20,7 @@ sys.path.append(base_path)
class clickTestCase(unittest.TestCase):
def testclick(self):
p = requests.get(url=click_url, params=params_click, timeout=30, verify=False)
# self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
#self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
print(p.status_code)
# print(p)
# time.sleep(7)
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_adclick.py
@file: _adclick.py
@time: 2020/8/24 15:54
@desc:
"""
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_adshow.py
@file: _adshow.py
@time: 2020/8/21 18:00
@desc:
"""
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_appduration.py
@file: _appduration.py
@time: 2020/8/24 20:21
@desc:
"""
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_batchUpload.py
@file: _batchUpload.py
@time: 2020/8/25 15:24
@desc:
"""
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_custom.py
@file: _custom.py
@time: 2020/8/21 15:38
@desc:
"""
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_gettime.py
@file: _gettime.py
@time: 2020/10/29 16:40
@desc:
"""
......
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_pageduration.py
@file: _pageduration.py
@time: 2020/8/24 18:19
@desc:
"""
......
from testcase.game.game_param import allevent
import struct
import socket
import random
import time
import json
lst = []
newList = ['195713813811']
appkey = '426fb8e0d9879ebe739cc2a48585bf14'
event = 'exception'
i = json.load(open('imei.json', 'r+'))['imei'] + 1
json.dump({"imei": i}, open('imei.json', 'w+'), sort_keys=True, indent=4)
print(i)
# 遍历已有列表数据 发请求
# for i in newList:
# # 随机生成ip
# ip = socket.inet_ntoa(struct.pack('>I', random.randint(1, 0xffffffff)))
# c = ''.join(str(random.choice(range(10))) for _ in range(12))
# # allevent().event_login(i,appkey)
# # time.sleep(2)
# allevent().event_economy(i,appkey,c)
# for _ in range(1):
# i = ''.join(str(random.choice(range(10))) for _ in range(12))
# c = ''.join(str(random.choice(range(10))) for _ in range(12))
allevent().event_install(i, appkey)
time.sleep(2)
allevent().event_register(i, appkey)
time.sleep(2)
allevent().event_login(i, appkey)
# time.sleep(2)
allevent().event_payment(i, appkey, campId='reyun')
time.sleep(2)
# allevent().event_event(i,appkey,event)
# allevent().event_economy(i,appkey,c)
lst.append(i)
print(lst)
import requests
import json
import time
import random
URL = 'http://log.reyun.com'
# URL = 'http://10.3.20.42:8080'
headers = {'Content-Type': 'application/json'}
URL_install = URL+'/receive/rest/install'
URL_startup = URL+'/receive/rest/startup'
URL_register = URL+'/receive/rest/register'
URL_payment = URL+'/receive/rest/payment'
URL_loggedin = URL+'/receive/rest/loggedin'
URL_event = URL+'/receive/rest/event'
URL_economy = URL+'/receive/rest/economy'
network = 'wifi'
os = 'ios'
devicetype = 'iphone4s'
resolution = '123*456'
channelid = '111'
op = '中国移动'
itemname = '测试5'
itemtotalprice = '99'
serverid = 1
class allevent:
def event_install(self,i,appid):
s = json.dumps({
"appid": appid,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid
}
})
p = requests.post(url=URL_install,data=s,headers=headers,timeout=4)
print(p.text)
def event_startup(self,i,appid):
s = json.dumps({
"appid": appid,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"network":network,
"os":os,
"devicetype":devicetype,
'resolution':resolution,
'op': op
}
})
p = requests.post(url=URL_startup,data=s,headers=headers,timeout=4)
print(p.text)
def event_register(self,i,appid):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
#"idfa":i,
#"idfv":i,
"serverid": serverid,
"channelid":channelid
}
})
p = requests.post(url=URL_register, data=s, headers=headers, timeout=4)
print(p.text)
def event_login(self, i, appid):
s = json.dumps({
"appid": appid,
"who": i,
"context":
{
"deviceid": i,
# "idfa":i,
# "idfv":i,
"serverid": serverid,
"channelid": channelid
}
})
p = requests.post(url=URL_loggedin,data=s,headers=headers,timeout=4)
print(p.text)
def event_payment(self,i,appid,campId):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"transactionid":"12323232131321",
"paymenttype":"支付宝",
"currencytype":"CNY",
"currencyamount":"100",
"virtualcoinamount":"500",
"iapname":"test",
"iapamount":"3",
"campId":campId
}
})
p = requests.post(url=URL_payment,data=s,headers=headers,timeout=4)
print(p.text)
def event_event(self,i,appid,event):
s = json.dumps({
"appid": appid,
"who": i,
"what": event,
"context":
{
"deviceid": i,
# "idfa":i,
# "idfv":i,
"serverid": serverid,
"channelid": channelid
}
})
p = requests.post(url=URL_event, data=s, headers=headers, timeout=4)
print(p.text)
def event_economy(self,i,appid,campId):
s = json.dumps({
"appid": appid,
"who":i,
"context":
{
"deviceid": i,
"idfa":i,
"idfv":i,
"channelid":channelid,
"itemamount": "1",
"itemname": itemname,
"itemtotalprice": itemtotalprice,
"campId": campId
}
})
p = requests.post(url=URL_economy,data=s,headers=headers,timeout=4)
print(p.text)
\ No newline at end of file
{
"imei": 400000000000003
}
\ No newline at end of file
{
"imei": 400000000000006
}
\ No newline at end of file
......@@ -12,6 +12,12 @@ import HTMLTestReportCN
import sys
import importlib
importlib.reload(sys)
import json
IMEI = json.load(open('imei.json', 'r+'))['imei'] + 1
json.dump({"imei": IMEI}, open('imei.json', 'w+'), sort_keys=True, indent=4)
print(IMEI)
"""解决在Jenkins控制台无法打印中文的问题"""
......
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