Commit e16bdf85 by zhaihuitao

update

parent ccfb5114
...@@ -22,7 +22,7 @@ print(url) ...@@ -22,7 +22,7 @@ print(url)
# click_url = 'http://10.3.20.42:8083/tkio/JjuUb2a' # click_url = 'http://10.3.20.42:8083/tkio/JjuUb2a'
click_url = 'http://10.3.20.42:8083/tkio/ye6zEja' click_url = 'http://10.3.20.42:8083/tkio/Bzq2aua'
# prod_event_url = 'http://log.trackingio.com' # prod_event_url = 'http://log.trackingio.com'
prod_event_url = 'http://log.reyun.com' prod_event_url = 'http://log.reyun.com'
# prod_event_url = 'http://10.3.20.42:8080' # prod_event_url = 'http://10.3.20.42:8080'
......
...@@ -9,15 +9,16 @@ ...@@ -9,15 +9,16 @@
import time import time
from config.envcfg import prod, prod_appkey from config.envcfg import prod, prod_appkey
from common import randomUtil from common import randomUtil
from testcase.run_all_cases import IMEI # from testcase.run_all_cases import IMEI
IMEI = randomUtil.r.randimei()
params_click = { params_click = {
# 'androidid': "43214532142142", # 'androidid': "43214532142142",
'imei': IMEI, 'imei': "cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1",
# "idfa": 'DBC43622-E38B-440C-B7A7-FB6641D0D9AB', # "idfa": 'DBC43622-E38B-440C-B7A7-FB6641D0D9AB',
'ip': randomUtil.r.randip(), 'ip': randomUtil.r.randip(),
'vid': "test_vid" 'vid': "test_vid",
"_deviceid": "CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1",
# "idfa": "00000000-0000-0000-0000-000000000000", # "idfa": "00000000-0000-0000-0000-000000000000",
# "idfv": "" # "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", # "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",
...@@ -39,7 +40,7 @@ params_click = { ...@@ -39,7 +40,7 @@ params_click = {
# 'subchannel': '3123123', # 'subchannel': '3123123',
# 'aid': '111', # 'aid': '111',
# 'siteid': '222', # 'siteid': '222',
# 'csite': '333', # 'csite': '40001',
# "timestamp": "1569141628027", # "timestamp": "1569141628027",
# "creative": "31096865315", # "creative": "31096865315",
# "deviceid": "881554685049", # "deviceid": "881554685049",
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """
@author:zhaiht @author:zhaiht
@file: test_click.py @file: click.py
@time: 2020/8/5 14:48 @time: 2020/8/5 14:48
@desc: @desc:
""" """
......
import requests
from common import randomUtil
# url = 'https://uri6.com/tkio/Y7RVvea?imei=__IMEI__&mac=__MAC1__&androidid=__ANDROIDID__&oaid=__OAID__&ip=__IP__&ts=__TS__&os=__OS__&callback_param=__CALLBACK_PARAM__&callback=__CALLBACK_URL__&ry_adgroup_id=__CAMPAIGN_ID__&ry_adplan_id=__AID__&ry_adplan_name=__AID_NAME__&ry_adcreative_id=__CID__&ctype=__CTYPE__&csite=40001&siteid=__UNION_SITE__&vid=__VID__&ry_adcreative_name=__CID_NAME__&aid=__AID__&ry_adgroup_name=__CAMPAIGN_NAME__&noredirect=true'
url = 'https://uri6.com/tkio/Y7RVvea'
count = 0
params_click = {
# 'androidid': "43214532142142",
'imei': randomUtil.r.randimei(),
# "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",
# 'creativeId':'21321321312123',
# 'requestId':'312321321312',
#'adId': long('21231'),
# 'ry_adgroup_name': ry_adgroup_name,
# 'ry_adplan_name': ry_adplan_name,
# 'ry_adcreative_name': ry_adcreative_name,
# "ry_adgroup_id": ry_adgroup_id,
# "ry_adplan_id": ry_adplan_id,
# "ry_adcreative_id": ry_adcreative_id,
# 'imei2': 'null',
# 'meid': i
# 'bd_vid': i
# 'oaid': "234B9U1T-A274-ED22-CEBF-4B6DDDFC18A9",
# 'muid': "4CF21FBB2FA6CA3D914476954ABBFEBF182BB0BD",
# 'mac': "12321321321321321",
# 'subchannel': '3123123',
# 'aid': '111',
# 'siteid': '222',
'csite': '40001',
# "timestamp": "1569141628027",
# "creative": "31096865315",
# "deviceid": "881554685049",
# "tz": "+8",
# "wx_campaign_id":ry_adgroup_id,
# 'wx_adgroup_id':ry_adplan_id,
# 'ry_adcreative_id':ry_adcreative_id
# "ry_channel_fake": "false",
# "ry_ts": "1569141628025",
# "type": '1222',
# "ctype": '4232323',
# "campaign_id": '123',
# "adgroup_id": '123',
# "creative_id": '123'
}
while count < 1001:
count = count+1
p = requests.get(url=url,params=params_click)
print(p.text)
print(count)
\ No newline at end of file
import os import os
import sys import sys
import importlib import importlib
import datetime
importlib.reload(sys) importlib.reload(sys)
import time import time
import json import json
...@@ -11,16 +11,27 @@ from testcase.game.game_param import allevent ...@@ -11,16 +11,27 @@ from testcase.game.game_param import allevent
rootPath = os.path.split(curPath)[0] rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)''' sys.path.append(rootPath)'''
base_dir = os.path.dirname(os.path.abspath(__file__)) base_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.extend(['/Users/zhaihuitao/PycharmProjects/TKIO/interfaceTest/testcase']) sys.path.append(base_dir)
lst = [] lst = []
newList = ['195713813811'] newList = ['195713813811']
appkey = 'ff2c15d87db8fb16e6d0e82d8f2b4a6d' appkey = 'd1ff8a31072aac7f8c4611241905d334'
event = 'exception' event = 'event_1'
count = 1
while True:
time.sleep(0.3)
ts = int(time.time()) * 1000
# now = datetime.datetime.now()
startDate = datetime.datetime(2021, 1, 8, 16, 32, 00)
startTs = int(time.mktime(startDate.timetuple())) * 1000
endDate = (startDate + datetime.timedelta(minutes=6))
endTs = int(time.mktime(endDate.timetuple())) * 1000
# print(startTs, ts, endTs)
i = json.load(open('imei.json', 'r+'))['imei'] + 1 i = json.load(open('imei.json', 'r+'))['imei'] + 1
json.dump({"imei": i}, open('imei.json', 'w+'), sort_keys=True, indent=4) json.dump({"imei": i}, open('imei.json', 'w+'), sort_keys=True, indent=4)
print(i) #print(i)
# 遍历已有列表数据 发请求 # 遍历已有列表数据 发请求
# for i in newList: # for i in newList:
...@@ -34,15 +45,20 @@ print(i) ...@@ -34,15 +45,20 @@ print(i)
# for _ in range(1): # for _ in range(1):
# i = ''.join(str(random.choice(range(10))) for _ in range(12)) # i = ''.join(str(random.choice(range(10))) for _ in range(12))
# c = ''.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) allevent().event_install(i, appkey)
time.sleep(2) #time.sleep(2)
allevent().event_register(i, appkey) allevent().event_register(i, appkey)
time.sleep(2) #time.sleep(2)
allevent().event_login(i, appkey) allevent().event_login(i, appkey)
# time.sleep(2) # time.sleep(2)
allevent().event_payment(i, appkey, campId='reyun') allevent().event_payment(i, appkey, campId='reyun')
time.sleep(2) #time.sleep(2)
# allevent().event_event(i,appkey,event) allevent().event_event(i, appkey, event)
# allevent().event_economy(i,appkey,c) allevent().event_economy(i, appkey)
lst.append(i) allevent().event_quest(i, appkey)
print(lst) allevent().event_heart(i, appkey)
count = count + 1
print(count)
# lst.append(i)
if count >= 500:
break
...@@ -14,16 +14,23 @@ URL_payment = URL+'/receive/rest/payment' ...@@ -14,16 +14,23 @@ URL_payment = URL+'/receive/rest/payment'
URL_loggedin = URL+'/receive/rest/loggedin' URL_loggedin = URL+'/receive/rest/loggedin'
URL_event = URL+'/receive/rest/event' URL_event = URL+'/receive/rest/event'
URL_economy = URL+'/receive/rest/economy' URL_economy = URL+'/receive/rest/economy'
URL_quest = URL+'/receive/rest/quest'
URL_heart = URL+'/receive/rest/heartbeat'
network = 'wifi' network = 'wifi'
os = 'ios' os = 'android'
devicetype = 'iphone4s' devicetype = 'huaweimate'
resolution = '123*456' resolution = '123*456'
channelid = '111' channelid = '111'
op = '中国移动' op = '中国移动'
itemname = '测试5' itemname = random.randint(100,900)
itemtotalprice = '99' itemtotalprice = random.randint(101,303)
itemamount = random.randint(1,10)
serverid = 1 serverid = 1
campId = random.randint(1000, 1002)
level = random.randint(0, 1001)
class allevent: class allevent:
def event_install(self,i,appid): def event_install(self,i,appid):
s = json.dumps({ s = json.dumps({
...@@ -31,9 +38,9 @@ class allevent: ...@@ -31,9 +38,9 @@ class allevent:
"context": "context":
{ {
"deviceid": i, "deviceid": i,
"idfa":i, "imei":i,
"idfv":i, ## "idfv":i,
"channelid":channelid "channelid":random.randint(111, 113)
} }
}) })
p = requests.post(url=URL_install,data=s,headers=headers,timeout=4) p = requests.post(url=URL_install,data=s,headers=headers,timeout=4)
...@@ -44,9 +51,9 @@ class allevent: ...@@ -44,9 +51,9 @@ class allevent:
"context": "context":
{ {
"deviceid": i, "deviceid": i,
"idfa":i, "imei":i,
"idfv":i, # # "idfv":i,
"channelid":channelid, "channelid":random.randint(111, 113),
"network":network, "network":network,
"os":os, "os":os,
"devicetype":devicetype, "devicetype":devicetype,
...@@ -63,10 +70,10 @@ class allevent: ...@@ -63,10 +70,10 @@ class allevent:
"context": "context":
{ {
"deviceid": i, "deviceid": i,
#"idfa":i, "imei":i,
#"idfv":i, ## "idfv":i,
"serverid": serverid, "serverid": serverid,
"channelid":channelid "channelid":random.randint(111, 113)
} }
}) })
p = requests.post(url=URL_register, data=s, headers=headers, timeout=4) p = requests.post(url=URL_register, data=s, headers=headers, timeout=4)
...@@ -79,8 +86,8 @@ class allevent: ...@@ -79,8 +86,8 @@ class allevent:
"context": "context":
{ {
"deviceid": i, "deviceid": i,
# "idfa":i, "imei":i,
# "idfv":i, # # "idfv":i,
"serverid": serverid, "serverid": serverid,
"channelid": channelid "channelid": channelid
} }
...@@ -94,13 +101,13 @@ class allevent: ...@@ -94,13 +101,13 @@ class allevent:
"context": "context":
{ {
"deviceid": i, "deviceid": i,
"idfa":i, "imei":i,
"idfv":i, # "idfv":i,
"channelid":channelid, "channelid":random.randint(111, 113),
"transactionid":"12323232131321", "transactionid":"12323232131321",
"paymenttype":"支付宝", "paymenttype":"支付宝",
"currencytype":"CNY", "currencytype":"CNY",
"currencyamount":"100", "currencyamount":random.randint(100, 500),
"virtualcoinamount":"500", "virtualcoinamount":"500",
"iapname":"test", "iapname":"test",
"iapamount":"3", "iapamount":"3",
...@@ -117,8 +124,8 @@ class allevent: ...@@ -117,8 +124,8 @@ class allevent:
"context": "context":
{ {
"deviceid": i, "deviceid": i,
# "idfa":i, # "imei":i,
# "idfv":i, # # "idfv":i,
"serverid": serverid, "serverid": serverid,
"channelid": channelid "channelid": channelid
} }
...@@ -126,21 +133,62 @@ class allevent: ...@@ -126,21 +133,62 @@ class allevent:
p = requests.post(url=URL_event, data=s, headers=headers, timeout=4) p = requests.post(url=URL_event, data=s, headers=headers, timeout=4)
print(p.text) print(p.text)
def event_economy(self,i,appid,campId): def event_economy(self,i,appid):
s = json.dumps({ s = json.dumps({
"appid": appid, "appid": appid,
"who":i, "who":i,
"context": "context":
{ {
"deviceid": i, "deviceid": i,
"idfa":i, "imei":i,
"idfv":i, # "idfv":i,
"channelid":channelid, "channelid":random.randint(111, 113),
"itemamount": "1", "itemamount": random.randint(1,20),
"itemname": itemname, "itemname": random.randint(100, 111),
"itemtotalprice": itemtotalprice, "itemtotalprice": itemtotalprice,
"campId": campId "level": random.randint(0, 1001),
"serverid": random.randint(10000,10050),
"campId": random.randint(1000, 1002)
} }
}) })
p = requests.post(url=URL_economy,data=s,headers=headers,timeout=4) p = requests.post(url=URL_economy,data=s,headers=headers,timeout=4)
print(p.text)
def event_quest(self, i, appid):
s = json.dumps({
"appid": appid,
"who": i,
"context":
{
"deviceid": i,
# "imei": i,
# "idfv":i,
"questid": random.randint(110, 120),
"queststatus": random.choice('acf'),
"questtype": "new",
"channelid": channelid,
# "itemamount": random.randint(1, 20),
# "itemname": random.randint(100, 111),
# "itemtotalprice": itemtotalprice,
"level": random.randint(0, 1001),
"serverid": random.randint(10000, 10050),
# "campId": random.randint(1000, 1002)
}
})
p = requests.post(url=URL_quest, data=s, headers=headers, timeout=4)
print(p.text)
def event_heart(self, i, appid):
s = json.dumps({
"appid": appid,
"who": i,
"context":
{
"deviceid": i,
"level": random.randint(0, 1001),
"serverid": random.randint(10000, 10050),
"channelid": "222"
}
})
p = requests.post(url=URL_heart, data=s, headers=headers, timeout=4)
print(p.text) print(p.text)
\ No newline at end of file
{ {
"imei": 400000000000002 "imei": 50100000000499
} }
\ No newline at end of file
...@@ -15,9 +15,9 @@ importlib.reload(sys) ...@@ -15,9 +15,9 @@ importlib.reload(sys)
import json import json
IMEI = json.load(open('imei.json', 'r+'))['imei'] + 1 #IMEI = json.load(open('imei.json', 'r+'))['imei'] + 1
json.dump({"imei": IMEI}, open('imei.json', 'w+'), sort_keys=True, indent=4) #json.dump({"imei": IMEI}, open('imei.json', 'w+'), sort_keys=True, indent=4)
print(IMEI) #print(IMEI)
......
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