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
2b859933
Commit
2b859933
authored
Aug 24, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
bb218573
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
79 additions
and
8 deletions
+79
-8
workspace.xml
.idea/workspace.xml
+0
-0
params.py
config/prod/params.py
+28
-0
test_adclick.py
testcase/android_events/test_adclick.py
+23
-0
test_adshow.py
testcase/android_events/test_adshow.py
+5
-2
test_custom.py
testcase/android_events/test_custom.py
+5
-2
test_login.py
testcase/android_events/test_login.py
+4
-0
test_payment.py
testcase/android_events/test_payment.py
+4
-0
test_payorder.py
testcase/android_events/test_payorder.py
+5
-2
test_register.py
testcase/android_events/test_register.py
+5
-2
No files found.
.idea/workspace.xml
View file @
2b859933
This diff is collapsed.
Click to expand it.
config/prod/params.py
View file @
2b859933
...
@@ -287,3 +287,31 @@ params_adshow = {
...
@@ -287,3 +287,31 @@ params_adshow = {
'who'
:
'lxx_test'
'who'
:
'lxx_test'
}
}
params_adclick
=
{
"appid"
:
prod
[
'events'
][
'appkey'
],
"context"
:
{
'_adPlatform'
:
"mintegral"
,
'_adId'
:
"adid"
,
"_campaignid"
:
'default'
,
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
"_imei"
:
randomUtil
.
r
.
randimei
(),
# "_idfa": '75463565745634546',
"_androidid"
:
"424653325643"
,
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip"
:
randomUtil
.
r
.
randip
(),
# "_ipv6": i,
'_manufacturer'
:
"vivo"
,
'_ryos'
:
"android"
,
'_rydevicetype'
:
"vivox9"
,
'_network'
:
"wifi"
,
'_resolution'
:
"1344*750"
,
'_op'
:
"中国移动"
,
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
'_oaid'
:
'999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# '_mac':"565354131606"
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'ds': ds,
'who'
:
'lxx_test'
}
testcase/android_events/test_adclick.py
0 → 100644
View file @
2b859933
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_adclick.py
@time: 2020/8/24 15:54
@desc:
"""
import
unittest
import
json
import
requests
from
config.envcfg
import
prod
,
headers
from
config.prod.params
import
params_adclick
class
adclickTestCase
(
unittest
.
TestCase
):
def
testadclick
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'adclick'
,
data
=
json
.
dumps
(
params_adclick
),
headers
=
headers
,
timeout
=
5
)
print
(
"广告点击:"
+
r
.
text
)
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_adshow.py
View file @
2b859933
...
@@ -16,4 +16,7 @@ from config.prod.params import params_adshow
...
@@ -16,4 +16,7 @@ from config.prod.params import params_adshow
class
adshowTestCase
(
unittest
.
TestCase
):
class
adshowTestCase
(
unittest
.
TestCase
):
def
testadshow
(
self
):
def
testadshow
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'adshow'
,
data
=
json
.
dumps
(
params_adshow
),
headers
=
headers
,
timeout
=
5
)
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'adshow'
,
data
=
json
.
dumps
(
params_adshow
),
headers
=
headers
,
timeout
=
5
)
print
(
"
\n
广告展示:"
+
r
.
text
)
print
(
"
\n
广告展示:"
+
r
.
text
)
\ No newline at end of file
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_custom.py
View file @
2b859933
...
@@ -16,4 +16,7 @@ from config.prod.params import params_custom
...
@@ -16,4 +16,7 @@ from config.prod.params import params_custom
class
customTestCase
(
unittest
.
TestCase
):
class
customTestCase
(
unittest
.
TestCase
):
def
testcustom
(
self
):
def
testcustom
(
self
):
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'event'
,
data
=
json
.
dumps
(
params_custom
),
headers
=
headers
,
timeout
=
5
)
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'event'
,
data
=
json
.
dumps
(
params_custom
),
headers
=
headers
,
timeout
=
5
)
print
(
"自定义"
+
p
.
text
)
print
(
"自定义"
+
p
.
text
)
\ No newline at end of file
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_login.py
View file @
2b859933
...
@@ -17,3 +17,6 @@ class loninTestCase(unittest.TestCase):
...
@@ -17,3 +17,6 @@ class loninTestCase(unittest.TestCase):
def
testlogin
(
self
):
def
testlogin
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'loggedin'
,
data
=
json
.
dumps
(
params_login
),
headers
=
headers
,
timeout
=
10
)
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'loggedin'
,
data
=
json
.
dumps
(
params_login
),
headers
=
headers
,
timeout
=
10
)
print
(
"登录"
+
r
.
text
)
print
(
"登录"
+
r
.
text
)
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_payment.py
View file @
2b859933
...
@@ -20,3 +20,6 @@ class payTestCase(unittest.TestCase):
...
@@ -20,3 +20,6 @@ class payTestCase(unittest.TestCase):
print
(
prod
[
'events'
][
'url'
]
+
'payment'
)
print
(
prod
[
'events'
][
'url'
]
+
'payment'
)
print
(
json
.
dumps
(
params_pay
))
print
(
json
.
dumps
(
params_pay
))
print
(
r
)
print
(
r
)
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_payorder.py
View file @
2b859933
...
@@ -16,4 +16,7 @@ from config.prod.params import params_payorder
...
@@ -16,4 +16,7 @@ from config.prod.params import params_payorder
class
payorderTestCase
(
unittest
.
TestCase
):
class
payorderTestCase
(
unittest
.
TestCase
):
def
testpayorder
(
self
):
def
testpayorder
(
self
):
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'order'
,
data
=
json
.
dumps
(
params_payorder
),
headers
=
headers
,
timeout
=
5
)
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'order'
,
data
=
json
.
dumps
(
params_payorder
),
headers
=
headers
,
timeout
=
5
)
print
(
"订单"
+
p
.
text
)
print
(
"订单"
+
p
.
text
)
\ No newline at end of file
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_register.py
View file @
2b859933
...
@@ -18,4 +18,7 @@ class registerTestCase(unittest.TestCase):
...
@@ -18,4 +18,7 @@ class registerTestCase(unittest.TestCase):
def
testregister
(
self
):
def
testregister
(
self
):
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'register'
,
data
=
json
.
dumps
(
params_register
),
headers
=
headers
,
timeout
=
10
)
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'register'
,
data
=
json
.
dumps
(
params_register
),
headers
=
headers
,
timeout
=
10
)
# print("注册时间戳"+current_time_13)
# print("注册时间戳"+current_time_13)
print
(
"注册"
+
p
.
text
)
print
(
"注册"
+
p
.
text
)
\ No newline at end of file
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
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