Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interfaceTest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Schedules
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
zhaihuitao
interfaceTest
Commits
e16bdf85
Commit
e16bdf85
authored
Jan 15, 2021
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ccfb5114
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
184 additions
and
58 deletions
+184
-58
workspace.xml
.idea/workspace.xml
+0
-0
envcfg.py
config/envcfg.py
+1
-1
params.py
config/prod/params.py
+6
-5
test_click.py
testcase/android_click/test_click.py
+1
-1
click.py
testcase/game/click.py
+59
-0
game_event.py
testcase/game/game_event.py
+35
-19
game_param.py
testcase/game/game_param.py
+77
-28
imei.json
testcase/game/imei.json
+2
-1
run_all_cases.py
testcase/run_all_cases.py
+3
-3
No files found.
.idea/workspace.xml
View file @
e16bdf85
This diff is collapsed.
Click to expand it.
config/envcfg.py
View file @
e16bdf85
...
...
@@ -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/
ye6zEj
a'
click_url
=
'http://10.3.20.42:8083/tkio/
Bzq2au
a'
# prod_event_url = 'http://log.trackingio.com'
prod_event_url
=
'http://log.reyun.com'
# prod_event_url = 'http://10.3.20.42:8080'
...
...
config/prod/params.py
View file @
e16bdf85
...
...
@@ -9,15 +9,16 @@
import
time
from
config.envcfg
import
prod
,
prod_appkey
from
common
import
randomUtil
from
testcase.run_all_cases
import
IMEI
# from testcase.run_all_cases import IMEI
IMEI
=
randomUtil
.
r
.
randimei
()
params_click
=
{
# 'androidid': "43214532142142",
'imei'
:
IMEI
,
'imei'
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
# "idfa": 'DBC43622-E38B-440C-B7A7-FB6641D0D9AB',
'ip'
:
randomUtil
.
r
.
randip
(),
'vid'
:
"test_vid"
'vid'
:
"test_vid"
,
"_deviceid"
:
"CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1"
,
# "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",
...
...
@@ -39,7 +40,7 @@ params_click = {
# 'subchannel': '3123123',
# 'aid': '111',
# 'siteid': '222',
# 'csite': '
333
',
# 'csite': '
40001
',
# "timestamp": "1569141628027",
# "creative": "31096865315",
# "deviceid": "881554685049",
...
...
testcase/android_click/test_click.py
View file @
e16bdf85
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file:
test_
click.py
@file: click.py
@time: 2020/8/5 14:48
@desc:
"""
...
...
testcase/game/click.py
0 → 100644
View file @
e16bdf85
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
testcase/game/game_event.py
View file @
e16bdf85
import
os
import
sys
import
importlib
import
datetime
importlib
.
reload
(
sys
)
import
time
import
json
...
...
@@ -11,16 +11,27 @@ from testcase.game.game_param import allevent
rootPath = os.path.split(curPath)[0]
sys.path.append(rootPath)'''
base_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
sys
.
path
.
extend
([
'/Users/zhaihuitao/PycharmProjects/TKIO/interfaceTest/testcase'
]
)
sys
.
path
.
append
(
base_dir
)
lst
=
[]
newList
=
[
'195713813811'
]
appkey
=
'ff2c15d87db8fb16e6d0e82d8f2b4a6d'
event
=
'exception'
appkey
=
'd1ff8a31072aac7f8c4611241905d334'
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
json
.
dump
({
"imei"
:
i
},
open
(
'imei.json'
,
'w+'
),
sort_keys
=
True
,
indent
=
4
)
print
(
i
)
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:
...
...
@@ -34,15 +45,20 @@ print(i)
# 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
)
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
)
allevent
()
.
event_quest
(
i
,
appkey
)
allevent
()
.
event_heart
(
i
,
appkey
)
count
=
count
+
1
print
(
count
)
# lst.append(i)
if
count
>=
500
:
break
testcase/game/game_param.py
View file @
e16bdf85
...
...
@@ -14,16 +14,23 @@ URL_payment = URL+'/receive/rest/payment'
URL_loggedin
=
URL
+
'/receive/rest/loggedin'
URL_event
=
URL
+
'/receive/rest/event'
URL_economy
=
URL
+
'/receive/rest/economy'
URL_quest
=
URL
+
'/receive/rest/quest'
URL_heart
=
URL
+
'/receive/rest/heartbeat'
network
=
'wifi'
os
=
'
ios
'
devicetype
=
'
iphone4s
'
os
=
'
android
'
devicetype
=
'
huaweimate
'
resolution
=
'123*456'
channelid
=
'111'
op
=
'中国移动'
itemname
=
'测试5'
itemtotalprice
=
'99'
itemname
=
random
.
randint
(
100
,
900
)
itemtotalprice
=
random
.
randint
(
101
,
303
)
itemamount
=
random
.
randint
(
1
,
10
)
serverid
=
1
campId
=
random
.
randint
(
1000
,
1002
)
level
=
random
.
randint
(
0
,
1001
)
class
allevent
:
def
event_install
(
self
,
i
,
appid
):
s
=
json
.
dumps
({
...
...
@@ -31,9 +38,9 @@ class allevent:
"context"
:
{
"deviceid"
:
i
,
"i
dfa
"
:
i
,
"idfv"
:
i
,
"channelid"
:
channelid
"i
mei
"
:
i
,
##
"idfv":i,
"channelid"
:
random
.
randint
(
111
,
113
)
}
})
p
=
requests
.
post
(
url
=
URL_install
,
data
=
s
,
headers
=
headers
,
timeout
=
4
)
...
...
@@ -44,9 +51,9 @@ class allevent:
"context"
:
{
"deviceid"
:
i
,
"i
dfa
"
:
i
,
"idfv"
:
i
,
"channelid"
:
channelid
,
"i
mei
"
:
i
,
# #
"idfv":i,
"channelid"
:
random
.
randint
(
111
,
113
)
,
"network"
:
network
,
"os"
:
os
,
"devicetype"
:
devicetype
,
...
...
@@ -63,10 +70,10 @@ class allevent:
"context"
:
{
"deviceid"
:
i
,
#"idfa
":i,
#"idfv":i,
"imei
"
:
i
,
#
#
"idfv":i,
"serverid"
:
serverid
,
"channelid"
:
channelid
"channelid"
:
random
.
randint
(
111
,
113
)
}
})
p
=
requests
.
post
(
url
=
URL_register
,
data
=
s
,
headers
=
headers
,
timeout
=
4
)
...
...
@@ -79,8 +86,8 @@ class allevent:
"context"
:
{
"deviceid"
:
i
,
# "idfa
":i,
# "idfv":i,
"imei
"
:
i
,
#
#
"idfv":i,
"serverid"
:
serverid
,
"channelid"
:
channelid
}
...
...
@@ -94,13 +101,13 @@ class allevent:
"context"
:
{
"deviceid"
:
i
,
"i
dfa
"
:
i
,
"idfv"
:
i
,
"channelid"
:
channelid
,
"i
mei
"
:
i
,
#
"idfv":i,
"channelid"
:
random
.
randint
(
111
,
113
)
,
"transactionid"
:
"12323232131321"
,
"paymenttype"
:
"支付宝"
,
"currencytype"
:
"CNY"
,
"currencyamount"
:
"100"
,
"currencyamount"
:
random
.
randint
(
100
,
500
)
,
"virtualcoinamount"
:
"500"
,
"iapname"
:
"test"
,
"iapamount"
:
"3"
,
...
...
@@ -117,8 +124,8 @@ class allevent:
"context"
:
{
"deviceid"
:
i
,
# "i
dfa
":i,
# "idfv":i,
# "i
mei
":i,
#
#
"idfv":i,
"serverid"
:
serverid
,
"channelid"
:
channelid
}
...
...
@@ -126,21 +133,62 @@ class allevent:
p
=
requests
.
post
(
url
=
URL_event
,
data
=
s
,
headers
=
headers
,
timeout
=
4
)
print
(
p
.
text
)
def
event_economy
(
self
,
i
,
appid
,
campId
):
def
event_economy
(
self
,
i
,
appid
):
s
=
json
.
dumps
({
"appid"
:
appid
,
"who"
:
i
,
"context"
:
{
"deviceid"
:
i
,
"i
dfa
"
:
i
,
"idfv"
:
i
,
"channelid"
:
channelid
,
"itemamount"
:
"1"
,
"itemname"
:
itemname
,
"i
mei
"
:
i
,
#
"idfv":i,
"channelid"
:
random
.
randint
(
111
,
113
)
,
"itemamount"
:
random
.
randint
(
1
,
20
)
,
"itemname"
:
random
.
randint
(
100
,
111
)
,
"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
)
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
)
\ No newline at end of file
testcase/game/imei.json
View file @
e16bdf85
{
"imei"
:
400000000000002
"imei"
:
50100000000499
}
\ No newline at end of file
testcase/run_all_cases.py
View file @
e16bdf85
...
...
@@ -15,9 +15,9 @@ 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
)
#
IMEI = json.load(open('imei.json', 'r+'))['imei'] + 1
#
json.dump({"imei": IMEI}, open('imei.json', 'w+'), sort_keys=True, indent=4)
#
print(IMEI)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment