Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
InterfaceAutoTest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TestAuto
InterfaceAutoTest
Commits
102816fd
Commit
102816fd
authored
May 18, 2021
by
fanxun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
26e4750d
a0d3450c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
7 deletions
+24
-7
.gitignore
+1
-0
common/db.py
+5
-1
test_case/bmc/test_ ElectronicLicense.py
+18
-6
test_case_data/bmc/bmc_ele_License_2021513.xlsx
+0
-0
No files found.
.gitignore
View file @
102816fd
...
...
@@ -15,6 +15,7 @@ build
#myignore
log
test.py
debug.py
.idea
report/tmp/*.*
# Environments
...
...
common/db.py
View file @
102816fd
...
...
@@ -17,6 +17,9 @@ class RedisString(RedisBase):
"""获取值"""
result
=
self
.
r
.
get
(
xx
)
return
result
def
delete_key
(
self
,
xxx
):
self
.
r
.
delete
(
*
self
.
r
.
keys
(
f
'{xxx}*'
))
# mysql类
...
...
@@ -84,6 +87,7 @@ if __name__ == '__main__':
# r = RedisString(0).get('edl:sms_value:17822000010:MOBILE_REGISTER')
# print(r)
# print(str(r)[-7:-1])
pass
# pass
RedisString
(
0
)
.
delete_key
(
"bmc:c1:dl_img:uid"
)
test_case/bmc/test_ ElectronicLicense.py
View file @
102816fd
...
...
@@ -10,7 +10,7 @@ from service.login import BMY
from
common.tools
import
request_main
from
config
import
BaseConfig
,
BMCConfig
from
service.login
import
BMC
from
common.db
import
RedisString
from
common.db
import
RedisString
,
MYSQL
"""环境初始化和清除"""
# 1.headers获取
...
...
@@ -34,14 +34,28 @@ def get_vehickleId_Tounbind():
vehicleId
=
dic
[
'vehicleId'
]
return
vehicleId
@pytest.fixture
(
scope
=
'function'
)
def
avatarUpdate_del
()
:
#修改头像清除
mysql
=
MYSQL
(
host
=
"10.197.236.190"
,
port
=
3306
,
user
=
"root"
,
pwd
=
"123456"
,
db
=
"edl_private"
)
mysql
.
ExecuNonQuery
(
"DELETE FROM edl_private.driving_license_image_audit WHERE name='自动化';"
)
# 删除驾驶员
RedisString
(
0
)
.
delete_key
(
"bmc:c1:dl_img:uid"
)
yield
@pytest.fixture
(
scope
=
'function'
)
def
imaAuditStatus
():
# 查看照片审核状态
payload
=
{
"bNetTag"
:
"trf_mgt"
,
"avatarUrl"
:
"
\
/group1
\
/M00
\
/00
\
/11
\
/CsXswmCTvF-AOPy1AABzUjaImN072.JPEG"
,
"bCityCode"
:
"520100"
}
res
=
requests
.
post
(
f
"{BMCConfig().host}/drivingLicense/avatar/update"
,
json
=
payload
,
headers
=
headers
)
@allure.epic
(
"电子证照"
)
# @allure.feature("电子驾驶证")
class
TestDrivingLicense
():
workBook
=
xlrd
.
open_workbook
(
f
'{BaseConfig.root_path}/test_case_data/bmc/bmc_tk.xlsx'
)
workBook
=
xlrd
.
open_workbook
(
f
'{BaseConfig.root_path}/test_case_data/bmc/bmc_ele_License_2021513.xlsx'
)
def
setup_class
(
self
):
RedisString
(
0
)
.
delete_key
(
"edl:sms_total:18581438351"
)
# 删除发送验证码次数缓存
@allure.story
(
"二维码详情"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/81596"
)
@allure.description
(
"/dlVeh/qr"
)
...
...
@@ -74,7 +88,7 @@ class TestDrivingLicense():
"""断言"""
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.usefixtures
(
"imaAuditStatus"
)
@allure.story
(
"照片审核状态"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/22759"
)
@allure.description
(
"/drivingLicense/image/audit/status"
)
...
...
@@ -107,7 +121,7 @@ class TestDrivingLicense():
"""断言"""
assert
res
[
'code'
]
==
expectData
[
'code'
]
@pytest.mark.
scoreDetail
@pytest.mark.
usefixtures
(
"avatarUpdate_del"
)
@allure.story
(
"修改驾驶证头像"
)
@allure.link
(
"http://yapi.hikcreate.com/project/32/interface/api/22750"
)
@allure.description
(
"/drivingLicense/avatar/update"
)
...
...
@@ -378,5 +392,3 @@ if __name__ == '__main__':
pytest
.
main
([
'test_ ElectronicLicense.py'
,
'-s'
,
'--alluredir'
,
'../../report/tmp'
])
# 启动默认浏览器打开报告
os
.
system
(
'allure serve ../../report/tmp'
)
test_case_data/bmc/bmc_
tk
.xlsx
→
test_case_data/bmc/bmc_
ele_License_2021513
.xlsx
View file @
102816fd
No preview for this file type
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