Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录
切换导航
U
ubains-module-test
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
郑晓兵
ubains-module-test
Commits
ae97288e
提交
ae97288e
authored
12月 14, 2024
作者:
陈泽健
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新展厅巡检定时任务。通过覆盖的方式将appium的截图替换掉hytest的截图,从而实现appium的测试报告生成。
上级
a8255348
展开全部
显示空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
128 行增加
和
30 行删除
+128
-30
README.md
预定系统/README.md
+3
-0
__st__.py
预定系统/cases/会议主流程/__st__.py
+3
-2
__st__.py
预定系统/cases/会议室管理/会议室管理/__st__.py
+3
-2
__st__.py
预定系统/cases/会议室管理/功能管理/__st__.py
+3
-2
__st__.py
预定系统/cases/会议室管理/区域管理/__st__.py
+3
-2
01展厅会议预约巡检.py
预定系统/cases/展厅巡检/01展厅会议预约巡检.py
+1
-0
02移动端入会.py
预定系统/cases/展厅巡检/02移动端入会.py
+91
-11
__st__.py
预定系统/cases/展厅巡检/__st__.py
+3
-2
__st__.py
预定系统/cases/登录模块/__st__.py
+3
-2
__st__.py
预定系统/cases/系统管理/__st__.py
+3
-2
__st__.py
预定系统/cases/账号管理/用户管理/__st__.py
+3
-2
__st__.py
预定系统/cases/账号管理/部门管理/__st__.py
+3
-2
report_20241129_120300.html
预定系统/reports/report_20241129_120300.html
+0
-0
report_20241129_161101.html
预定系统/reports/report_20241129_161101.html
+0
-0
定时执行功能测试.py
预定系统/定时执行功能测试.py
+6
-1
没有找到文件。
预定系统/README.md
浏览文件 @
ae97288e
...
...
@@ -104,3 +104,5 @@
-
补充MQTT的消息监听,监听到消息后,会通过日志输出消息体内容,可用于所有预定项目测试使用。
-
补充富创项目的MQTT消息监听,监听到消息后,会通过日志输出消息体内容,可用于富创项目测试替代第三方工具使用。
-
处理富创项目的MQTT预约、修改和删除会议消息体,增加代码可维护性。补充标准版安卓信息的监听代码。
30.
2024-12-14
-
更新展厅巡检定时任务。通过覆盖的方式将appium的截图替换掉hytest的截图,从而实现appium的测试报告生成。
\ No newline at end of file
预定系统/cases/会议主流程/__st__.py
浏览文件 @
ae97288e
...
...
@@ -12,8 +12,9 @@ from 预定系统.Base.base import *
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
...
...
预定系统/cases/会议室管理/会议室管理/__st__.py
浏览文件 @
ae97288e
...
...
@@ -18,8 +18,9 @@ except ModuleNotFoundError as e:
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
...
...
预定系统/cases/会议室管理/功能管理/__st__.py
浏览文件 @
ae97288e
...
...
@@ -18,8 +18,9 @@ except ModuleNotFoundError as e:
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
...
...
预定系统/cases/会议室管理/区域管理/__st__.py
浏览文件 @
ae97288e
...
...
@@ -18,8 +18,9 @@ except ModuleNotFoundError as e:
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
admin_login
(
"admin@ZDH"
,
"Ubains@4321"
)
...
...
预定系统/cases/展厅巡检/01展厅会议预约巡检.py
浏览文件 @
ae97288e
...
...
@@ -26,6 +26,7 @@ class Exhibition_hall_inspection_000x:
1.cd 预定系统
2.hytest --report_title 会议预约测试报告 --report_url_prefix http://192.168.1.225 --test 展厅巡检_0**
"""
tags
=
[
'展厅巡检'
]
ddt_cases
=
read_csv_data
(
csv_file_path
)
def
teststeps
(
self
):
...
...
预定系统/cases/展厅巡检/02移动端入会.py
浏览文件 @
ae97288e
from
time
import
sleep
from
appium.webdriver.common.appiumby
import
AppiumBy
from
hytest
import
SELENIUM_LOG_SCREEN
from
预定系统
.
Base
.
app_base
import
*
import
logging
from
time
import
sleep
# 配置日志记录
logging
.
basicConfig
(
level
=
logging
.
DEBUG
,
format
=
'
%(asctime)
s -
%(levelname)
s -
%(message)
s'
)
def
app_txcent_test
():
class
Exhibition_hall_inspection_000x
:
"""
执行指令:
1.cd 预定系统
2.hytest --report_title 会议预约测试报告 --report_url_prefix http://192.168.1.225 --test 展厅巡检_0**
"""
tags
=
[
'展厅巡检_腾讯会议'
]
def
teststeps
(
self
):
app_drive
=
None
try
:
# 腾讯:"com.tencent.wemeet.app" ".StartupActivity"
app_drive
=
app_setup_driver
(
"Android"
,
"7.1.2"
,
"127.0.0.1:62001"
,
"com.tencent.wemeet.app"
,
".StartupActivity"
)
app_drive
=
app_setup_driver
(
"Android"
,
"7.1.2"
,
"127.0.0.1:62001"
,
"com.tencent.wemeet.app"
,
".StartupActivity"
)
app_drive
.
implicitly_wait
(
20
)
# 设置缺省等待时间
# 使用显式等待来等待元素出现
...
...
@@ -20,7 +27,8 @@ def app_txcent_test():
# 定位第一场会议按钮元素,并点击按钮
logging
.
info
(
"尝试定位【会议名称】按钮元素,并点击按钮"
)
meeting_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.LinearLayout/androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.widget.LinearLayout[1]/android.view.ViewGroup/android.widget.RelativeLayout/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[4]/android.view.ViewGroup/androidx.appcompat.widget.LinearLayoutCompat[1]/android.view.ViewGroup/android.widget.TextView"
)
# meeting_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.LinearLayout/androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.widget.LinearLayout[1]/android.view.ViewGroup/android.widget.RelativeLayout/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[4]/android.view.ViewGroup/androidx.appcompat.widget.LinearLayoutCompat[1]/android.view.ViewGroup/android.widget.TextView")
meeting_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.LinearLayout/androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.widget.LinearLayout[1]/android.view.ViewGroup/android.widget.RelativeLayout/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[1]/android.view.ViewGroup/androidx.appcompat.widget.LinearLayoutCompat/android.view.ViewGroup/android.widget.TextView"
)
logging
.
info
(
"定位会议成功"
)
# 点击【加入会议】按钮
meeting_button
.
click
()
...
...
@@ -29,22 +37,94 @@ def app_txcent_test():
# 点击【加入会议】按钮
logging
.
info
(
"尝试定位【加入会议】按钮元素,并点击按钮"
)
join_meeting_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/androidx.appcompat.widget.LinearLayoutCompat/androidx.appcompat.widget.LinearLayoutCompat/android.widget.TextView"
)
join_meeting_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/androidx.appcompat.widget.LinearLayoutCompat/androidx.appcompat.widget.LinearLayoutCompat/android.widget.TextView"
)
logging
.
info
(
"定位【加入会议】按钮成功"
)
join_meeting_button
.
click
()
logging
.
info
(
"点击【加入会议】按钮成功"
)
sleep
(
8
)
app_drive
.
get_screenshot_as_file
(
r"D:\GithubData\自动化测试\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Tx_meeting\会场控制截屏.png"
)
r"D:\GithubData\自动化\ubains-module-test\预定系统\reports\imgs\Exhibit_Inspect\Tx_meeting\会场画面截屏.png"
)
sleep
(
8
)
except
Exception
as
e
:
logging
.
error
(
f
"发生错误: {e}"
,
exc_info
=
True
)
finally
:
if
app_drive
:
input
(
'**** 按任意键退出..'
)
app_drive
.
quit
()
logging
.
info
(
"驱动程序已退出。"
)
if
__name__
==
'__main__'
:
app_txcent_test
()
# from appium.webdriver.common.appiumby import AppiumBy
# from 预定系统.Base.app_base import *
# import logging
# from time import sleep
# import unittest
# import os
# from HtmlTestRunner import HTMLTestRunner
#
# # 配置日志记录
# logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
#
# class TestAppTXCent(unittest.TestCase):
# def setUp(self):
# self.app_drive = None
# try:
# # 腾讯:"com.tencent.wemeet.app" ".StartupActivity"
# self.app_drive = app_setup_driver("Android", "7.1.2", "127.0.0.1:62001", "com.tencent.wemeet.app", ".StartupActivity")
# self.app_drive.implicitly_wait(20) # 设置缺省等待时间
# except Exception as e:
# logging.error(f"初始化驱动程序时发生错误: {e}", exc_info=True)
# self.fail(f"初始化驱动程序时发生错误: {e}")
#
# def tearDown(self):
# if self.app_drive:
# input('**** 按任意键退出..')
# self.app_drive.quit()
# logging.info("驱动程序已退出。")
#
# def test_app_txcent(self):
# try:
# # 使用显式等待来等待元素出现
# logging.info("等待登录页加载...")
#
# # 定位第一场会议按钮元素,并点击按钮
# logging.info("尝试定位【会议名称】按钮元素,并点击按钮")
# meeting_button = self.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.LinearLayout/androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.widget.LinearLayout[1]/android.view.ViewGroup/android.widget.RelativeLayout/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[4]/android.view.ViewGroup/androidx.appcompat.widget.LinearLayoutCompat[1]/android.view.ViewGroup/android.widget.TextView")
# logging.info("定位会议成功")
# # 点击【加入会议】按钮
# meeting_button.click()
# logging.info("点击【会议】按钮成功")
# sleep(2)
#
# # 点击【加入会议】按钮
# logging.info("尝试定位【加入会议】按钮元素,并点击按钮")
# join_meeting_button = self.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/androidx.appcompat.widget.LinearLayoutCompat/androidx.appcompat.widget.LinearLayoutCompat/android.widget.TextView")
# logging.info("定位【加入会议】按钮成功")
# join_meeting_button.click()
# logging.info("点击【加入会议】按钮成功")
# sleep(8)
#
# # 截图并保存
# screenshot_path = os.path.join(os.getcwd(), "reports", "imgs", "Exhibit_Inspect", "Tx_meeting", "会场控制截屏.png")
# os.makedirs(os.path.dirname(screenshot_path), exist_ok=True)
# self.app_drive.get_screenshot_as_file(screenshot_path)
# logging.info(f"截图已保存到: {screenshot_path}")
# except Exception as e:
# logging.error(f"发生错误: {e}", exc_info=True)
# self.fail(f"测试过程中发生错误: {e}")
#
# if __name__ == '__main__':
# # 创建测试套件
# suite = unittest.TestSuite()
# suite.addTest(TestAppTXCent('test_app_txcent'))
#
# # 定义报告文件路径
# report_path = os.path.join(os.getcwd(), "reports", "Exhibit_Inspect", "Tx_meeting", "test_report.html")
# os.makedirs(os.path.dirname(report_path), exist_ok=True)
#
# # 运行测试并生成报告
# with open(report_path, 'wb') as f:
# runner = HTMLTestRunner(stream=f, title='腾讯会议自动化测试报告', description='测试报告详情')
# runner.run(suite)
预定系统/cases/展厅巡检/__st__.py
浏览文件 @
ae97288e
...
...
@@ -17,4 +17,5 @@ def suite_setup():
browser_init
(
login_exhibit_url
)
wd
=
GSTORE
[
'wd'
]
admin_login
(
"admin@huazhao"
,
"huazhao@1234"
)
\ No newline at end of file
admin_login
(
"Test02"
,
"ubains@123"
)
SELENIUM_LOG_SCREEN
(
wd
,
"50
%
"
,
"Exhibit_Inspect"
,
"Tx_meeting"
,
"会场画面截屏"
)
\ No newline at end of file
预定系统/cases/登录模块/__st__.py
浏览文件 @
ae97288e
...
...
@@ -13,8 +13,9 @@ from 预定系统.Base.base import *
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
def
suite_teardown
():
...
...
预定系统/cases/系统管理/__st__.py
浏览文件 @
ae97288e
...
...
@@ -13,8 +13,9 @@ from 预定系统.Base.base import *
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
...
...
预定系统/cases/账号管理/用户管理/__st__.py
浏览文件 @
ae97288e
...
...
@@ -16,8 +16,9 @@ except ModuleNotFoundError as e:
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
...
...
预定系统/cases/账号管理/部门管理/__st__.py
浏览文件 @
ae97288e
...
...
@@ -10,8 +10,9 @@ from 预定系统.Base.base import *
def
suite_setup
():
STEP
(
1
,
"初始化浏览器"
)
login_url
=
'https://192.168.5.218/#/login/logindf'
login_ngrok_url
=
"https://nat.ubainsyun.com:11046"
# login_url = 'https://192.168.5.218/#/login/logindf'
# login_ngrok_url = "https://nat.ubainsyun.com:11046"
login_url
=
'http://192.168.5.200:8080/#/login/logindf'
browser_init
(
login_url
)
wd
=
GSTORE
[
'wd'
]
...
...
预定系统/reports/report_20241129_120300.html
deleted
100644 → 0
浏览文件 @
a8255348
此差异已折叠。
点击以展开。
预定系统/reports/report_20241129_161101.html
deleted
100644 → 0
浏览文件 @
a8255348
此差异已折叠。
点击以展开。
预定系统/定时执行功能测试.py
浏览文件 @
ae97288e
...
...
@@ -68,7 +68,12 @@ start_workers(3)
# 定义每天定时执行的任务
# 每天早上07:50执行后台系统设置功能测试
schedule
.
every
()
.
day
.
at
(
"07:50"
)
.
do
(
run_task
,
run_automation_test
,
report_title
=
"预定系统_后台管理功能_测试报告"
,
report_url_prefix
=
"http://nat.ubainsyun.com:31133"
,
test_case
=
"后台管理功能"
)
schedule
.
every
()
.
saturday
.
at
(
"12:00"
)
.
do
(
run_task
,
run_automation_test
,
report_title
=
"预定系统_后台管理功能_测试报告"
,
report_url_prefix
=
"http://nat.ubainsyun.com:31133"
,
test_case
=
"后台管理功能"
)
schedule
.
every
()
.
day
.
at
(
"08:15"
)
.
do
(
run_task
,
run_automation_test
,
report_title
=
"展厅巡检_会议预约测试报告"
,
report_url_prefix
=
"http://nat.ubainsyun.com:31133"
,
test_case
=
"展厅巡检"
)
schedule
.
every
()
.
day
.
at
(
"08:25"
)
.
do
(
run_task
,
run_automation_test
,
report_title
=
"展厅巡检_腾讯终端入会测试报告"
,
report_url_prefix
=
"http://nat.ubainsyun.com:31133"
,
test_case
=
"展厅巡检_腾讯会议"
)
try
:
# 无限循环,持续检查并执行计划任务
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论