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
c75c84cf
Commit
c75c84cf
authored
Aug 25, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2b859933
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
3 deletions
+108
-3
workspace.xml
.idea/workspace.xml
+0
-0
params.py
config/prod/params.py
+60
-0
test_appduration.py
testcase/android_events/test_appduration.py
+23
-0
test_pageduration.py
testcase/android_events/test_pageduration.py
+24
-0
test_startup.py
testcase/android_events/test_startup.py
+1
-3
No files found.
.idea/workspace.xml
View file @
c75c84cf
This diff is collapsed.
Click to expand it.
config/prod/params.py
View file @
c75c84cf
...
...
@@ -315,3 +315,62 @@ params_adclick = {
# 'ds': ds,
'who'
:
'lxx_test'
}
params_pageduration
=
{
"appid"
:
prod
[
'events'
][
'appkey'
],
"context"
:
{
'_pageid'
:
"pageId"
,
"_sessionid"
:
"sessionID"
,
'_pageduration'
:
"1000"
,
"_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'
}
params_appduration
=
{
"appid"
:
prod
[
'events'
][
'appkey'
],
"context"
:
{
"_appduration"
:
"10"
,
"_sessionid"
:
"sessionID"
,
"_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'
}
\ No newline at end of file
testcase/android_events/test_appduration.py
0 → 100644
View file @
c75c84cf
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_appduration.py
@time: 2020/8/24 20:21
@desc:
"""
import
unittest
import
json
import
requests
from
config.envcfg
import
prod
,
headers
from
config.prod.params
import
params_appduration
class
appdurationTestCase
(
unittest
.
TestCase
):
def
testappduration
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'appduration'
,
data
=
json
.
dumps
(
params_appduration
),
headers
=
headers
,
timeout
=
5
)
print
(
"App使用时长:"
+
r
.
text
)
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_pageduration.py
0 → 100644
View file @
c75c84cf
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_pageduration.py
@time: 2020/8/24 18:19
@desc:
"""
import
unittest
import
json
import
requests
from
config.envcfg
import
prod
,
headers
from
config.prod.params
import
params_pageduration
class
pagedurationTestCase
(
unittest
.
TestCase
):
def
testpageduration
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'pageduration'
,
data
=
json
.
dumps
(
params_pageduration
),
headers
=
headers
,
timeout
=
5
)
print
(
"App页面浏览时长分布:"
+
r
.
text
)
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
testcase/android_events/test_startup.py
View file @
c75c84cf
...
...
@@ -17,7 +17,6 @@ class startupTestCase(unittest.TestCase):
def
teststartup
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'startup'
,
data
=
json
.
dumps
(
params_startup
),
headers
=
headers
,
timeout
=
10
)
print
(
r
.
text
+
"
\n
"
+
r
.
url
)
#print(r.url)
if
__name__
==
"__main__"
:
unittest
.
main
()
\ No newline at end of file
unittest
.
main
()
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