Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
U
ubains-module-test
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
郑晓兵
ubains-module-test
Commits
93050863
提交
93050863
authored
2月 14, 2025
作者:
陈泽健
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
补充讯飞语音转录功能流程,调试通过。
上级
9f90a6b5
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
168 行增加
和
18 行删除
+168
-18
base.cpython-310.pyc
预定系统/Base/__pycache__/base.cpython-310.pyc
+0
-0
base.py
预定系统/Base/base.py
+4
-10
README.md
预定系统/README.md
+4
-2
无纸化2.0.cpython-310.pyc
预定系统/cases/展厅巡检/03无纸化/__pycache__/无纸化2.0.cpython-310.pyc
+0
-0
01无纸化同屏测试.py
预定系统/cases/展厅巡检/03无纸化/同屏共享/01无纸化同屏测试.py
+114
-0
01无纸化同屏测试.cpython-310.pyc
...ses/展厅巡检/03无纸化/同屏共享/__pycache__/01无纸化同屏测试.cpython-310.pyc
+0
-0
__st__.cpython-310.pyc
.../cases/展厅巡检/03无纸化/同屏共享/__pycache__/__st__.cpython-310.pyc
+0
-0
__st__.py
预定系统/cases/展厅巡检/03无纸化/同屏共享/__st__.py
+41
-0
展厅会议室中控屏.cpython-310.pyc
...ases/展厅巡检/05展厅会议室中控屏/__pycache__/展厅会议室中控屏.cpython-310.pyc
+0
-0
展厅会议室中控屏.py
预定系统/cases/展厅巡检/05展厅会议室中控屏/展厅会议室中控屏.py
+4
-5
定时执行功能测试.py
预定系统/定时执行功能测试.py
+1
-1
没有找到文件。
预定系统/Base/__pycache__/base.cpython-310.pyc
浏览文件 @
93050863
No preview for this file type
预定系统/Base/base.py
浏览文件 @
93050863
...
...
@@ -979,7 +979,7 @@ def play_cloud_voice(app_id, app_secret, device_sn):
"data"
:
{
"cmd_type"
:
"play"
,
"info"
:
{
"tts"
:
"一、二、三、四、五、六、七、八、九、十"
,
"tts"
:
"一、二、三、四、五、六、七、八、九、十
一、二、三、四、五、六、七、八、九、十 一、二、三、四、五、六、七、八、九、十、一、二、三、四、五、六、七、八、九、十
"
,
"inner"
:
10
,
# wifi版特有
"volume"
:
5
# 4G版本1-7,wifi版1-10
}
...
...
@@ -998,6 +998,7 @@ def play_cloud_voice(app_id, app_secret, device_sn):
# 根据响应状态码判断请求是否成功
if
response
.
status_code
==
200
:
logging
.
info
(
f
"请求成功: {response.json()}"
)
sleep
(
20
)
else
:
logging
.
error
(
f
"请求失败: 状态码 {response.status_code}, 响应内容 {response.text}"
)
...
...
@@ -1067,11 +1068,4 @@ def get_test_result(latest_report, wd):
test_result
[
"exception_percent"
]
=
exception_percent
# 返回测试结果字典
return
test_result
# if __name__ == '__main__':
# browser_init("标准版预定系统")
# wd = GSTORE['wd']
# data_result = get_test_result('http://nat.ubainsyun.com:31133/report_20250213_181722.html',wd)
# logging.info(data_result)
# print(data_result)
\ No newline at end of file
return
test_result
\ No newline at end of file
预定系统/README.md
浏览文件 @
93050863
...
...
@@ -208,4 +208,6 @@
-
历史会议模块与会议审批模块补充调用清除浏览器驱动函数。
-
补充审批会议模块的日志输出。调整审批会议创建的执行步骤。
53.
2025-02-13
-
增加get_test_result函数通过正则匹配获取通过率、失败率以及异常率,再调用钉钉消息通知输出通过率等值。优化处理
\ No newline at end of file
-
增加get_test_result函数通过正则匹配获取通过率、失败率以及异常率,再调用钉钉消息通知输出通过率等值。优化处理。
54.
2025-02-14
-
补充讯飞语音转录功能流程,调试通过。
\ No newline at end of file
预定系统/cases/展厅巡检/03无纸化/__pycache__/无纸化2.0.cpython-310.pyc
浏览文件 @
93050863
No preview for this file type
预定系统/cases/展厅巡检/03无纸化/同屏共享/01无纸化同屏测试.py
0 → 100644
浏览文件 @
93050863
# from 预定系统.Base.app_base import *
# import logging
#
# # 配置日志记录
# logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
#
# class same_screen_share_001:
# """
# 执行指令:
# 1.cd 预定系统
# 2.hytest --report_title 会议预约测试报告 --report_url_prefix http://192.168.1.225 --tag 无纸化
# """
# tags = ['展厅巡检','无纸化']
#
# def app_nopaper_test(device_ip1, device_ip2):
# app_drive1 = None
# app_drive2 = None
# try:
# # 初始化第一个设备
# app_drive1 = app_setup_driver("Android", "7.1.2", "127.0.0.1:62001", "com.ubains.local.gviewer", "com.ubains.ub.gview.SplashActivity", device_ip1)
# app_drive1.implicitly_wait(20) # 设置缺省等待时间
#
# # 初始化第二个设备
# app_drive2 = app_setup_driver("Android", "7.1.2", "127.0.0.1:62002", "com.ubains.local.gviewer", "com.ubains.ub.gview.SplashActivity", device_ip2)
# app_drive2.implicitly_wait(20) # 设置缺省等待时间
#
# # 在两个设备上执行相同的测试步骤
# for app_drive, device_ip in [(app_drive1, device_ip1), (app_drive2, device_ip2)]:
# logging.info(f"在设备 {device_ip} 上执行测试步骤...")
#
# # 使用显式等待来等待元素出现
# logging.info(f"等待登录页加载... (设备 {device_ip})")
# sleep(10)
#
# # 进入后台设置界面
# logging.info(f"尝试进入后台设置界面 (设备 {device_ip})")
# back_setting_button = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.Button[1]')
# back_setting_button.click()
# sleep(3)
#
# # 输入管理员密码点击【确定】按钮
# logging.info(f"尝试输入管理员密码点击【确定】按钮 (设备 {device_ip})")
# admin_pwd_input = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.EditText')
# admin_pwd_input.send_keys("Ubains@123")
# sleep(2)
#
# # 点击确定按钮
# confirm_button = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.TextView[3]')
# confirm_button.click()
# sleep(5)
#
# # 进入【同屏和视频服务】界面
# logging.info(f"进入【同屏和视频服务】界面 (设备 {device_ip})")
# same_screen_module = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout[1]/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout[4]/android.widget.FrameLayout/android.widget.TextView')
# same_screen_module.click()
# sleep(2)
#
# # 点击右上角【同屏配置】进入同屏运维界面
# same_screen_config_button = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout[2]/androidx.viewpager.widget.ViewPager/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.Button[1]')
# same_screen_config_button.click()
# sleep(3)
#
# # 判断是否出现【关闭】按钮,如果有就点击【关闭】按钮
# quit_button = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.widget.LinearLayout[2]/android.widget.TextView')
# if quit_button:
# logging.info(f"点击【关闭】按钮 (设备 {device_ip})")
# quit_button.click()
# sleep(2)
# else:
# logging.info(f"没有【关闭】按钮 (设备 {device_ip})")
#
# # 进入【同屏共享】界面
# logging.info(f"进入【同屏共享】界面 (设备 {device_ip})")
# same_screen_share_config_button = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.ScrollView/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.TextView')
# same_screen_share_config_button.click()
# sleep(4)
#
# # 使用同屏共享功能
# logging.info(f"使用同屏共享功能 (设备 {device_ip})")
# same_screen_share_button = app_drive.find_element(AppiumBy.XPATH,
# '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/androidx.recyclerview.widget.RecyclerView/android.widget.FrameLayout/android.view.ViewGroup/androidx.appcompat.widget.LinearLayoutCompat/android.widget.Button[1]')
# same_screen_share_button.click()
#
# # 进行截屏操作
# logging.info(f"在设备 {device_ip} 上进行截屏操作")
# screenshot_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), f"screenshot_{device_ip}.png")
# app_drive.get_screenshot_as_file(screenshot_path)
# logging.info(f"截屏已保存到 {screenshot_path}")
#
# except Exception as e:
# logging.error(f"发生错误: {e}", exc_info=True)
#
# finally:
# if app_drive1:
# input('**** 按任意键退出..')
# app_drive1.quit()
# logging.info("驱动程序已退出 (设备 1)。")
#
# if app_drive2:
# input('**** 按任意键退出..')
# app_drive2.quit()
# logging.info("驱动程序已退出 (设备 2)。")
#
# if __name__ == "__main__":
# device_ip1 = '192.168.5.158:5555'
# device_ip2 = '192.168.5.159:5555' # 假设第二个设备的IP地址是192.168.5.159:5555
# app_nopaper_test(device_ip1, device_ip2)
预定系统/cases/展厅巡检/03无纸化/同屏共享/__pycache__/01无纸化同屏测试.cpython-310.pyc
0 → 100644
浏览文件 @
93050863
File added
预定系统/cases/展厅巡检/03无纸化/同屏共享/__pycache__/__st__.cpython-310.pyc
0 → 100644
浏览文件 @
93050863
File added
预定系统/cases/展厅巡检/03无纸化/同屏共享/__st__.py
0 → 100644
浏览文件 @
93050863
import
sys
import
os
from
time
import
sleep
# 获取当前脚本的绝对路径
current_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
# 构建预定系统的绝对路径
预定系统
_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
current_dir
,
'..'
,
'..'
,
'..'
))
# 添加路径
sys
.
path
.
append
(
预定系统
_path
)
# 导入模块
try
:
from
预定系统
.
Base
.
base
import
*
from
预定系统
.
Base
.
app_base
import
*
except
ModuleNotFoundError
as
e
:
print
(
f
"ModuleNotFoundError: {e}"
)
print
(
"尝试使用绝对路径导入"
)
from
预定系统
.
Base
.
base
import
*
from
预定系统
.
Base
.
app_base
import
*
def
suite_setup
():
STEP
(
1
,
"初始化设备1的adb连接"
)
device_ip1
=
'192.168.5.156'
app_init
(
device_ip1
)
STEP
(
2
,
"初始化设备2的adb连接"
)
device_ip2
=
'192.168.5.157'
# 假设第二个设备的IP地址是192.168.5.157
app_init
(
device_ip2
)
browser_init
(
"展厅预定巡检"
)
wd
=
GSTORE
[
'wd'
]
def
suite_teardown
():
device_ip1
=
'192.168.5.156'
app_quit
(
device_ip1
)
device_ip2
=
'192.168.5.157'
app_quit
(
device_ip2
)
browser_quit
()
\ No newline at end of file
预定系统/cases/展厅巡检/05展厅会议室中控屏/__pycache__/展厅会议室中控屏.cpython-310.pyc
浏览文件 @
93050863
No preview for this file type
预定系统/cases/展厅巡检/05展厅会议室中控屏/展厅会议室中控屏.py
浏览文件 @
93050863
...
...
@@ -99,7 +99,7 @@ class Exhibition_Meeting_Control_0001:
# 点击左上角logo进入后台
# 等待元素可见,并在可见后执行长按操作。
enter_back_button
=
app_drive
.
find_element
(
AppiumBy
.
XPATH
,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.Button[1]"
)
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout
[5]
/android.widget.Button[1]"
)
INFO
(
"点击左上角logo进入后台"
)
enter_back_button
.
click
()
sleep
(
5
)
...
...
@@ -114,18 +114,17 @@ class Exhibition_Meeting_Control_0001:
app_secret
=
os
.
getenv
(
"APP_SECRET"
,
"88bc1ec4eba624f47b2200a4ce8c3852"
)
device_sn
=
os
.
getenv
(
"DEVICE_SN"
,
"W703BB44444"
)
play_cloud_voice
(
app_id
,
app_secret
,
device_sn
)
sleep
(
5
)
mic_off_button
=
app_drive
.
find_element
(
AppiumBy
.
XPATH
,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[
5
]"
)
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[6]/android.widget.Button[
3
]"
)
mic_off_button
.
click
()
sleep
(
5
)
# 关闭左摄像头
left_camera_off_button
=
app_drive
.
find_element
(
AppiumBy
.
XPATH
,
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[
2
]/android.widget.Button[5]"
)
"/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout[
6
]/android.widget.Button[5]"
)
INFO
(
"关闭左摄像头"
)
left_camera_off_button
.
click
()
sleep
(
1
0
)
sleep
(
2
0
)
except
Exception
as
e
:
...
...
预定系统/定时执行功能测试.py
浏览文件 @
93050863
...
...
@@ -69,7 +69,7 @@ def start_workers(num_workers):
start_workers
(
3
)
# 定时执行预定系统测试任务1
schedule
.
every
()
.
day
.
at
(
"19:04"
)
.
do
(
run_task
,
run_automation_test
,
report_title
=
"预定系统测试报告"
,
report_url_prefix
=
"http://nat.ubainsyun.com:31133"
,
test_case
=
"登录
功能"
,
ding_type
=
"标准版巡检"
)
# schedule.every().day.at("09:00").do(run_task, run_automation_test, report_title="预定系统测试报告", report_url_prefix="http://nat.ubainsyun.com:31134", test_case="预定系统
功能", ding_type="标准版巡检")
# 定时执行展厅巡检任务
schedule
.
every
()
.
day
.
at
(
"07:45"
)
.
do
(
run_task
,
run_automation_test
,
report_title
=
"展厅巡检测试报告"
,
report_url_prefix
=
"http://nat.ubainsyun.com:31133"
,
test_case
=
"展厅巡检"
,
ding_type
=
"展厅巡检"
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论