提交 f5ca9ae3 authored 作者: 陈泽健's avatar 陈泽健

补充用户管理模块的新增用户部分代码,当前存在新增界面弹窗后定位失败问题。

上级 a11c5347
......@@ -72,6 +72,32 @@ def admin_login():
(By.XPATH, '//*[@id="app"]/div/div[3]/div[1]/div[2]/div/form/div[4]/input')
)).click()
INFO("进入后台")
WebDriverWait(wd, 10).until(
EC.element_to_be_clickable(
(By.XPATH, '//*[@id="app"]/div/div[1]/div/img[2]')
)).click()
def enter_the_backend():
INFO("进入后台")
wd = GSTORE['wd']
WebDriverWait(wd, 10).until(
EC.element_to_be_clickable(
(By.XPATH, '//*[@id="app"]/div/div[1]/div/img[2]')
)).click()
INFO("打开账号管理下拉菜单")
WebDriverWait(wd, 10).until(
EC.element_to_be_clickable(
(By.XPATH, '//*[@id="app"]/div/div[2]/div[1]/ul/li[3]/div/span[1]')
)).click()
INFO("进入用户管理模块")
WebDriverWait(wd, 10).until(
EC.element_to_be_clickable(
(By.XPATH, '//*[@id="app"]/div/div[2]/div[1]/ul/li[3]/ul/li/ul/li[4]')
)).click()
def browser_quit():
INFO("清除浏览器")
wd = GSTORE['wd']
......
......@@ -22,3 +22,4 @@
6. 2024-11-02
- 将原有pytest框架代码改为hytest框架使用,优化了脚本执行效率,并对应增加异常处理。
- MQTT相关模块目前调整了Mqtt_Send.py文件中封装的方法优化,增加异常处理。处理了登录成功断言失败的问题。
- 补充用户管理模块的新增用户部分代码,当前存在新增界面弹窗后定位失败问题。
\ No newline at end of file
......@@ -64,47 +64,47 @@ def clear_and_send_keys(wd, locator, value):
element.send_keys(value)
class Login_000x:
class Login_00x:
ddt_cases = [
{
'name': '登录 UI_0001',
'name': '登录 UI_001',
'para': [None,'Ubains@4321','csba','请输入账号!']
},
{
'name': '登录 UI_0002',
'name': '登录 UI_002',
'para': ['admin@czj',None,'csba','请输入密码!']
},
{
'name': '登录 UI_0003',
'name': '登录 UI_003',
'para': ['admin@czj','Ubains@4321',None,'请输入验证码!']
},
{
'name': '登录 UI_0004',
'name': '登录 UI_004',
'para': ['admin@czj112','Ubains@4321','csba','账号或密码错误']
},
{
'name': '登录 UI_0005',
'name': '登录 UI_005',
'para': ['adM 12in@czj','Ubains@4321','csba','账号或密码错误']
},
{
'name': '登录 UI_0006',
'name': '登录 UI_006',
'para': ['admin@czj', '12345', 'csba', '账号或密码错误']
},
{
'name': '登录 UI_0007',
'name': '登录 UI_007',
'para': ['admin@czj', 'U bains1s@432', 'csba', '账号或密码错误']
},
{
'name': '登录 UI_0008',
'name': '登录 UI_008',
'para': ['admin@czj', 'Ubains@4321', '123', '验证码错误']
},
{
'name': '登录 UI_0009',
'name': '登录 UI_009',
'para': ['admin@czj', 'Ubains@4321', 'cs 12', '验证码错误']
},
{
'name': '登录 UI_0010',
'name': '登录 UI_010',
'para': ['admin@czj', 'Ubains@4321', 'csba', '欢迎 预定标准版测试']
}
]
......@@ -144,6 +144,7 @@ class Login_000x:
# 等待1秒以允许页面响应
sleep(2)
SELENIUM_LOG_SCREEN(wd)
# 根据预期的检查文本类型,获取并记录提示信息
if check_text == "欢迎 预定标准版测试":
notify_text = WebDriverWait(wd, DEFAULT_WAIT_TIME).until(
......
......@@ -17,3 +17,4 @@ except ModuleNotFoundError as e:
def suite_setup():
admin_login()
enter_the_backend()
\ No newline at end of file
import sys
import os
import time
from time import sleep
from selenium.common.exceptions import TimeoutException, NoSuchElementException, ElementNotInteractableException, \
NoSuchWindowException
from hytest import *
from selenium.webdriver.support.select import Select
# 获取当前脚本的绝对路径
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 *
except ModuleNotFoundError as e:
print(f"ModuleNotFoundError: {e}")
print("尝试使用绝对路径导入")
from 预定系统.Base.base import *
DEFAULT_WAIT_TIME = 20
# 默认等待时间(秒),用于元素加载或操作之间的等待
CLASS_MESSAGE_CONTENT = 'el-message__content'
def safe_send_keys(element_locator, value, wd):
try:
element = WebDriverWait(wd, 10).until(EC.visibility_of_element_located(element_locator))
element.send_keys(value)
except TimeoutException:
print(f"TimeoutException: Element {element_locator} not found or not clickable within 10 seconds.")
except NoSuchElementException:
print(f"NoSuchElementException: Element {element_locator} not found.")
except ElementNotInteractableException:
print(f"ElementNotInteractableException: Element {element_locator} is not interactable.")
def safe_click(element_locator, wd):
try:
element = WebDriverWait(wd, 10).until(EC.visibility_of_element_located(element_locator))
element.click()
except TimeoutException:
print(f"TimeoutException: Element {element_locator} not found or not clickable within 10 seconds.")
except NoSuchElementException:
print(f"NoSuchElementException: Element {element_locator} not found.")
except ElementNotInteractableException:
print(f"ElementNotInteractableException: Element {element_locator} is not interactable.")
def handle_modal_popup(wd):
try:
# 等待模态弹窗出现
modal_popup = WebDriverWait(wd, 10).until(EC.visibility_of_element_located((By.XPATH, '/html/body/div[2]/div')))
except TimeoutException:
print("TimeoutException: Modal popup not found within 10 seconds.")
except NoSuchElementException:
print("NoSuchElementException: Elements in modal popup not found.")
except ElementNotInteractableException:
print("ElementNotInteractableException: Elements in modal popup are not interactable.")
except Exception as e:
print(f"Unexpected error: {e}")
class Add_User_00x:
ddt_cases = [
{
'name': '用户新增_001',
'para': [None, 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号为空']
},
{
'name': '用户新增_002',
'para': ['123', 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号格式错误']
},
{
'name': '用户新增_003',
'para': ['a123', 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号格式错误']
},
{
'name': '用户新增_004',
'para': ['a123##', 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号格式错误']
},
{
'name': '用户新增_005',
'para': ['@@@@@', 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号格式错误']
},
{
'name': '用户新增_006',
'para': ['_____', 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号格式错误']
},
{
'name': '用户新增_007',
'para': ['admin@admin', 'admin', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '账号格式错误']
},
{
'name': '用户新增_008',
'para': ['admin@123', None, 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '用户名为空']
},
{
'name': '用户新增_009',
'para': ['admin@123', '张三', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '操作成功']
},
{
'name': '用户新增_010',
'para': ['admin@123', '张三', None, 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码为空']
},
{
'name': '用户新增_011',
'para': ['admin@123', '张三', '123', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码长度不足11位']
},
{
'name': '用户新增_012',
'para': ['admin@123', '张三', 'qazwsxedcrf', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_013',
'para': ['admin@123', '张三', 'qazwsxedcr1', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_014',
'para': ['admin@123', '张三', '12345678901', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_015',
'para': ['admin@123', '张三', '1qazwsxedcr', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_016',
'para': ['admin@123', '张三', 'Ubains9876', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '密码长度不足11位']
},
{
'name': '用户新增_017',
'para': ['admin@123', '张三', 'Ubains12345', 'Ubains@54321', '测试', '男', '13724387311', '1064963571@qq.com', '有连续3位及以上的连续数字']
},
{
'name': '用户新增_018',
'para': ['admin@1234', '张二', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387312', '1064963572@qq.com', '操作成功']
},
{
'name': '用户新增_019',
'para': ['admin@1234', '张二', 'Ubains@54321', 'Ubains@543210', '测试', '男', '13724387312', '1064963572@qq.com', '两次密码不一致']
},
{
'name': '用户新增_020',
'para': ['admin@123', '张三', 'Ubains@54321', None, '测试', '男', '13724387311', '1064963571@qq.com', '密码为空']
},
{
'name': '用户新增_021',
'para': ['admin@123', '张三', 'Ubains@54321', '123', '测试', '男', '13724387311', '1064963571@qq.com', '密码长度不足11位']
},
{
'name': '用户新增_022',
'para': ['admin@123', '张三', 'Ubains@54321', 'qazwsxedcrf', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_023',
'para': ['admin@123', '张三', 'Ubains@54321', '12345678901', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_024',
'para': ['admin@123', '张三', 'Ubains@54321', 'qazwsxedcr1', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_025',
'para': ['admin@123', '张三', 'Ubains@54321', '12345678901', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_026',
'para': ['admin@123', '张三', 'Ubains@54321', '1qazwsxedcr', '测试', '男', '13724387311', '1064963571@qq.com', '密码没有包含大小写字母和数字']
},
{
'name': '用户新增_027',
'para': ['admin@123', '张三', 'Ubains@54321', 'Ubains9876', '测试', '男', '13724387311', '1064963571@qq.com', '密码长度不足11位']
},
{
'name': '用户新增_028',
'para': ['admin@123', '张三', 'Ubains@54321', 'Ubains12345', '测试', '男', '13724387311', '1064963571@qq.com', '有连续3位及以上的连续数字']
},
{
'name': '用户新增_029',
'para': ['admin@12345', '张四', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387313', '1064963573@qq.com', '操作成功']
},
{
'name': '用户新增_030',
'para': ['admin@12345', '张四', 'Ubains@543210', 'Ubains@54321', '测试', '男', '13724387313', '1064963573@qq.com', '两次密码不一致']
},
{
'name': '用户新增_031',
'para': ['admin@123456', '李四', 'Ubains@54321', 'Ubains@54321', None, '男', '13724387313', '1064963573@qq.com', '操作成功']
},
{
'name': '用户新增_032',
'para': ['admin@1234567', '王五', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387314', '1064963574@qq.com', '操作成功']
},
{
'name': '用户新增_033',
'para': ['admin@12345678', '王六', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387314', '1064963574@qq.com', '操作成功']
},
{
'name': '用户新增_034',
'para': ['admin@chen', 'chen', 'Ubains@54321', 'Ubains@54321', '测试', '女', '13724387315', '1064963575@qq.com', '操作成功']
},
{
'name': '用户新增_035',
'para': ['admin@chen1', 'chen1', 'Ubains@54321', 'Ubains@54321', '测试', '保密', '13724387316', '1064963576@qq.com', '操作成功']
},
{
'name': '用户新增_036',
'para': ['admin@chen2', 'chen2', 'Ubains@54321', 'Ubains@54321', '测试', '男', '23724387317', '1064963577@qq.com', '手机号码格式错误']
},
{
'name': '用户新增_037',
'para': ['admin@chen2', 'chen2', 'Ubains@54321', 'Ubains@54321', '测试', '男', '1372438731', '1064963573@qq.com', '手机号码格式错误']
},
{
'name': '用户新增_038',
'para': ['admin@chen2', 'chen2', 'Ubains@54321', 'Ubains@54321', '测试', '男', '1372438731@', '1064963573@qq.com', '手机号码格式错误']
},
{
'name': '用户新增_039',
'para': ['admin@chen2', 'chen2', 'Ubains@54321', 'Ubains@54321', '测试', '男', '137243873 1', '1064963573@qq.com', '手机号码格式错误']
},
{
'name': '用户新增_040',
'para': ['admin@chen2', 'chen2', 'Ubains@54321', 'Ubains@54321', '测试', '男', '137243873a1', '1064963573@qq.com', '手机号码格式错误']
},
{
'name': '用户新增_041',
'para': ['admin@chen2', 'chen2', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387317', '1064963577@qq.com', '操作成功']
},
{
'name': '用户新增_042',
'para': ['admin@chen3', 'chen3', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387318', '###', '邮箱格式错误']
},
{
'name': '用户新增_043',
'para': ['admin@chen3', 'chen3', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387318', '121221', '邮箱格式错误']
},
{
'name': '用户新增_044',
'para': ['admin@chen3', 'chen3', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387318', 'adasda', '邮箱格式错误']
},
{
'name': '用户新增_045',
'para': ['admin@chen4', 'chen4', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387319', '2919407803@qq.com', '操作成功']
},
{
'name': '用户新增_046',
'para': ['admin@ZDH', 'chen4', 'Ubains@54321', 'Ubains@54321', '测试', '男', '13724387319', '2919407803@qq.com', '添加用户失败,账号在系统中已存在!']
}
]
def teststeps(self):
"""
执行测试步骤以用户新增功能。
本函数根据参数输入账号、密码和验证码,并检查登录后的提示信息是否与预期相符。
"""
# 初始化通知文本为空字符串
notify_text = ""
# 从全局存储中获取webdriver实例
wd = GSTORE['wd']
# 从self.para中解构出用户名、密码、验证码和检查文本
account, username, password, check_password, department, gender, phone, email, check_text = self.para
STEP(1, "点击【新增】按钮")
WebDriverWait(wd, 10).until(
EC.element_to_be_clickable(
(By.XPATH, '//*[@id="app"]/div/div[2]/div[2]/div/div/div[2]/div[2]/button[2]/span')
)).click()
sleep(1)
handle_modal_popup(wd)
STEP(2,
f"输入账号:{account},用户名:{username},密码:{password},确认密码: {check_password},手机号:{phone},邮箱:{email}")
if account is not None:
safe_send_keys((By.XPATH, '/html/body/div[3]/div/div[2]/div[1]/div/input'), account, wd)
if username is not None:
safe_send_keys((By.XPATH, '/html/body/div[5]/div/div[2]/div[2]/div/input'), username, wd)
if password is not None:
safe_send_keys((By.XPATH, '/html/body/div[5]/div/div[2]/div[3]/div[2]/input'), password, wd)
if check_password is not None:
safe_send_keys((By.XPATH, '/html/body/div[5]/div/div[2]/div[4]/div[2]/input'), check_password, wd)
safe_click((By.XPATH, '/html/body/div[5]/div/div[2]/div[5]/div/div[1]/input'), wd)
safe_click((By.XPATH, '//*[@id="cascader-menu-1727-0-0"]/span'), wd)
safe_click((By.XPATH, '/html/body/div[5]/div/div[2]/div[6]/div/label[1]/span[2]'), wd)
safe_send_keys((By.XPATH, '/html/body/div[5]/div/div[2]/div[7]/div/input'), phone, wd)
safe_send_keys((By.XPATH, '/html/body/div[5]/div/div[2]/div[8]/div/input'), email, wd)
SELENIUM_LOG_SCREEN(wd)
STEP(3, "点击【确定】按钮")
time.sleep(2)
safe_click((By.XPATH, '/html/body/div[5]/div/div[3]/span/button/span'), wd)
try:
notify_text = WebDriverWait(wd, DEFAULT_WAIT_TIME).until(
EC.presence_of_element_located((By.XPATH, CLASS_MESSAGE_CONTENT))
).text
except Exception as e:
INFO(f"Exception occurred: {e}")
INFO(f"Alert text: {notify_text}")
STEP(4, f"校验提示信息: {check_text}")
# 设置隐式等待时间
wd.implicitly_wait(DEFAULT_WAIT_TIME)
# 检查点:验证提示信息是否与预期相符
CHECK_POINT('弹出提示', notify_text == check_text)
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 15:34:53</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 15:35:04</td>
</tr>
<tr>
<td>耗时</td>
<td>10.984 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>1</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:34:53</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\登录模块\账号密码登录测试.py">
<div>
<span class="label">进入文件</span>
<span>cases\登录模块\账号密码登录测试.py</span>
</div>
<div class="case pass" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">登录 UI_0010</span>
<span class="executetime">2024-11-02 15:35:00</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span>
<div class="test_steps" id="test_steps 登录 UI_0010">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>输入账号: admin@czj, 密码: Ubains@4321, 验证码: csba</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>点击登录按钮</span>
</div>
<div class="info">Alert text: 欢迎 预定标准版测试</div>
<div class="case_step">
<span class="tag">步骤 #3</span>
<span>校验提示信息: 欢迎 预定标准版测试</span>
</div>
<div class="checkpoint_pass">
<span class="tag">检查点 PASS</span>
<span>弹出提示</span>
</div>
</div>
<div class="case_teardown teardown case_st_lable" id="case_teardown teardown 登录 UI_0010">
<span class="label">用例清除</span>
<div class="case_step">
<span class="tag">步骤 #4</span>
<span>刷新页面</span>
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:35:02</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="none">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 16:23:00</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 16:23:13</td>
</tr>
<tr>
<td>耗时</td>
<td>12.610 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>1</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:23:00</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\设备管理\安卓信息上报.py">
<div>
<span class="label">进入文件</span>
<span>cases\设备管理\安卓信息上报.py</span>
</div>
<div class="case pass" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">设备上报_0001</span>
<span class="executetime">2024-11-02 16:23:06</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\设备管理\安卓信息上报.py::Android_000x</span>
<div class="test_steps" id="test_steps 设备上报_0001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>连接MQTT</span>
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:23:11</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="none">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 16:24:06</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 16:24:39</td>
</tr>
<tr>
<td>耗时</td>
<td>32.573 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>1</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:24:06</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\设备管理\安卓信息上报.py">
<div>
<span class="label">进入文件</span>
<span>cases\设备管理\安卓信息上报.py</span>
</div>
<div class="case pass" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">设备上报_0001</span>
<span class="executetime">2024-11-02 16:24:16</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\设备管理\安卓信息上报.py::Android_000x</span>
<div class="test_steps" id="test_steps 设备上报_0001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>连接MQTT</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>MQTT发送消息</span>
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:24:37</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="none">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 16:26:59</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 16:27:28</td>
</tr>
<tr>
<td>耗时</td>
<td>28.932 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>1</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:26:59</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\设备管理\安卓信息上报.py">
<div>
<span class="label">进入文件</span>
<span>cases\设备管理\安卓信息上报.py</span>
</div>
<div class="case pass" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">设备上报_0001</span>
<span class="executetime">2024-11-02 16:27:04</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\设备管理\安卓信息上报.py::Android_000x</span>
<div class="test_steps" id="test_steps 设备上报_0001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>连接MQTT</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>MQTT发送消息</span>
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:27:26</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="none">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -309,15 +309,15 @@ function next_error(){
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 15:29:53</td>
<td>2024/11/02 20:56:07</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 15:30:03</td>
<td>2024/11/02 20:56:19</td>
</tr>
<tr>
<td>耗时</td>
<td>10.196</td>
<td>12.187</td>
</tr>
<tr>
<td>预备执行用例数量</td>
......@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:29:53</span>
<span class="executetime">2024-11-02 20:56:07</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
......@@ -419,10 +419,10 @@ function next_error(){
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">登录 UI_0001</span>
<span class="executetime">2024-11-02 15:29:59</span>
<span class="executetime">2024-11-02 20:56:14</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span>
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::Login_000x</span>
<div class="test_steps" id="test_steps 登录 UI_0001">
<span class="label">测试步骤</span>
<div class="case_step">
......@@ -433,6 +433,9 @@ function next_error(){
<span class="tag">步骤 #2</span>
<span>点击登录按钮</span>
</div>
<div>
<img class="screenshot" src="imgs/20241102205617064337.png" width="aa">
</div>
<div class="info">Alert text: 请输入账号!</div>
<div class="case_step">
<span class="tag">步骤 #3</span>
......@@ -456,7 +459,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:30:01</span>
<span class="executetime">2024-11-02 20:56:17</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
......
......@@ -309,15 +309,15 @@ function next_error(){
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 15:31:29</td>
<td>2024/11/02 22:05:59</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 15:31:40</td>
<td>2024/11/02 22:06:10</td>
</tr>
<tr>
<td>耗时</td>
<td>11.284</td>
<td>11.108</td>
</tr>
<tr>
<td>预备执行用例数量</td>
......@@ -333,11 +333,11 @@ function next_error(){
</tr>
<tr>
<td>失败</td>
<td style="color:red">1</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>阻塞</td>
......@@ -369,15 +369,15 @@ function next_error(){
</div>
</div>
<div class="barchar_item">
<span>用例失败 100% : 1</span>
<span>用例失败 0% : 0</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #bb4069;"></div>
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0</span>
<span>用例异常 100% : 1</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
<div class="barchart_bar" style="width: 100.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
......@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:31:29</span>
<span class="executetime">2024-11-02 22:05:59</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
......@@ -410,49 +410,50 @@ function next_error(){
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\登录模块\账号密码登录测试.py">
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入文件</span>
<span>cases\登录模块\账号密码登录测试.py</span>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="case fail" id="case_00000001">
<div class="suite_setup setup" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label caselabel">用例 FAIL</span>
<span class="casename">登录 UI_0010</span>
<span class="executetime">2024-11-02 15:31:35</span>
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:06:08</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span>
<div class="test_steps" id="test_steps 登录 UI_0010">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>输入账号: admin@czj, 密码: Ubains@4321, 验证码: csba</span>
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>点击登录按钮</span>
</div>
<div class="info">Alert text: 欢迎 预定标准版测试</div>
<div class="case_step">
<span class="tag">步骤 #3</span>
<span>校验提示信息: 欢迎</span>
</div>
<div class="checkpoint_fail">
<span class="tag">检查点 FAIL</span>
<span>弹出提示</span>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div>
<span class="label">进入文件</span>
<span>cases\账号管理\用户管理.py</span>
</div>
<div class="info error-info">
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\登录模块\账号密码登录测试.py&quot;, line 167, in teststeps
CHECK_POINT('弹出提示', notify_text == check_text)</div>
<div class="case abort" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 ABORT</span>
<span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 22:06:08</span>
</div>
<div class="case_teardown teardown case_st_lable" id="case_teardown teardown 登录 UI_0010">
<span class="label">用例清除</span>
<div class="folder_body">
<span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #4</span>
<span>刷新页面</span>
<span class="tag">步骤 #1</span>
<span>点击【新增】按钮</span>
</div>
<div class="info error-info">'WebDriver' object has no attribute 'find_element_by_xpath'
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\用户管理.py&quot;, line 252, in teststeps
wd.find_element_by_xpath('//*[@id=&quot;app&quot;]/div/div[2]/div[2]/div/div/div[2]/div[2]/button[2]/span').clck()
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'
</div>
</div>
</div>
</div>
......@@ -460,7 +461,7 @@ Traceback:
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:31:38</span>
<span class="executetime">2024-11-02 22:06:08</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
......
......@@ -309,15 +309,15 @@ function next_error(){
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 16:25:16</td>
<td>2024/11/02 22:08:06</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 16:25:47</td>
<td>2024/11/02 22:08:16</td>
</tr>
<tr>
<td>耗时</td>
<td>30.667</td>
<td>9.684</td>
</tr>
<tr>
<td>预备执行用例数量</td>
......@@ -325,11 +325,11 @@ function next_error(){
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>通过</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>失败</td>
......@@ -341,11 +341,11 @@ function next_error(){
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>套件清除 失败</td>
......@@ -363,9 +363,9 @@ function next_error(){
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 100% : 1</span>
<span>用例通过 0% : 0</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #04AA6D;"></div>
<div class="barchart_bar" style="width: 0.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
......@@ -381,9 +381,9 @@ function next_error(){
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0</span>
<span>用例阻塞 100% : 1</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
<div class="barchart_bar" style="width: 100.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
......@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:25:16</span>
<span class="executetime">2024-11-02 22:08:06</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
......@@ -410,37 +410,36 @@ function next_error(){
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\设备管理\安卓信息上报.py">
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入文件</span>
<span>cases\设备管理\安卓信息上报.py</span>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="case pass" id="case_00000001">
<div class="suite_setup setup fail" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">设备上报_0001</span>
<span class="executetime">2024-11-02 16:25:23</span>
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:08:13</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\设备管理\安卓信息上报.py::Android_000x</span>
<div class="test_steps" id="test_steps 设备上报_0001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>连接MQTT</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>MQTT发送消息</span>
</div>
</div>
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info error-info">suite setup fail | 'WebDriver' object has no attribute 'find_element_by_link_text'
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\__st__.py&quot;, line 21, in suite_setup
wd.find_element_by_link_text('账号管理').click()
AttributeError: 'WebDriver' object has no attribute 'find_element_by_link_text'
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 16:25:45</span>
<span class="executetime">2024-11-02 22:08:14</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
......@@ -453,7 +452,7 @@ function next_error(){
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="none">
<div class="error_jumper" display="block">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
......
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 22:13:15</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 22:13:37</td>
</tr>
<tr>
<td>耗时</td>
<td>21.543 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>0</td>
</tr>
<tr>
<td>通过</td>
<td>0</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
</tr>
<tr>
<td>阻塞</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:13:15</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="suite_setup setup fail" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:13:24</span>
</div>
<div class="folder_body">
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info">进入后台</div>
<div class="info">打开账号管理下拉菜单</div>
<div class="info error-info">suite setup fail | Message:
Stacktrace:
GetHandleVerifier [0x00007FF63C4DFD55+29557]
(No symbol) [0x00007FF63C4521F0]
(No symbol) [0x00007FF63C30B6EA]
(No symbol) [0x00007FF63C35FA15]
(No symbol) [0x00007FF63C35FC6C]
(No symbol) [0x00007FF63C3ABB07]
(No symbol) [0x00007FF63C38753F]
(No symbol) [0x00007FF63C3A88A3]
(No symbol) [0x00007FF63C3872A3]
(No symbol) [0x00007FF63C3512DF]
(No symbol) [0x00007FF63C352451]
GetHandleVerifier [0x00007FF63C80DC4D+3363437]
GetHandleVerifier [0x00007FF63C859AD7+3674359]
GetHandleVerifier [0x00007FF63C84EA7B+3629211]
GetHandleVerifier [0x00007FF63C59FC16+815670]
(No symbol) [0x00007FF63C45D69F]
(No symbol) [0x00007FF63C459264]
(No symbol) [0x00007FF63C459400]
(No symbol) [0x00007FF63C4481AF]
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\__st__.py&quot;, line 20, in suite_setup
enter_the_backend()
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\Base\base.py&quot;, line 90, in enter_the_backend
WebDriverWait(wd, 10).until(
File &quot;C:\Users\29194\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py&quot;, line 105, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
GetHandleVerifier [0x00007FF63C4DFD55+29557]
(No symbol) [0x00007FF63C4521F0]
(No symbol) [0x00007FF63C30B6EA]
(No symbol) [0x00007FF63C35FA15]
(No symbol) [0x00007FF63C35FC6C]
(No symbol) [0x00007FF63C3ABB07]
(No symbol) [0x00007FF63C38753F]
(No symbol) [0x00007FF63C3A88A3]
(No symbol) [0x00007FF63C3872A3]
(No symbol) [0x00007FF63C3512DF]
(No symbol) [0x00007FF63C352451]
GetHandleVerifier [0x00007FF63C80DC4D+3363437]
GetHandleVerifier [0x00007FF63C859AD7+3674359]
GetHandleVerifier [0x00007FF63C84EA7B+3629211]
GetHandleVerifier [0x00007FF63C59FC16+815670]
(No symbol) [0x00007FF63C45D69F]
(No symbol) [0x00007FF63C459264]
(No symbol) [0x00007FF63C459400]
(No symbol) [0x00007FF63C4481AF]
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:13:35</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="block">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -309,15 +309,15 @@ function next_error(){
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 15:30:32</td>
<td>2024/11/02 22:14:15</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 15:30:44</td>
<td>2024/11/02 22:14:26</td>
</tr>
<tr>
<td>耗时</td>
<td>12.032</td>
<td>11.111</td>
</tr>
<tr>
<td>预备执行用例数量</td>
......@@ -329,7 +329,7 @@ function next_error(){
</tr>
<tr>
<td>通过</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>失败</td>
......@@ -337,7 +337,7 @@ function next_error(){
</tr>
<tr>
<td>异常</td>
<td style="">0</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>阻塞</td>
......@@ -363,9 +363,9 @@ function next_error(){
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 100% : 1</span>
<span>用例通过 0% : 0</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #04AA6D;"></div>
<div class="barchart_bar" style="width: 0.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
......@@ -375,9 +375,9 @@ function next_error(){
</div>
</div>
<div class="barchar_item">
<span>用例异常 0% : 0</span>
<span>用例异常 100% : 1</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #9c27b0;"></div>
<div class="barchart_bar" style="width: 100.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
......@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:30:32</span>
<span class="executetime">2024-11-02 22:14:15</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
......@@ -410,45 +410,54 @@ function next_error(){
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\登录模块\账号密码登录测试.py">
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入文件</span>
<span>cases\登录模块\账号密码登录测试.py</span>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="case pass" id="case_00000001">
<div class="suite_setup setup" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label caselabel">用例 PASS</span>
<span class="casename">登录 UI_0001</span>
<span class="executetime">2024-11-02 15:30:39</span>
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:14:23</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span>
<div class="test_steps" id="test_steps 登录 UI_0001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>输入账号: None, 密码: Ubains@4321, 验证码: csba</span>
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info">进入后台</div>
<div class="info">打开账号管理下拉菜单</div>
<div class="info">进入用户管理模块</div>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>点击登录按钮</span>
</div>
<div class="info">Alert text: 请输入账号!</div>
<div class="case_step">
<span class="tag">步骤 #3</span>
<span>校验提示信息: 请输入账号!</span>
</div>
<div class="checkpoint_pass">
<span class="tag">检查点 PASS</span>
<span>弹出提示</span>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div>
<span class="label">进入文件</span>
<span>cases\账号管理\用户管理.py</span>
</div>
<div class="case abort" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 ABORT</span>
<span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 22:14:24</span>
</div>
<div class="case_teardown teardown case_st_lable" id="case_teardown teardown 登录 UI_0001">
<span class="label">用例清除</span>
<div class="folder_body">
<span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #4</span>
<span>刷新页面</span>
<span class="tag">步骤 #1</span>
<span>点击【新增】按钮</span>
</div>
<div class="info error-info">'WebDriver' object has no attribute 'find_element_by_xpath'
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\用户管理.py&quot;, line 252, in teststeps
wd.find_element_by_xpath('//*[@id=&quot;app&quot;]/div/div[2]/div[2]/div/div/div[2]/div[2]/button[2]/span').clck()
AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'
</div>
</div>
</div>
</div>
......@@ -456,7 +465,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:30:41</span>
<span class="executetime">2024-11-02 22:14:24</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
......@@ -469,7 +478,7 @@ function next_error(){
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="none">
<div class="error_jumper" display="block">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
......
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 22:18:59</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 22:19:12</td>
</tr>
<tr>
<td>耗时</td>
<td>13.309 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>0</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:18:59</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:19:08</span>
</div>
<div class="folder_body">
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info">进入后台</div>
<div class="info">打开账号管理下拉菜单</div>
<div class="info">进入用户管理模块</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div>
<span class="label">进入文件</span>
<span>cases\账号管理\用户管理.py</span>
</div>
<div class="case abort" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 ABORT</span>
<span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 22:19:10</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>点击【新增】按钮</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com</span>
</div>
<div class="info error-info">'NoneType' object is not iterable
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\用户管理.py&quot;, line 262, in teststeps
)).send_keys(account)
File &quot;C:\Users\29194\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py&quot;, line 232, in send_keys
Command.SEND_KEYS_TO_ELEMENT, {&quot;text&quot;: &quot;&quot;.join(keys_to_typing(value)), &quot;value&quot;: keys_to_typing(value)}
File &quot;C:\Users\29194\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\common\utils.py&quot;, line 137, in keys_to_typing
characters.extend(val)
TypeError: 'NoneType' object is not iterable
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:19:10</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="block">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 22:22:21</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 22:22:44</td>
</tr>
<tr>
<td>耗时</td>
<td>22.767 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>0</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:22:21</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:22:30</span>
</div>
<div class="folder_body">
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info">进入后台</div>
<div class="info">打开账号管理下拉菜单</div>
<div class="info">进入用户管理模块</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div>
<span class="label">进入文件</span>
<span>cases\账号管理\用户管理.py</span>
</div>
<div class="case abort" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 ABORT</span>
<span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 22:22:31</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>点击【新增】按钮</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com</span>
</div>
<div class="info error-info">Message:
Stacktrace:
GetHandleVerifier [0x00007FF63C4DFD55+29557]
(No symbol) [0x00007FF63C4521F0]
(No symbol) [0x00007FF63C30B6EA]
(No symbol) [0x00007FF63C35FA15]
(No symbol) [0x00007FF63C35FC6C]
(No symbol) [0x00007FF63C3ABB07]
(No symbol) [0x00007FF63C38753F]
(No symbol) [0x00007FF63C3A88A3]
(No symbol) [0x00007FF63C3872A3]
(No symbol) [0x00007FF63C3512DF]
(No symbol) [0x00007FF63C352451]
GetHandleVerifier [0x00007FF63C80DC4D+3363437]
GetHandleVerifier [0x00007FF63C859AD7+3674359]
GetHandleVerifier [0x00007FF63C84EA7B+3629211]
GetHandleVerifier [0x00007FF63C59FC16+815670]
(No symbol) [0x00007FF63C45D69F]
(No symbol) [0x00007FF63C459264]
(No symbol) [0x00007FF63C459400]
(No symbol) [0x00007FF63C4481AF]
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\用户管理.py&quot;, line 266, in teststeps
WebDriverWait(wd, 10).until(
File &quot;C:\Users\29194\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py&quot;, line 105, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
GetHandleVerifier [0x00007FF63C4DFD55+29557]
(No symbol) [0x00007FF63C4521F0]
(No symbol) [0x00007FF63C30B6EA]
(No symbol) [0x00007FF63C35FA15]
(No symbol) [0x00007FF63C35FC6C]
(No symbol) [0x00007FF63C3ABB07]
(No symbol) [0x00007FF63C38753F]
(No symbol) [0x00007FF63C3A88A3]
(No symbol) [0x00007FF63C3872A3]
(No symbol) [0x00007FF63C3512DF]
(No symbol) [0x00007FF63C352451]
GetHandleVerifier [0x00007FF63C80DC4D+3363437]
GetHandleVerifier [0x00007FF63C859AD7+3674359]
GetHandleVerifier [0x00007FF63C84EA7B+3629211]
GetHandleVerifier [0x00007FF63C59FC16+815670]
(No symbol) [0x00007FF63C45D69F]
(No symbol) [0x00007FF63C459264]
(No symbol) [0x00007FF63C459400]
(No symbol) [0x00007FF63C4481AF]
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:22:42</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="block">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<title>测试报告</title>
<meta charset="UTF-8">
<style>body {
font-family: consolas, Verdana, sans-serif;
font-size: .95em;
color: #696e71;
display: grid;
grid-template-columns: 1fr 5rem;
}
.main_section {
width: 90%;
margin: 0 auto;
}
#float_menu{
position:fixed;
top:0;
right:0;
text-align: center;
}
#float_menu .menu-item {
cursor: pointer;
padding: .5em;
margin: .5em 0;
color: #c08580;
background-color: #f8f0ef;
font-size: 1.2em;
}
.result{
display: flex;
}
.result_table{
border-collapse: collapse;
border: 1px solid #f0e0e5;
width: 30em;
text-align: center;
font-size: 1.0em;
}
.result_table td{
border: 1px solid #f0e0e5;
padding: .3em;
}
.result_barchart{
width: 30em;
margin: 0 5em 0 5em;
}
.barchar_item{
margin: 2.5rem 0;
}
.barchart_barbox {
margin: 0.5em 0;
width: 100%;
background-color: #fff;
border: 1px solid #86c2dd;
border-radius: .2em;
}
.barchart_bar {
text-align: right;
height: 1.2rem;
}
.h3_button {
margin: 1.5em;
cursor: pointer;
color: #03a9f4;
}
.info
{
white-space:pre-wrap;
margin: .8em 1.5em;
}
.error-info
{
color: #a64747
}
.suite_dir {
margin: 1em .2em;
padding: .3em;
/* background-color: #dfeff6; */
border: 1px solid #bcd8e4;
}
.suite_file {
margin: 1em .2em;
padding: .3em;
border: 1px solid #bcd8e4;
}
.case {
margin: 1em .2em;
/* padding: .3em; */
border: 1px solid #e7d4d4;
}
.case_class_path{
margin: 0em 1em;
}
.folder_header {
padding: .2em .7em;
background-color: #fffaf9;
cursor: pointer;
}
.setup{
margin: .2em;
/* padding: .3em; */
/* border: 1px solid #e7d4d4; */
}
.teardown{
margin: .2em;
/* padding: .3em;*/
/* border: 1px solid #e7d4d4; */
}
.test_steps{
margin: .2em;
padding: .3em;
/* border: 1px solid #e7d4d4; */
}
.label {
display: inline-block;
padding: .1em .5em;
font-size: .88em;
letter-spacing: 1px;
white-space: nowrap;
color: #0d6ebc;
border-radius: .2em;
min-width: 5em;
margin-right: 2em;
font-family: consolas;
}
/* .suite_setup .label{
color: #219e26 ;
}
.suite_teardown .label{
color: #219e26;
} */
/* .case.pass .casename{
color: #329132 ;
} */
.case.pass .caselabel{
color: white;
background-color: #3b9e3f;
}
/* .case.fail .casename{
color: #a64747;
} */
.case.fail .caselabel{
color: white;
background-color: #a64747;
}
/* .case.abort .casename{
color: #953ab7;
} */
.case.abort .caselabel{
color: white;
background-color: #9c27b0;
}
.case_step {
margin: .8em;
}
.checkpoint_pass {
margin: .8em;
}
.checkpoint_fail {
margin: .8em;
}
.case_step .tag{
color: #2196f3;;
margin: .3em 1em .3em 0;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_pass .tag{
color: #009806;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.checkpoint_fail .tag{
color: #9c2020;
margin:.3em 1em .3em .5em;
padding: .1em .3em;
font-size: .92em;
}
.screenshot {
border: 1px solid #86c2dd;
}
.executetime {
float: right;
}</style>
<script type="text/javascript">var FOLDER_ALL_CASES = false //是否为精简模式的标记
var ERROR_INFOS = []; // 错误信息列表
var current_error_idx = -1;
// 页面加载后执行的函数
window.addEventListener("load", function(){
// 所有 .folder_header 添加点击事件处理
let folderHeaderEles = document.querySelectorAll(".folder_header");
folderHeaderEles.forEach(function(ele) {
ele.addEventListener("click", function(event) {
let fb = event.target.closest('.folder_header').nextElementSibling;
fb.style.display = fb.style.display === 'none' ? 'block' : 'none'
});
});
// 找到所有的错误信息对象
ERROR_INFOS = document.querySelectorAll(".error-info");
});
function toggle_folder_all_cases(){
let eles = document.querySelectorAll(".folder_body");
FOLDER_ALL_CASES = !FOLDER_ALL_CASES;
document.getElementById('display_mode').innerHTML = FOLDER_ALL_CASES? "Detail" : "Summary"
for (const ele of eles){
ele.style.display = FOLDER_ALL_CASES? "none": "block"
}
}
function previous_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx -= 1;
if (current_error_idx<0)
current_error_idx = 0
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}
function next_error(){
// 查找错误必须是详细模式
if (FOLDER_ALL_CASES)
toggle_folder_all_cases()
current_error_idx += 1;
if (current_error_idx > ERROR_INFOS.length-1)
current_error_idx = ERROR_INFOS.length-1
let error = ERROR_INFOS[current_error_idx];
error.scrollIntoView({behavior: "smooth", block: "center", inline: "start"});
}</script>
</head>
<body>
<div class="main_section">
<h1 style="font-family: auto">测试报告</h1>
<h3>统计结果</h3>
<div class="result">
<table class="result_table">
<tbody>
<tr>
<td>hytest 版本</td>
<td>0.8.12</td>
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 22:25:26</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 22:25:48</td>
</tr>
<tr>
<td>耗时</td>
<td>21.883 秒</td>
</tr>
<tr>
<td>预备执行用例数量</td>
<td>1</td>
</tr>
<tr>
<td>实际执用例行数量</td>
<td>1</td>
</tr>
<tr>
<td>通过</td>
<td>0</td>
</tr>
<tr>
<td>失败</td>
<td style="">0</td>
</tr>
<tr>
<td>异常</td>
<td style="color:red">1</td>
</tr>
<tr>
<td>阻塞</td>
<td style="">0</td>
</tr>
<tr>
<td>套件初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>套件清除 失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例初始化失败</td>
<td style="">0</td>
</tr>
<tr>
<td>用例清除 失败</td>
<td style="">0</td>
</tr>
</tbody>
</table>
<div class="result_barchart">
<div class="barchar_item">
<span>用例通过 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #04AA6D;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例失败 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #bb4069;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例异常 100% : 1 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 100.0%; background-color: #9c27b0;"></div>
</div>
</div>
<div class="barchar_item">
<span>用例阻塞 0% : 0 个</span>
<div class="barchart_barbox">
<div class="barchart_bar" style="width: 0.0%; background-color: #dcbdbd;"></div>
</div>
</div>
</div>
</div>
<div style="margin-top:2em">
<h3 style="display:inline">执行日志</h3>
</div>
<div class="exec_log">
<div class="suite_dir" id="suite_dir cases\">
<div>
<span class="label">进入目录</span>
<span>cases\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:25:26</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
<div class="info">'----------' 正在处理SSL证书警告 '----------'</div>
<div class="info">'----------' SSL证书警告处理完成 '----------'</div>
</div>
</div>
</div>
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:25:34</span>
</div>
<div class="folder_body">
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info">进入后台</div>
<div class="info">打开账号管理下拉菜单</div>
<div class="info">进入用户管理模块</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div>
<span class="label">进入文件</span>
<span>cases\账号管理\用户管理.py</span>
</div>
<div class="case abort" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 ABORT</span>
<span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 22:25:35</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>点击【新增】按钮</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com</span>
</div>
<div class="info error-info">Message:
Stacktrace:
GetHandleVerifier [0x00007FF63C4DFD55+29557]
(No symbol) [0x00007FF63C4521F0]
(No symbol) [0x00007FF63C30B6EA]
(No symbol) [0x00007FF63C35FA15]
(No symbol) [0x00007FF63C35FC6C]
(No symbol) [0x00007FF63C3ABB07]
(No symbol) [0x00007FF63C38753F]
(No symbol) [0x00007FF63C3A88A3]
(No symbol) [0x00007FF63C3872A3]
(No symbol) [0x00007FF63C3512DF]
(No symbol) [0x00007FF63C352451]
GetHandleVerifier [0x00007FF63C80DC4D+3363437]
GetHandleVerifier [0x00007FF63C859AD7+3674359]
GetHandleVerifier [0x00007FF63C84EA7B+3629211]
GetHandleVerifier [0x00007FF63C59FC16+815670]
(No symbol) [0x00007FF63C45D69F]
(No symbol) [0x00007FF63C459264]
(No symbol) [0x00007FF63C459400]
(No symbol) [0x00007FF63C4481AF]
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\用户管理.py&quot;, line 266, in teststeps
WebDriverWait(wd, 10).until(
File &quot;C:\Users\29194\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\support\wait.py&quot;, line 105, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Stacktrace:
GetHandleVerifier [0x00007FF63C4DFD55+29557]
(No symbol) [0x00007FF63C4521F0]
(No symbol) [0x00007FF63C30B6EA]
(No symbol) [0x00007FF63C35FA15]
(No symbol) [0x00007FF63C35FC6C]
(No symbol) [0x00007FF63C3ABB07]
(No symbol) [0x00007FF63C38753F]
(No symbol) [0x00007FF63C3A88A3]
(No symbol) [0x00007FF63C3872A3]
(No symbol) [0x00007FF63C3512DF]
(No symbol) [0x00007FF63C352451]
GetHandleVerifier [0x00007FF63C80DC4D+3363437]
GetHandleVerifier [0x00007FF63C859AD7+3674359]
GetHandleVerifier [0x00007FF63C84EA7B+3629211]
GetHandleVerifier [0x00007FF63C59FC16+815670]
(No symbol) [0x00007FF63C45D69F]
(No symbol) [0x00007FF63C459264]
(No symbol) [0x00007FF63C459400]
(No symbol) [0x00007FF63C4481AF]
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 22:25:46</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
</div>
</div>
</div>
</div>
</div>
<div id="float_menu">
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div>
<div class="menu-item" onclick="window.open(&quot;http://www.byhy.net/tut/auto/hytest/01&quot;, &quot;_blank&quot;); ">帮助</div>
<div class="menu-item" id="display_mode" onclick="toggle_folder_all_cases()">Summary</div>
<div class="error_jumper" display="block">
<div class="menu-item" onclick="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div>
</div>
</body>
</html>
\ No newline at end of file
......@@ -309,15 +309,15 @@ function next_error(){
</tr>
<tr>
<td>开始时间</td>
<td>2024/11/02 15:32:36</td>
<td>2024/11/02 22:29:28</td>
</tr>
<tr>
<td>结束时间</td>
<td>2024/11/02 15:33:08</td>
<td>2024/11/02 22:31:39</td>
</tr>
<tr>
<td>耗时</td>
<td>32.050</td>
<td>130.549</td>
</tr>
<tr>
<td>预备执行用例数量</td>
......@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:32:36</span>
<span class="executetime">2024-11-02 22:29:28</span>
</div>
<div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div>
......@@ -410,28 +410,58 @@ function next_error(){
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\登录模块\账号密码登录测试.py">
<div class="suite_dir" id="suite_dir cases\账号管理\">
<div>
<span class="label">进入目录</span>
<span>cases\账号管理\</span>
</div>
<div class="suite_setup setup" id="suite_setup setup cases\账号管理\">
<div class="folder_header">
<span class="label">套件初始化</span>
<span>cases\账号管理\</span>
<span class="executetime">2024-11-02 22:29:36</span>
</div>
<div class="folder_body">
<div class="info">输入用户名:admin@czj</div>
<div class="info">输入密码:Ubains@4321</div>
<div class="info">输入验证码:csba</div>
<div class="info">点击登录按钮</div>
<div class="info">进入后台</div>
<div class="info">进入后台</div>
<div class="info">打开账号管理下拉菜单</div>
<div class="info">进入用户管理模块</div>
</div>
</div>
</div>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div>
<span class="label">进入文件</span>
<span>cases\登录模块\账号密码登录测试.py</span>
<span>cases\账号管理\用户管理.py</span>
</div>
<div class="case fail" id="case_00000001">
<div class="folder_header">
<span class="label caselabel">用例 FAIL</span>
<span class="casename">登录 UI_0010</span>
<span class="executetime">2024-11-02 15:32:43</span>
<span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 22:29:37</span>
</div>
<div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span>
<div class="test_steps" id="test_steps 登录 UI_0010">
<span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span>
<div class="case_step">
<span class="tag">步骤 #1</span>
<span>输入账号: admin@czj, 密码: Ubains@4321, 验证码: csba</span>
<span>点击【新增】按钮</span>
</div>
<div class="case_step">
<span class="tag">步骤 #2</span>
<span>点击登录按钮</span>
<span>输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com</span>
</div>
<div>
<img class="screenshot" src="imgs/20241102223102566579.png" width="aa">
</div>
<div class="case_step">
<span class="tag">步骤 #3</span>
<span>点击【登录】按钮</span>
</div>
<div class="info">Exception occurred: Message:
Stacktrace:
......@@ -457,9 +487,10 @@ Stacktrace:
BaseThreadInitThunk [0x00007FFD832E257D+29]
RtlUserThreadStart [0x00007FFD83FCAF08+40]
</div>
<div class="info">Alert text: </div>
<div class="case_step">
<span class="tag">步骤 #3</span>
<span>校验提示信息: 欢迎 预定标准版测试</span>
<span class="tag">步骤 #4</span>
<span>校验提示信息: 账号为空</span>
</div>
<div class="checkpoint_fail">
<span class="tag">检查点 FAIL</span>
......@@ -467,23 +498,16 @@ Stacktrace:
</div>
<div class="info error-info">
Traceback:
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\登录模块\账号密码登录测试.py&quot;, line 167, in teststeps
File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\用户管理.py&quot;, line 324, in teststeps
CHECK_POINT('弹出提示', notify_text == check_text)</div>
</div>
<div class="case_teardown teardown case_st_lable" id="case_teardown teardown 登录 UI_0010">
<span class="label">用例清除</span>
<div class="case_step">
<span class="tag">步骤 #4</span>
<span>刷新页面</span>
</div>
</div>
</div>
</div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header">
<span class="label">套件清除</span>
<span>cases\</span>
<span class="executetime">2024-11-02 15:33:06</span>
<span class="executetime">2024-11-02 22:31:37</span>
</div>
<div class="folder_body">
<div class="info">清除浏览器</div>
......
......@@ -14,6 +14,8 @@
== cases\设备管理\安卓信息上报.py
** no cases in this file, skip it.
== cases\设备管理\毫米波雷达上报.py
......@@ -25,8 +27,6 @@
== cases\账号管理\用户管理.py
** no cases in this file, skip it.
=== [ 执行测试用例 ] ===
......@@ -34,7 +34,7 @@
========= 测试开始 : 20241102_162943 =========
========= 测试开始 : 20241102_224704 =========
......@@ -46,43 +46,27 @@
'----------' SSL证书警告处理完成 '----------'
>>> cases\设备管理\安卓信息上报.py
* 设备上报_0001 - 2024-11-02 16:29:49
[ case execution steps ]
-- 第 1 步 -- 连接MQTT
>>> cases\账号管理\
-- 第 2 步 -- MQTT发送消息
[ suite setup ] cases\账号管理\
输入用户名:admin@czj
输入密码:Ubains@4321
输入验证码:csba
点击登录按钮
进入后台
进入后台
打开账号管理下拉菜单
进入用户管理模块
PASS
[ suite teardown ] cases\
清除浏览器
>>> cases\账号管理\用户管理.py
* 用户新增_001 - 2024-11-02 22:47:13
========= 测试结束 : 20241102_163013 =========
耗时 : 30.483 秒
预备执行用例数量 : 1
实际执行用例数量 : 1
通过 : 1
失败 : 0
异常 : 0
[ case execution steps ]
套件初始化失败 : 0
-- 第 1 步 -- 点击【新增】按钮
套件清除 失败 : 0
用例初始化失败 : 0
-- 第 2 步 -- 输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com
用例清除 失败 : 0
......@@ -14,6 +14,8 @@
== cases\设备管理\安卓信息上报.py
** no cases in this file, skip it.
== cases\设备管理\毫米波雷达上报.py
......@@ -25,8 +27,6 @@
== cases\账号管理\用户管理.py
** no cases in this file, skip it.
=== [ 执行测试用例 ] ===
......@@ -34,7 +34,7 @@
========= 测试开始 : 20241102_162659 =========
========= 测试开始 : 20241102_224007 =========
......@@ -46,43 +46,27 @@
'----------' SSL证书警告处理完成 '----------'
>>> cases\设备管理\安卓信息上报.py
* 设备上报_0001 - 2024-11-02 16:27:04
[ case execution steps ]
-- 第 1 步 -- 连接MQTT
>>> cases\账号管理\
-- 第 2 步 -- MQTT发送消息
[ suite setup ] cases\账号管理\
输入用户名:admin@czj
输入密码:Ubains@4321
输入验证码:csba
点击登录按钮
进入后台
进入后台
打开账号管理下拉菜单
进入用户管理模块
PASS
[ suite teardown ] cases\
清除浏览器
>>> cases\账号管理\用户管理.py
* 用户新增_001 - 2024-11-02 22:40:16
========= 测试结束 : 20241102_162728 =========
耗时 : 28.932 秒
预备执行用例数量 : 1
实际执行用例数量 : 1
通过 : 1
失败 : 0
异常 : 0
[ case execution steps ]
套件初始化失败 : 0
-- 第 1 步 -- 点击【新增】按钮
套件清除 失败 : 0
用例初始化失败 : 0
-- 第 2 步 -- 输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com
用例清除 失败 : 0
......@@ -14,6 +14,8 @@
== cases\设备管理\安卓信息上报.py
** no cases in this file, skip it.
== cases\设备管理\毫米波雷达上报.py
......@@ -25,8 +27,6 @@
== cases\账号管理\用户管理.py
** no cases in this file, skip it.
=== [ 执行测试用例 ] ===
......@@ -34,7 +34,7 @@
========= 测试开始 : 20241102_162516 =========
========= 测试开始 : 20241102_223903 =========
......@@ -46,43 +46,27 @@
'----------' SSL证书警告处理完成 '----------'
>>> cases\设备管理\安卓信息上报.py
* 设备上报_0001 - 2024-11-02 16:25:23
[ case execution steps ]
-- 第 1 步 -- 连接MQTT
>>> cases\账号管理\
-- 第 2 步 -- MQTT发送消息
[ suite setup ] cases\账号管理\
输入用户名:admin@czj
输入密码:Ubains@4321
输入验证码:csba
点击登录按钮
进入后台
进入后台
打开账号管理下拉菜单
进入用户管理模块
PASS
[ suite teardown ] cases\
清除浏览器
>>> cases\账号管理\用户管理.py
* 用户新增_001 - 2024-11-02 22:39:11
========= 测试结束 : 20241102_162547 =========
耗时 : 30.667 秒
预备执行用例数量 : 1
实际执行用例数量 : 1
通过 : 1
失败 : 0
异常 : 0
[ case execution steps ]
套件初始化失败 : 0
-- 第 1 步 -- 点击【新增】按钮
套件清除 失败 : 0
用例初始化失败 : 0
-- 第 2 步 -- 输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com
用例清除 失败 : 0
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论