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
10605afa
Commit
10605afa
authored
Aug 07, 2023
by
xiao-hesheng
Browse files
修改ui自动化demo
添加airtest下的ui自动化demo
parent
5765f29d
Changes
9
Hide whitespace changes
Inline
Side-by-side
air_case/demo-ui/demo-spd3-login.air/demo-spd3-login.py
View file @
10605afa
...
...
@@ -8,11 +8,14 @@ spd登录的ui自动化例子1
from
common.common_func
import
commonFuc
from
airtest.core.api
import
*
from
selenium
import
webdriver
from
selenium.webdriver.common.keys
import
Keys
from
airtest_selenium.proxy
import
*
module
=
"demo-ui"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"spd3_login_url"
)
print
(
url
)
chrome
=
w
eb
driver
.
Chrome
()
chrome
=
W
ebChrome
()
chrome
=
commonFuc
().
openBrowser
(
url
,
chrome
)
chrome
.
maximize_window
()
chrome
.
implicitly_wait
(
20
)
...
...
@@ -27,4 +30,7 @@ result=commonFuc().check_login_result(name1,chrome)
print
(
result
)
#断言实际结果中是否包含预期的文本
commonFuc
().
check_text_exist_result_text
(
name1
,
result
)
commonFuc
().
quit_chrome
(
chrome
)
\ No newline at end of file
chrome
.
airtest_touch
(
Template
(
r
"tpl1691374901526.png"
,
record_pos
=
(
12.3
,
2.8
),
resolution
=
(
100
,
100
)))
commonFuc
().
quit_chrome
(
chrome
)
air_case/demo-ui/demo-spd3-login.air/tpl1691374901526.png
0 → 100644
View file @
10605afa
1.79 KB
air_case/demo/baidu.air/baidu.py
0 → 100644
View file @
10605afa
# -*- encoding=utf8 -*-
__author__
=
"Administrator"
"""
case_tag:api,baidu,sit,on
"""
from
airtest.core.api
import
*
from
selenium
import
webdriver
from
selenium.webdriver.common.keys
import
Keys
from
airtest_selenium.proxy
import
*
driver
=
WebChrome
()
driver
.
implicitly_wait
(
20
)
driver
.
get
(
"https://www.baidu.com"
)
sleep
(
4
)
driver
.
find_element_by_id
(
"kw"
).
send_keys
(
"airtest"
)
sleep
(
4
)
driver
.
airtest_touch
(
Template
(
r
"tpl1691374901526.png"
,
record_pos
=
(
12.3
,
2.8
),
resolution
=
(
100
,
100
)))
air_case/demo/baidu.air/tpl1691374901523.png
0 → 100644
View file @
10605afa
650 Bytes
air_case/demo/baidu.air/tpl1691374901526.png
0 → 100644
View file @
10605afa
3.15 KB
air_case/demo/baidu.air/tpl1691375285206.png
0 → 100644
View file @
10605afa
581 Bytes
air_case/mdm3-es/器械注册人_企业注册提交_正常注册_境内.air/器械注册人_企业注册提交_正常注册_境内.py
0 → 100644
View file @
10605afa
# -*- encoding=utf8 -*-
__author__
=
"xiaohesheng"
"""
case_tag:api,mdm-web境内,用例集id2226,sit,on
主数据平台:注册企业接口
"""
from
common.common_func
import
commonFuc
import
time
module
=
"mdm3-es"
#企业注册接口
import
os
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"CompanyRegist_url"
)
print
(
url
)
# #获取请求头信息
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
))
print
(
headers
)
name
=
commonFuc
().
get_business_data
(
module
,
"name1"
)
#获取前缀name
cname
=
name
+
commonFuc
().
randomString
(
5
)
#随机数生成拼接企业名称
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
cname
,
cname
,
cname
,
cname
,
cname
,
cname
)
print
(
request_body
)
"""
场景:外网主数据平台企业注册-器械注册人注册接口-境内企业
用例名称:企业注册接口-器械注册人-正常注册-境内企业
输入:cname
输出:"rtn_msg": "返回注册企业信息"
"""
#发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
result
)
#获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict"
)
print
(
check_dict
)
#断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
#断言实际结果中是否包含预期的文本
commonFuc
().
check_text_exist
(
name
,
result
)
data/mdm3-es/data
View file @
10605afa
...
...
@@ -247,4 +247,35 @@ checkDict: {"code": 0,'msg': None}
"certListCode": []
}
]
}
#器械注册人_企业注册提交_正常注册(境内)
"payload3": {
"compFunction": "2",
"compFunctionArr": [
"2"
],
"cname": "%s",
"shortName": "",
"isAbroad": "0",
"addrCodeList": [
"11"
],
"area": "",
"userName": "%s",
"address": "",
"userLoginCode": "%s",
"userLoginPsw": "a123456!",
"confimPassword": "a123456!",
"registContactUser": "",
"registContactWay": "",
"email": "%s@sina.com",
"registSourceProject": "%s",
"legal": "",
"erpCode": "%s",
"dataEntrance": "注册",
"compKind": "0",
"upCompanyId": "",
"companyRegistBizscopeVos": [],
"certVOList": []
}
\ No newline at end of file
report/summary.html
View file @
10605afa
...
...
@@ -55,9 +55,9 @@
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0
</td>
<td
class=
'details-col-elapsed'
>
0分2秒
</td>
<td
class=
"details-col-elapsed"
>
0.0%
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分2
7
秒
</td>
<td
class=
"details-col-elapsed"
>
10
0.0%
</td>
</tr>
</table>
...
...
@@ -73,8 +73,8 @@
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/demo-spd3-login/log.html'
target=
'_blank'
>
demo-spd3-login
</a></td>
<td
class=
"
fail"
>
失败
</td>
<td
class=
"details-col-elapsed"
>
2
.185
</td>
<td
class=
"
success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2
7.622
</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