Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
b2b9fe2c
Commit
b2b9fe2c
authored
Sep 13, 2023
by
xiao-hesheng
Browse files
优化脚本,增加写入文件函数
解决yaml文件中文乱码问题 修改tag内容
parent
6a17afd1
Changes
20
Hide whitespace changes
Inline
Side-by-side
air_case/mdm3-es/器械注册人_企业注册提交_正常注册_境内.air/器械注册人_企业注册提交_正常注册_境内.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web境内,id2232,sit,on
case_tag:api,mdm-web境内,id2232,
id2232-1,
sit,on
主数据平台:注册企业接口
"""
...
...
air_case/mdm3-es/外网企业注册-器械注册人-所有输入项填写.air/外网企业注册-器械注册人-所有输入项填写.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web2,id2232,sit,on
case_tag:api,mdm-web2,id2232,
id2232-3,
sit,on
主数据平台:注册企业接口_注册时_有附件
"""
...
...
air_case/mdm3-es/外网企业注册-器械注册人-有附件.air/外网企业注册-器械注册人-有附件.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web1,id2232,
s
it,on
case_tag:api,mdm-web1,id2232,
id2232-4,
it,on
主数据平台:注册企业接口_注册时_有附件
"""
...
...
air_case/mdm3-es/外网企业注册-器械注册人.air/外网企业注册-器械注册人.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,id2232,sit,on
case_tag:api,mdm-web,id2232,
id2232-2,
sit,on
主数据平台:注册企业接口
"""
...
...
air_case/mdm3-es/外网企业注册提交接口_正常注册.air/外网企业注册提交接口_正常注册.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web正常注册,id2232,sit,on
case_tag:api,mdm-web正常注册,id2232,
id2232-5,
sit,on
主数据平台:注册企业接口
"""
...
...
air_case/mdm3-es/外网企业注册提交接口_注册企业已存在.air/外网企业注册提交接口_注册企业已存在.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web注册企业已存在,id2232,sit,on
case_tag:api,mdm-web注册企业已存在,id2232,
id2232-6,
sit,on
主数据平台:注册企业接口
"""
...
...
air_case/mdm3-es/生产厂商_企业注册提交_正常注册.air/生产厂商_企业注册提交_正常注册.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web生产厂商正常注册,id2232,sit,on
case_tag:api,mdm-web生产厂商正常注册,id2232,
id2232-7,
sit,on
主数据平台:生产厂商_企业注册提交_正常注册
"""
...
...
air_case/mdm3-es/经销商_企业注册提交_正常注册.air/经销商_企业注册提交_正常注册.py
View file @
b2b9fe2c
...
...
@@ -2,7 +2,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web经销商正常注册,id2232,sit,on
case_tag:api,mdm-web经销商正常注册,id2232,
id2232-8,
sit,on
主数据平台:经销商_企业注册提交_正常注册
"""
...
...
air_case/mdm3-hs/医院注册_正常注册_公立医院.air/医院注册_正常注册_公立医院.py
View file @
b2b9fe2c
...
...
@@ -3,7 +3,7 @@
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,公立医院注册,id2249,sit,on,10086
case_tag:api,mdm-web,公立医院注册,id2249,
id2249-1,
sit,on,10086
主数据平台:公立医院注册
"""
from
common.common_func
import
commonFuc
...
...
air_case/mdm3-hs/医院注册_正常注册_私立医院.air/医院注册_正常注册_私立医院.py
View file @
b2b9fe2c
...
...
@@ -4,7 +4,7 @@ __author__ = "xiaohesheng"
"""
暂未调试脚本
case_tag:api,mdm-web私立医院注册,id2249,sit,on,10086
case_tag:api,mdm-web私立医院注册,id2249,
id2249-2,
sit,on,10086
主数据平台:私立医院注册
"""
from
common.common_func
import
commonFuc
...
...
air_case/mdm3-hs/注册医院审核通过.air/注册医院审核通过.py
View file @
b2b9fe2c
...
...
@@ -5,7 +5,7 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,注册医院审核通过,id2249,sit,on,20230907
case_tag:api,mdm-web,注册医院审核通过,id2249,
id2249-3,
sit,on,20230907
主数据平台:注册医院审核通过
"""
from
common.common_func
import
commonFuc
...
...
air_case/mdm3-hs/注册医院审核驳回.air/注册医院审核驳回.py
View file @
b2b9fe2c
...
...
@@ -5,7 +5,7 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web,注册医院审核驳回,id2249,sit,on,202309072
case_tag:api,mdm-web,注册医院审核驳回,id2249,
id2249-4,
sit,on,202309072
主数据平台:注册医院审核驳回
"""
from
common.common_func
import
commonFuc
...
...
air_case/mdm3-pim/产品新增和审核通过.air/产品新增和审核通过.py
View file @
b2b9fe2c
...
...
@@ -4,7 +4,7 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web企业审核,id2248,sit,on,202309
0802
case_tag:api,mdm-web企业审核,id2248,
id2248-1,
sit,on,202309
1201
主数据平台:产品新增和审核通过
"""
...
...
@@ -222,8 +222,8 @@ def p_m_a():
# print('code',code)
commonFuc
().
check_text_exist
(
code
,
result
)
print
(
'username'
,
username
)
return
username
return
username
,
goodsName
,
module
# p_m_a()
from
common.timeUtils
import
timeUtils
from
common.
rw
import
Rw
Rw
().
w_info
(
p_m_a
())
from
common.
fileUtls
import
FileUtils
FileUtils
().
w_info
(
p_m_a
()
,
'产品新增'
)
air_case/mdm3-pim/产品规格新增和审核通过.air/产品规格新增和审核通过.py
View file @
b2b9fe2c
...
...
@@ -6,7 +6,7 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web企业审核,id2248,sit,on,202309
08
02
case_tag:api,mdm-web企业审核,id2248,
id2248-2,
sit,on,202309
12
02
主数据平台:产品新增和审核通过
"""
...
...
common/common_func.py
View file @
b2b9fe2c
...
...
@@ -535,6 +535,6 @@ class commonFuc(object):
def
get_pro_path
(
self
):
import
os
curPath
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
# 获取当前文件的所在目录的绝对路径
print
(
os
.
path
.
split
(
curPath
))
#
print(os.path.split(curPath))
rootPath
=
os
.
path
.
split
(
curPath
)[
0
]
return
rootPath
\ No newline at end of file
common/data
View file @
b2b9fe2c
loginusername1:
loginusername: 国药集团公司aVD9#
loginusername: 国药集团公司!n0d(
goodsname: 一次性注射器NbfHr
common/fileUtls.py
0 → 100644
View file @
b2b9fe2c
import
os
from
ruamel
import
yaml
from
common.db.db
import
dbOP
import
datetime
curpath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
rootPath
=
os
.
path
.
split
(
curpath
)[
0
]
# 数据读入和写入文件
class
FileUtils
(
object
):
def
w_info
(
self
,
info
,
keyname
):
module
=
info
[
2
]
dict
=
{}
value
=
{}
value
[
'username'
]
=
info
[
0
]
value
[
'goodsname'
]
=
info
[
1
]
key
=
keyname
dict
[
key
]
=
value
w_path
=
rootPath
+
os
.
sep
+
'data'
+
os
.
sep
+
module
# print(w_path)
yamlpath
=
os
.
path
.
join
(
w_path
,
"message"
)
# 写入到yaml文件
with
open
(
yamlpath
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
yaml
.
dump
(
dict
,
f
,
Dumper
=
yaml
.
RoundTripDumper
,
allow_unicode
=
True
)
def
r_info
(
self
,
module
,
keyname
):
w_path
=
rootPath
+
os
.
sep
+
'data'
+
os
.
sep
+
module
yamlpath
=
os
.
path
.
join
(
w_path
,
"message"
)
file_value
=
open
(
yamlpath
,
'r'
,
encoding
=
'utf-8'
)
result
=
yaml
.
load
(
file_value
.
read
(),
Loader
=
yaml
.
Loader
)
if
result
is
not
None
:
key
=
keyname
if
key
in
result
:
return
result
[
key
]
else
:
return
None
else
:
return
None
if
__name__
==
'__main__'
:
# info=("aaaa","bbbbbb","mdm3-pim")
# FileUtils().w_info(info,"产品新增")
aa
=
FileUtils
().
r_info
(
"mdm3-pim"
,
"产品新增"
)
print
(
aa
)
common/rw.py
View file @
b2b9fe2c
import
os
from
ruamel
import
yaml
from
common.db.db
import
dbOP
import
datetime
curpath
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
...
...
@@ -23,10 +24,11 @@ class Rw:
yaml
.
dump
(
dict
,
f
,
Dumper
=
yaml
.
RoundTripDumper
)
return
token
def
w_info
(
self
,
username
):
def
w_info
(
self
,
info
):
dict
=
{}
value
=
{}
value
[
"loginusername"
]
=
username
value
[
"loginusername"
]
=
info
[
0
]
value
[
"goodsname"
]
=
info
[
1
]
key
=
"loginusername1"
dict
[
key
]
=
value
yamlpath
=
os
.
path
.
join
(
curpath
,
"data"
)
...
...
data/mdm3-pim/message
0 → 100644
View file @
b2b9fe2c
产品新增:
username: 国药集团公司&ms2w
goodsname: 一次性注射器jtwfK
report/summary.html
View file @
b2b9fe2c
...
...
@@ -54,8 +54,8 @@
</tr>
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
2
</td>
<td
class=
'details-col-elapsed'
>
2
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分2秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
...
...
@@ -74,14 +74,7 @@
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/产品新增和审核通过/log.html'
target=
'_blank'
>
产品新增和审核通过
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2.548
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/产品规格新增和审核通过/log.html'
target=
'_blank'
>
产品规格新增和审核通过
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
0.002
</td>
<td
class=
"details-col-elapsed"
>
2.531
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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