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
8416dcaa
Commit
8416dcaa
authored
4 years ago
by
zhaihuitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
bcf1020a
master
…
dev2021
No related merge requests found
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
11 deletions
+10
-11
workspace.xml
.idea/workspace.xml
+0
-0
envcfg.py
config/envcfg.py
+4
-4
config.ini
config/setting/config.ini
+2
-1
test_click.py
testcase/android_click/test_click.py
+2
-2
test_login.py
testcase/android_events/test_login.py
+0
-2
test_startup.py
testcase/android_events/test_startup.py
+2
-2
No files found.
.idea/workspace.xml
View file @
8416dcaa
This diff is collapsed.
Click to expand it.
config/envcfg.py
View file @
8416dcaa
...
@@ -17,17 +17,17 @@ sys.path.append(base_path)
...
@@ -17,17 +17,17 @@ sys.path.append(base_path)
# 生产环境:
# 生产环境:
path
=
"/Users/zhaihuitao/PycharmProjects/TKIO/interfaceTest/config/setting/config.ini"
path
=
"/Users/zhaihuitao/PycharmProjects/TKIO/interfaceTest/config/setting/config.ini"
rc
=
read_config
(
path
)
rc
=
read_config
(
path
)
url
=
rc
.
get
(
"env"
,
"
prod_
click_url"
)
url
=
rc
.
get
(
"env"
,
"click_url"
)
print
(
url
)
print
(
url
)
print
(
base_path
)
print
(
base_path
)
prod_
click_url
=
'http://uri6.com/tkio/Er6BFna'
click_url
=
'http://uri6.com/tkio/Er6BFna'
# prod_event_url = 'http://log.trackingio.com'
# prod_event_url = 'http://log.trackingio.com'
prod_event_url
=
'http://10.3.20.42:8080'
prod_event_url
=
'http://10.3.20.42:8080'
test_event_url
=
'http://10.3.20.42:8080'
test_event_url
=
'http://10.3.20.42:8080'
# prod_appkey = "0d401839250deff23daf62fd49a444cb
"
prod_appkey
=
"57ed2dd31596bb4682471e82c0c73c1a
"
prod_appkey
=
"0d401839250deff23daf62fd49a444cb
"
# prod_appkey = "57ed2dd31596bb4682471e82c0c73c1a
"
event_interface
=
dict
(
install
=
'/receive/tkio/install'
,
loggedin
=
'/receive/tkio/loggedin'
,
event_interface
=
dict
(
install
=
'/receive/tkio/install'
,
loggedin
=
'/receive/tkio/loggedin'
,
pageduration
=
'/receive/tkio/pageduration'
,
payment
=
'/receive/tkio/payment'
,
pageduration
=
'/receive/tkio/pageduration'
,
payment
=
'/receive/tkio/payment'
,
order
=
'/receive/tkio/order'
,
register
=
'/receive/tkio/register'
,
order
=
'/receive/tkio/order'
,
register
=
'/receive/tkio/register'
,
...
...
This diff is collapsed.
Click to expand it.
config/setting/config.ini
View file @
8416dcaa
[env]
[env]
prod_
click_url
=
http://uri6.com/tkio/Er6BFna
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
=
{"events": ['/receive/tkio/install']}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
testcase/android_click/test_click.py
View file @
8416dcaa
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
"""
"""
import
unittest
import
unittest
from
config.envcfg
import
prod_
click_url
from
config.envcfg
import
click_url
from
config.prod.params
import
params_click
from
config.prod.params
import
params_click
import
requests
import
requests
import
os
import
os
...
@@ -19,7 +19,7 @@ sys.path.append(base_path)
...
@@ -19,7 +19,7 @@ sys.path.append(base_path)
class
clickTestCase
(
unittest
.
TestCase
):
class
clickTestCase
(
unittest
.
TestCase
):
def
testclick
(
self
):
def
testclick
(
self
):
p
=
requests
.
get
(
url
=
prod_
click_url
,
params
=
params_click
,
timeout
=
30
,
verify
=
False
)
p
=
requests
.
get
(
url
=
click_url
,
params
=
params_click
,
timeout
=
30
,
verify
=
False
)
# self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
# self.assertEqual(p.status_code, 300, msg='接口异常,请检查')
print
(
'执行结果:
\n
================='
)
print
(
'执行结果:
\n
================='
)
print
(
p
)
print
(
p
)
...
...
This diff is collapsed.
Click to expand it.
testcase/android_events/test_login.py
View file @
8416dcaa
...
@@ -17,7 +17,6 @@ class loninTestCase(unittest.TestCase):
...
@@ -17,7 +17,6 @@ class loninTestCase(unittest.TestCase):
def
testlogin
(
self
):
def
testlogin
(
self
):
r
=
requests
.
post
(
url
=
prod_event_url
+
event_interface
[
"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
This diff is collapsed.
Click to expand it.
testcase/android_events/test_startup.py
View file @
8416dcaa
...
@@ -9,13 +9,13 @@
...
@@ -9,13 +9,13 @@
import
unittest
import
unittest
import
json
import
json
import
requests
import
requests
from
config.envcfg
import
test
_event_url
,
headers
,
event_interface
from
config.envcfg
import
prod
_event_url
,
headers
,
event_interface
from
config.prod.params
import
params_startup
from
config.prod.params
import
params_startup
class
startupTestCase
(
unittest
.
TestCase
):
class
startupTestCase
(
unittest
.
TestCase
):
def
teststartup
(
self
):
def
teststartup
(
self
):
r
=
requests
.
post
(
url
=
test
_event_url
+
event_interface
[
"startup"
],
data
=
json
.
dumps
(
params_startup
),
headers
=
headers
,
timeout
=
10
)
r
=
requests
.
post
(
url
=
prod
_event_url
+
event_interface
[
"startup"
],
data
=
json
.
dumps
(
params_startup
),
headers
=
headers
,
timeout
=
10
)
print
(
r
.
text
+
"
\n
"
+
r
.
url
)
print
(
r
.
text
+
"
\n
"
+
r
.
url
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
This diff is collapsed.
Click to expand it.
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