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
62e34d38
Commit
62e34d38
authored
Aug 18, 2020
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add login enevt
parent
9d8d67a4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
70 deletions
+103
-70
workspace.xml
.idea/workspace.xml
+0
-0
randomUtil.py
common/randomUtil.py
+0
-2
params.py
config/prod/params.py
+84
-68
test_login.py
testcase/android_events/test_login.py
+19
-0
No files found.
.idea/workspace.xml
View file @
62e34d38
This diff is collapsed.
Click to expand it.
common/randomUtil.py
View file @
62e34d38
...
@@ -12,8 +12,6 @@ import random
...
@@ -12,8 +12,6 @@ import random
class
randomUtil
:
class
randomUtil
:
def
__init__
(
self
):
pass
def
randip
(
self
):
def
randip
(
self
):
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
ip
=
socket
.
inet_ntoa
(
struct
.
pack
(
'>I'
,
random
.
randint
(
1
,
0xffffffff
)))
...
...
config/prod/params.py
View file @
62e34d38
...
@@ -10,78 +10,94 @@ import time
...
@@ -10,78 +10,94 @@ import time
from
config.envcfg
import
prod
from
config.envcfg
import
prod
from
common
import
randomUtil
from
common
import
randomUtil
params_install
=
{
"what"
:
'install'
,
"appid"
:
prod
[
'events'
][
'appkey'
],
"context"
:
{
"_carrier"
:
"中国联通"
,
"_network_type"
:
"5G"
,
"_ryosversion"
:
"10.0.0"
,
"_model"
:
"test1"
,
"_pkgname"
:
"com.yanjing.yami"
,
"_campaignid"
:
'default'
,
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
"_imei"
:
randomUtil
.
r
.
randimei
(),
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
# "_androidid": "43214532142142",
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip"
:
randomUtil
.
r
.
randip
(),
# "_ipv6": i,
'_manufacturer'
:
"HUAWEI"
,
'_ryos'
:
"Android"
,
'_rydevicetype'
:
"LYA-AL00"
,
'_network'
:
"WIFI"
,
'_resolution'
:
"1080*2265"
,
'_op'
:
"中国移动"
,
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
'_oaid'
:
'234B9U1T-A274-ED22-CEBF-4B6DDDFC18A9'
,
# '_mac': "12321321321321321",
"_istablet"
:
"phone"
,
"_lib"
:
"Android"
,
"_lib_version"
:
"1.5.0"
,
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# 'ds': ds,
'who'
:
'lxx_test'
}
params_startup
=
{
# 'what': 'startup',
'appid'
:
"9b17c1568c3ce34599c5fd2778483ff9"
,
'context'
:
{
'_deviceid'
:
"CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1"
,
'_imei'
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
'_androidid'
:
"43214532142142"
,
'_ip'
:
"119.57.108.226"
,
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
"_lib_version"
:
"1.5.0"
,
# "_campaignid": 'default',
# "_deviceid": i,
# "_imei": i,
# # "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# # "_imei2":"324323AAAA",
# # "_meid": "CCC324323",
# "_ip": IP,
# # "_ipv6": i,
# '_manufacturer': manufacturer,
# '_ryos': ryos,
# '_rydevicetype': rydevicetype,
# '_network': network,
# '_resolution': resolution,
# '_op': op,
# '_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# # '_mac':"565354131606"
params_install
=
{
},
"what"
:
'install'
,
# 'when': when,
"appid"
:
prod
[
'events'
][
'appkey'
],
# 'ds': ds,
"context"
:
{
'who'
:
'lxx_test'
"_carrier"
:
"中国联通"
,
}
"_network_type"
:
"5G"
,
"_ryosversion"
:
"10.0.0"
,
params_login
=
{
"_model"
:
"test1"
,
# 'what': 'loggedin',
"_pkgname"
:
"com.yanjing.yami"
,
'appid'
:
prod
[
'events'
][
'appkey'
],
"_campaignid"
:
'default'
,
'context'
:
{
"_deviceid"
:
randomUtil
.
r
.
randimei
(),
'_deviceid'
:
randomUtil
.
r
.
randimei
(),
"_imei"
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
'_imei'
:
randomUtil
.
r
.
randimei
(),
# "_idfa": 'DBC13622-E34B-440C-B7A7-FB6641D0D9AB',
'_androidid'
:
randomUtil
.
r
.
randimei
(),
# "_androidid": "43214532142142",
'_ip'
:
randomUtil
.
r
.
randip
(),
# "_imei2":"324323AAAA",
# "_meid": "CCC324323",
"_ip"
:
randomUtil
.
r
.
randip
(),
# "_ipv6": i,
'_manufacturer'
:
"HUAWEI"
,
'_ryos'
:
"Android"
,
'_ryos'
:
"Android"
,
'_rydevicetype'
:
"LYA-AL00"
,
'_network'
:
"WIFI"
,
'_resolution'
:
"1080*2265"
,
'_op'
:
"中国移动"
,
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
'_oaid'
:
'234B9U1T-A274-ED22-CEBF-4B6DDDFC18A9'
,
# '_mac': "12321321321321321",
"_istablet"
:
"phone"
,
"_lib"
:
"Android"
,
"_lib_version"
:
"1.5.0"
,
"_lib_version"
:
"1.5.0"
,
# '_rydevicetype': rydevicetype,
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
# "_idfa": "00000000-0000-0000-0000-000000000000",
# "_idfv": ""
},
},
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# 'when': time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())),
# time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
# 'ds': ds,
# 'ds': ds,
'who'
:
'lxx_test'
'who'
:
'lxx_test'
}
}
\ No newline at end of file
params_startup
=
{
# 'what': 'startup',
'appid'
:
"9b17c1568c3ce34599c5fd2778483ff9"
,
'context'
:
{
'_deviceid'
:
"CFFEF74E-B6BF-BD16-E7F8-DFDBFF5FB6E1"
,
'_imei'
:
"cffef74e-b6bf-bd16-e7f8-dfdbff5fb6e1"
,
'_androidid'
:
"43214532142142"
,
'_ip'
:
"119.57.108.226"
,
'_timestamp'
:
int
(
round
(
time
.
time
()
*
1000
)),
"_lib_version"
:
"1.5.0"
,
# "_campaignid": 'default',
# "_deviceid": i,
# "_imei": i,
# # "_idfa": '75463565745634546',
# "_androidid": "424653325643",
# # "_imei2":"324323AAAA",
# # "_meid": "CCC324323",
# "_ip": IP,
# # "_ipv6": i,
# '_manufacturer': manufacturer,
# '_ryos': ryos,
# '_rydevicetype': rydevicetype,
# '_network': network,
# '_resolution': resolution,
# '_op': op,
# '_timestamp': current_time_13,
# '_oaid': '999b6e3e-a274-ed22-cebf-2b6dddfc29b7'
# # '_mac':"565354131606"
},
# 'when': when,
# 'ds': ds,
'who'
:
'lxx_test'
}
print
(
params_install
)
\ No newline at end of file
testcase/android_events/test_login.py
0 → 100644
View file @
62e34d38
# -*- coding: utf-8 -*-
"""
@author:zhaiht
@file: test_login.py
@time: 2020/8/18 15:54
@desc:
"""
import
unittest
import
json
import
requests
from
config.envcfg
import
prod
,
headers
from
config.prod.params
import
params_login
class
loninTestCase
(
unittest
.
TestCase
):
def
testlogin
(
self
):
r
=
requests
.
post
(
url
=
prod
[
'events'
][
'url'
]
+
'loggedin'
,
data
=
json
.
dumps
(
params_login
),
headers
=
headers
,
timeout
=
10
)
print
(
"登录"
+
r
.
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