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
fff0b935
Commit
fff0b935
authored
Sep 21, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2ca44b4e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
46 additions
and
35 deletions
+46
-35
workspace.xml
.idea/workspace.xml
+0
-0
envcfg.py
config/envcfg.py
+13
-3
params.py
config/prod/params.py
+15
-15
test_batchUpload.py
testcase/android_events/test_batchUpload.py
+2
-2
test_custom.py
testcase/android_events/test_custom.py
+2
-2
test_install.py
testcase/android_events/test_install.py
+2
-2
test_login.py
testcase/android_events/test_login.py
+4
-2
test_pageduration.py
testcase/android_events/test_pageduration.py
+2
-2
test_payment.py
testcase/android_events/test_payment.py
+2
-3
test_payorder.py
testcase/android_events/test_payorder.py
+2
-2
test_register.py
testcase/android_events/test_register.py
+2
-2
No files found.
.idea/workspace.xml
View file @
fff0b935
This diff is collapsed.
Click to expand it.
config/envcfg.py
View file @
fff0b935
...
@@ -6,19 +6,29 @@
...
@@ -6,19 +6,29 @@
@desc:
@desc:
"""
"""
from
numpy
import
long
from
numpy
import
long
import
os
,
sys
from
common.iniUtil
import
read_config
from
common.iniUtil
import
read_config
import
time
import
time
base_path
=
os
.
getcwd
()
sys
.
path
.
append
(
base_path
)
# 测试环境
# 测试环境
# 生产环境:
# 生产环境:
read_config
()
path
=
"/Users/zhaihuitao/PycharmProjects/TKIO/interfaceTest/config/setting/config.ini"
rc
=
read_config
(
path
)
url
=
rc
.
get
(
"env"
,
"prod_click_url"
)
print
(
url
)
print
(
base_path
)
prod_click_url
=
'http://uri6.com/tkio/Er6BFna'
prod_click_url
=
'http://uri6.com/tkio/Er6BFna'
prod_event_url
=
'http://log.trackingio.com'
prod_event_url
=
'http://log.trackingio.com'
prod_appkey
=
"895c5256a7f47bd2cca88a29da9e978a"
prod_appkey
=
"895c5256a7f47bd2cca88a29da9e978a"
event_interface
=
{
"events"
:
[
'/receive/tkio/install'
]}
event_interface
=
dict
(
install
=
'/receive/tkio/install'
,
loggedin
=
'/receive/tkio/loggedin'
,
pageduration
=
'/receive/tkio/pageduration'
,
payment
=
'/receive/tkio/payment'
,
order
=
'/receive/tkio/order'
,
register
=
'/receive/tkio/register'
,
startup
=
'/receive/tkio/startup'
,
event
=
'/receive/tkio/event'
)
prod
=
{
prod
=
{
...
...
config/prod/params.py
View file @
fff0b935
...
@@ -94,7 +94,7 @@ params_install = {
...
@@ -94,7 +94,7 @@ params_install = {
params_startup
=
{
params_startup
=
{
# 'what': 'startup',
# 'what': 'startup',
'appid'
:
"9b17c1568c3ce34599c5fd2778483ff9"
,
'appid'
:
prod_appkey
,
'context'
:
{
'context'
:
{
'_deviceid'
:
"CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1"
,
'_deviceid'
:
"CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1"
,
'_imei'
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
'_imei'
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
...
@@ -129,7 +129,7 @@ params_startup = {
...
@@ -129,7 +129,7 @@ params_startup = {
params_login
=
{
params_login
=
{
# 'what': 'loggedin',
# 'what': 'loggedin',
'appid'
:
prod
[
'events'
][
'appkey'
]
,
'appid'
:
prod
_appkey
,
'context'
:
{
'context'
:
{
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
...
@@ -148,7 +148,7 @@ params_login = {
...
@@ -148,7 +148,7 @@ params_login = {
}
}
params_formate
=
{
params_formate
=
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"context"
:
{
"_campaignid"
:
'default'
,
"_campaignid"
:
'default'
,
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
...
@@ -175,7 +175,7 @@ params_formate = {
...
@@ -175,7 +175,7 @@ params_formate = {
params_register
=
{
params_register
=
{
'what'
:
'register'
,
'what'
:
'register'
,
'appid'
:
prod
[
'events'
][
'appkey'
]
,
'appid'
:
prod
_appkey
,
'context'
:
{
'context'
:
{
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
# '_imei':i,
# '_imei':i,
...
@@ -195,7 +195,7 @@ params_register = {
...
@@ -195,7 +195,7 @@ params_register = {
params_pay
=
{
params_pay
=
{
'what'
:
'payment'
,
'what'
:
'payment'
,
'appid'
:
prod
[
'events'
][
'appkey'
]
,
'appid'
:
prod
_appkey
,
'context'
:
{
'context'
:
{
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
...
@@ -220,7 +220,7 @@ params_pay = {
...
@@ -220,7 +220,7 @@ params_pay = {
params_payorder
=
{
params_payorder
=
{
'what'
:
"order"
,
'what'
:
"order"
,
'appid'
:
prod
[
'events'
][
'appkey'
]
,
'appid'
:
prod
_appkey
,
'context'
:
{
'context'
:
{
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
...
@@ -242,7 +242,7 @@ params_payorder = {
...
@@ -242,7 +242,7 @@ params_payorder = {
params_custom
=
{
params_custom
=
{
'what'
:
"event"
,
'what'
:
"event"
,
'appid'
:
prod
[
'events'
][
'appkey'
]
,
'appid'
:
prod
_appkey
,
'context'
:
{
'context'
:
{
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
'_imei'
:
randomUtil
.
r
.
randimei
(),
...
@@ -259,7 +259,7 @@ params_custom = {
...
@@ -259,7 +259,7 @@ params_custom = {
}
}
params_adshow
=
{
params_adshow
=
{
"appid"
:
prod
[
"events"
][
"appkey"
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"context"
:
{
'_adPlatform'
:
"mintegral"
,
'_adPlatform'
:
"mintegral"
,
'_adId'
:
"adid"
,
'_adId'
:
"adid"
,
...
@@ -289,7 +289,7 @@ params_adshow = {
...
@@ -289,7 +289,7 @@ params_adshow = {
}
}
params_adclick
=
{
params_adclick
=
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"context"
:
{
'_adPlatform'
:
"mintegral"
,
'_adPlatform'
:
"mintegral"
,
'_adId'
:
"adid"
,
'_adId'
:
"adid"
,
...
@@ -318,7 +318,7 @@ params_adclick = {
...
@@ -318,7 +318,7 @@ params_adclick = {
}
}
params_pageduration
=
{
params_pageduration
=
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"context"
:
{
'_pageid'
:
"pageId"
,
'_pageid'
:
"pageId"
,
"_sessionid"
:
"sessionID"
,
"_sessionid"
:
"sessionID"
,
...
@@ -348,7 +348,7 @@ params_pageduration = {
...
@@ -348,7 +348,7 @@ params_pageduration = {
}
}
params_appduration
=
{
params_appduration
=
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"context"
:
{
"_appduration"
:
"10"
,
"_appduration"
:
"10"
,
"_sessionid"
:
"sessionID"
,
"_sessionid"
:
"sessionID"
,
...
@@ -378,7 +378,7 @@ params_appduration = {
...
@@ -378,7 +378,7 @@ params_appduration = {
params_batchUpload1
=
{
params_batchUpload1
=
{
"from"
:
"tkio"
,
"data"
:
[
"from"
:
"tkio"
,
"data"
:
[
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
{
"appid"
:
prod
_appkey
,
"when"
:
"2018-01-08 11:22:42"
,
"when"
:
"2018-01-08 11:22:42"
,
"what"
:
"startup"
,
"what"
:
"startup"
,
"context"
:
{
"_manufacturer"
:
"苹果"
,
"context"
:
{
"_manufacturer"
:
"苹果"
,
...
@@ -404,7 +404,7 @@ params_batchUpload1 = {
...
@@ -404,7 +404,7 @@ params_batchUpload1 = {
"_campaignid"
:
"channelid"
,
"_campaignid"
:
"channelid"
,
"_idfa"
:
"FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"
},
"_idfa"
:
"FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"
},
"who"
:
"unknown"
},
"who"
:
"unknown"
},
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
{
"appid"
:
prod
_appkey
,
"when"
:
"2018-01-08 11:22:42"
,
"when"
:
"2018-01-08 11:22:42"
,
"what"
:
"register"
,
"what"
:
"register"
,
"context"
:
{
"_manufacturer"
:
"苹果"
,
"context"
:
{
"_manufacturer"
:
"苹果"
,
...
@@ -434,7 +434,7 @@ params_batchUpload1 = {
...
@@ -434,7 +434,7 @@ params_batchUpload1 = {
params_batchUpload
=
{
params_batchUpload
=
{
"from"
:
"tkio"
,
"data"
:
[
"from"
:
"tkio"
,
"data"
:
[
{
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"when"
:
"2018-01-08 11:22:42"
,
"what"
:
"startup"
,
{
"appid"
:
prod
_appkey
,
"when"
:
"2018-01-08 11:22:42"
,
"what"
:
"startup"
,
"context"
:
{
"_manufacturer"
:
"苹果"
,
"_carrier"
:
"unknown"
,
"_lats"
:
"1"
,
"_jbk"
:
"1"
,
"context"
:
{
"_manufacturer"
:
"苹果"
,
"_carrier"
:
"unknown"
,
"_lats"
:
"1"
,
"_jbk"
:
"1"
,
"_app_version"
:
"1.0"
,
"_timestamp"
:
"1515381771925"
,
"_create_timestamp"
:
"1515381762624"
,
"_app_version"
:
"1.0"
,
"_timestamp"
:
"1515381771925"
,
"_create_timestamp"
:
"1515381762624"
,
"_rydevicetype"
:
"iPhone"
,
"_deviceid"
:
"FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"
,
"_rydevicetype"
:
"iPhone"
,
"_deviceid"
:
"FD8A5386-C25B-49D8-A0F3-2E61B179DA0E"
,
...
@@ -460,7 +460,7 @@ params_batchUpload = {
...
@@ -460,7 +460,7 @@ params_batchUpload = {
params_h5
=
{
params_h5
=
{
"what"
:
"download"
,
"what"
:
"download"
,
"appType"
:
"wap"
,
"appType"
:
"wap"
,
"appid"
:
prod
[
'events'
][
'appkey'
]
,
"appid"
:
prod
_appkey
,
"context"
:
{
"context"
:
{
"_campaignid"
:
"_default_"
,
"_campaignid"
:
"_default_"
,
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
...
...
testcase/android_events/test_batchUpload.py
View file @
fff0b935
...
@@ -10,11 +10,11 @@
...
@@ -10,11 +10,11 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
from
config.prod.params
import
params_batchUpload
from
config.prod.params
import
params_batchUpload
class
batchUploadTestCase
(
unittest
.
TestCase
):
class
batchUploadTestCase
(
unittest
.
TestCase
):
def
testbatchUpload
(
self
):
def
testbatchUpload
(
self
):
p
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
,
data
=
json
.
dumps
(
params_batchUpload
),
headers
=
headers
,
timeout
=
5
)
p
=
requests
.
post
(
url
=
prod
_event_url
,
data
=
json
.
dumps
(
params_batchUpload
),
headers
=
headers
,
timeout
=
5
)
print
(
"自定义"
+
p
.
text
)
print
(
"自定义"
+
p
.
text
)
testcase/android_events/test_custom.py
View file @
fff0b935
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_custom
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
_event_url
+
event_interface
[
"event"
]
,
data
=
json
.
dumps
(
params_custom
),
headers
=
headers
,
timeout
=
5
)
print
(
"自定义"
+
p
.
text
)
print
(
"自定义"
+
p
.
text
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
testcase/android_events/test_install.py
View file @
fff0b935
...
@@ -14,10 +14,10 @@ from config.prod.params import params_install
...
@@ -14,10 +14,10 @@ from config.prod.params import params_install
class
installTestCase
(
unittest
.
TestCase
):
class
installTestCase
(
unittest
.
TestCase
):
def
testinstall
(
self
):
def
testinstall
(
self
):
r
=
requests
.
post
(
url
=
prod_event_url
+
event_interface
[
"
events"
][
0
],
data
=
json
.
dumps
(
params_install
),
headers
=
headers
)
r
=
requests
.
post
(
url
=
prod_event_url
+
event_interface
[
"
install"
],
data
=
json
.
dumps
(
params_install
),
headers
=
headers
)
print
(
"
\n
激活事件执行结果:"
+
r
.
text
)
print
(
"
\n
激活事件执行结果:"
+
r
.
text
)
print
(
r
.
url
)
print
(
r
.
url
)
#self.assertEqual(r.status_code, 200, msg="执行失败,请检查")
#
self.assertEqual(r.status_code, 200, msg="执行失败,请检查")
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
testcase/android_events/test_login.py
View file @
fff0b935
...
@@ -9,14 +9,15 @@
...
@@ -9,14 +9,15 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_login
from
config.prod.params
import
params_login
class
loninTestCase
(
unittest
.
TestCase
):
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
_event_url
+
event_interface
[
"loggedin"
]
,
data
=
json
.
dumps
(
params_login
),
headers
=
headers
,
timeout
=
10
)
print
(
"登录"
+
r
.
text
)
print
(
"登录"
+
r
.
text
)
print
(
prod_event_url
+
event_interface
[
1
])
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
unittest
.
main
()
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_pageduration.py
View file @
fff0b935
...
@@ -10,13 +10,13 @@
...
@@ -10,13 +10,13 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_pageduration
from
config.prod.params
import
params_pageduration
class
pagedurationTestCase
(
unittest
.
TestCase
):
class
pagedurationTestCase
(
unittest
.
TestCase
):
def
testpageduration
(
self
):
def
testpageduration
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'pageduration'
,
data
=
json
.
dumps
(
params_pageduration
),
headers
=
headers
,
timeout
=
5
)
r
=
requests
.
post
(
url
=
prod
_event_url
+
event_interface
[
"pageduration"
]
,
data
=
json
.
dumps
(
params_pageduration
),
headers
=
headers
,
timeout
=
5
)
print
(
"App页面浏览时长分布:"
+
r
.
text
)
print
(
"App页面浏览时长分布:"
+
r
.
text
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
testcase/android_events/test_payment.py
View file @
fff0b935
...
@@ -9,15 +9,14 @@
...
@@ -9,15 +9,14 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_pay
from
config.prod.params
import
params_pay
class
payTestCase
(
unittest
.
TestCase
):
class
payTestCase
(
unittest
.
TestCase
):
def
testpayment
(
self
):
def
testpayment
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'payment'
,
data
=
json
.
dumps
(
params_pay
),
headers
=
headers
,
timeout
=
5
)
r
=
requests
.
post
(
url
=
prod
_event_url
+
event_interface
[
"payment"
]
,
data
=
json
.
dumps
(
params_pay
),
headers
=
headers
,
timeout
=
5
)
print
(
"付费"
+
r
.
text
)
print
(
"付费"
+
r
.
text
)
print
(
prod
[
'events'
][
'url'
]
+
'payment'
)
print
(
json
.
dumps
(
params_pay
))
print
(
json
.
dumps
(
params_pay
))
print
(
r
)
print
(
r
)
...
...
testcase/android_events/test_payorder.py
View file @
fff0b935
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_payorder
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
_event_url
+
event_interface
[
"order"
]
,
data
=
json
.
dumps
(
params_payorder
),
headers
=
headers
,
timeout
=
5
)
print
(
"订单"
+
p
.
text
)
print
(
"订单"
+
p
.
text
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
testcase/android_events/test_register.py
View file @
fff0b935
...
@@ -10,13 +10,13 @@
...
@@ -10,13 +10,13 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
prod
,
headers
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_register
from
config.prod.params
import
params_register
class
registerTestCase
(
unittest
.
TestCase
):
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
_event_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
)
...
...
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