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

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

上级 a11c5347
...@@ -72,6 +72,32 @@ def admin_login(): ...@@ -72,6 +72,32 @@ def admin_login():
(By.XPATH, '//*[@id="app"]/div/div[3]/div[1]/div[2]/div/form/div[4]/input') (By.XPATH, '//*[@id="app"]/div/div[3]/div[1]/div[2]/div/form/div[4]/input')
)).click() )).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(): def browser_quit():
INFO("清除浏览器") INFO("清除浏览器")
wd = GSTORE['wd'] wd = GSTORE['wd']
......
...@@ -21,4 +21,5 @@ ...@@ -21,4 +21,5 @@
- 优化了Mqtt_Send中封装的函数,补充异常处理以及日志优化。 - 优化了Mqtt_Send中封装的函数,补充异常处理以及日志优化。
6. 2024-11-02 6. 2024-11-02
- 将原有pytest框架代码改为hytest框架使用,优化了脚本执行效率,并对应增加异常处理。 - 将原有pytest框架代码改为hytest框架使用,优化了脚本执行效率,并对应增加异常处理。
- MQTT相关模块目前调整了Mqtt_Send.py文件中封装的方法优化,增加异常处理。处理了登录成功断言失败的问题。 - MQTT相关模块目前调整了Mqtt_Send.py文件中封装的方法优化,增加异常处理。处理了登录成功断言失败的问题。
\ No newline at end of file - 补充用户管理模块的新增用户部分代码,当前存在新增界面弹窗后定位失败问题。
\ No newline at end of file
...@@ -64,47 +64,47 @@ def clear_and_send_keys(wd, locator, value): ...@@ -64,47 +64,47 @@ def clear_and_send_keys(wd, locator, value):
element.send_keys(value) element.send_keys(value)
class Login_000x: class Login_00x:
ddt_cases = [ ddt_cases = [
{ {
'name': '登录 UI_0001', 'name': '登录 UI_001',
'para': [None,'Ubains@4321','csba','请输入账号!'] 'para': [None,'Ubains@4321','csba','请输入账号!']
}, },
{ {
'name': '登录 UI_0002', 'name': '登录 UI_002',
'para': ['admin@czj',None,'csba','请输入密码!'] 'para': ['admin@czj',None,'csba','请输入密码!']
}, },
{ {
'name': '登录 UI_0003', 'name': '登录 UI_003',
'para': ['admin@czj','Ubains@4321',None,'请输入验证码!'] 'para': ['admin@czj','Ubains@4321',None,'请输入验证码!']
}, },
{ {
'name': '登录 UI_0004', 'name': '登录 UI_004',
'para': ['admin@czj112','Ubains@4321','csba','账号或密码错误'] 'para': ['admin@czj112','Ubains@4321','csba','账号或密码错误']
}, },
{ {
'name': '登录 UI_0005', 'name': '登录 UI_005',
'para': ['adM 12in@czj','Ubains@4321','csba','账号或密码错误'] 'para': ['adM 12in@czj','Ubains@4321','csba','账号或密码错误']
}, },
{ {
'name': '登录 UI_0006', 'name': '登录 UI_006',
'para': ['admin@czj', '12345', 'csba', '账号或密码错误'] 'para': ['admin@czj', '12345', 'csba', '账号或密码错误']
}, },
{ {
'name': '登录 UI_0007', 'name': '登录 UI_007',
'para': ['admin@czj', 'U bains1s@432', 'csba', '账号或密码错误'] 'para': ['admin@czj', 'U bains1s@432', 'csba', '账号或密码错误']
}, },
{ {
'name': '登录 UI_0008', 'name': '登录 UI_008',
'para': ['admin@czj', 'Ubains@4321', '123', '验证码错误'] 'para': ['admin@czj', 'Ubains@4321', '123', '验证码错误']
}, },
{ {
'name': '登录 UI_0009', 'name': '登录 UI_009',
'para': ['admin@czj', 'Ubains@4321', 'cs 12', '验证码错误'] 'para': ['admin@czj', 'Ubains@4321', 'cs 12', '验证码错误']
}, },
{ {
'name': '登录 UI_0010', 'name': '登录 UI_010',
'para': ['admin@czj', 'Ubains@4321', 'csba', '欢迎 预定标准版测试'] 'para': ['admin@czj', 'Ubains@4321', 'csba', '欢迎 预定标准版测试']
} }
] ]
...@@ -144,6 +144,7 @@ class Login_000x: ...@@ -144,6 +144,7 @@ class Login_000x:
# 等待1秒以允许页面响应 # 等待1秒以允许页面响应
sleep(2) sleep(2)
SELENIUM_LOG_SCREEN(wd)
# 根据预期的检查文本类型,获取并记录提示信息 # 根据预期的检查文本类型,获取并记录提示信息
if check_text == "欢迎 预定标准版测试": if check_text == "欢迎 预定标准版测试":
notify_text = WebDriverWait(wd, DEFAULT_WAIT_TIME).until( notify_text = WebDriverWait(wd, DEFAULT_WAIT_TIME).until(
......
...@@ -16,4 +16,5 @@ except ModuleNotFoundError as e: ...@@ -16,4 +16,5 @@ except ModuleNotFoundError as e:
from 预定系统.Base.base import * from 预定系统.Base.base import *
def suite_setup(): def suite_setup():
admin_login() admin_login()
\ No newline at end of file enter_the_backend()
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -309,15 +309,15 @@ function next_error(){ ...@@ -309,15 +309,15 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>开始时间</td> <td>开始时间</td>
<td>2024/11/02 15:29:53</td> <td>2024/11/02 20:56:07</td>
</tr> </tr>
<tr> <tr>
<td>结束时间</td> <td>结束时间</td>
<td>2024/11/02 15:30:03</td> <td>2024/11/02 20:56:19</td>
</tr> </tr>
<tr> <tr>
<td>耗时</td> <td>耗时</td>
<td>10.196</td> <td>12.187</td>
</tr> </tr>
<tr> <tr>
<td>预备执行用例数量</td> <td>预备执行用例数量</td>
...@@ -401,7 +401,7 @@ function next_error(){ ...@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label">套件初始化</span> <span class="label">套件初始化</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div> <div class="info">'----------' 正在初始化浏览器 '----------'</div>
...@@ -419,10 +419,10 @@ function next_error(){ ...@@ -419,10 +419,10 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label caselabel">用例 PASS</span> <span class="label caselabel">用例 PASS</span>
<span class="casename">登录 UI_0001</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>
<div class="folder_body"> <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"> <div class="test_steps" id="test_steps 登录 UI_0001">
<span class="label">测试步骤</span> <span class="label">测试步骤</span>
<div class="case_step"> <div class="case_step">
...@@ -433,6 +433,9 @@ function next_error(){ ...@@ -433,6 +433,9 @@ function next_error(){
<span class="tag">步骤 #2</span> <span class="tag">步骤 #2</span>
<span>点击登录按钮</span> <span>点击登录按钮</span>
</div> </div>
<div>
<img class="screenshot" src="imgs/20241102205617064337.png" width="aa">
</div>
<div class="info">Alert text: 请输入账号!</div> <div class="info">Alert text: 请输入账号!</div>
<div class="case_step"> <div class="case_step">
<span class="tag">步骤 #3</span> <span class="tag">步骤 #3</span>
...@@ -456,7 +459,7 @@ function next_error(){ ...@@ -456,7 +459,7 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label">套件清除</span> <span class="label">套件清除</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">清除浏览器</div> <div class="info">清除浏览器</div>
......
...@@ -309,15 +309,15 @@ function next_error(){ ...@@ -309,15 +309,15 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>开始时间</td> <td>开始时间</td>
<td>2024/11/02 15:31:29</td> <td>2024/11/02 22:05:59</td>
</tr> </tr>
<tr> <tr>
<td>结束时间</td> <td>结束时间</td>
<td>2024/11/02 15:31:40</td> <td>2024/11/02 22:06:10</td>
</tr> </tr>
<tr> <tr>
<td>耗时</td> <td>耗时</td>
<td>11.284</td> <td>11.108</td>
</tr> </tr>
<tr> <tr>
<td>预备执行用例数量</td> <td>预备执行用例数量</td>
...@@ -333,11 +333,11 @@ function next_error(){ ...@@ -333,11 +333,11 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>失败</td> <td>失败</td>
<td style="color:red">1</td> <td style="">0</td>
</tr> </tr>
<tr> <tr>
<td>异常</td> <td>异常</td>
<td style="">0</td> <td style="color:red">1</td>
</tr> </tr>
<tr> <tr>
<td>阻塞</td> <td>阻塞</td>
...@@ -369,15 +369,15 @@ function next_error(){ ...@@ -369,15 +369,15 @@ function next_error(){
</div> </div>
</div> </div>
<div class="barchar_item"> <div class="barchar_item">
<span>用例失败 100% : 1</span> <span>用例失败 0% : 0</span>
<div class="barchart_barbox"> <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> </div>
<div class="barchar_item"> <div class="barchar_item">
<span>用例异常 0% : 0</span> <span>用例异常 100% : 1</span>
<div class="barchart_barbox"> <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> </div>
<div class="barchar_item"> <div class="barchar_item">
...@@ -401,7 +401,7 @@ function next_error(){ ...@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label">套件初始化</span> <span class="label">套件初始化</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div> <div class="info">'----------' 正在初始化浏览器 '----------'</div>
...@@ -410,49 +410,50 @@ function next_error(){ ...@@ -410,49 +410,50 @@ function next_error(){
</div> </div>
</div> </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:06: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>
</div>
</div>
<div class="suite_file" id="suite_file cases\账号管理\用户管理.py">
<div> <div>
<span class="label">进入文件</span> <span class="label">进入文件</span>
<span>cases\登录模块\账号密码登录测试.py</span> <span>cases\账号管理\用户管理.py</span>
</div> </div>
<div class="case fail" id="case_00000001"> <div class="case abort" id="case_00000001">
<div class="folder_header"> <div class="folder_header">
<span class="label caselabel">用例 FAIL</span> <span class="label caselabel">用例 ABORT</span>
<span class="casename">登录 UI_0010</span> <span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 15:31:35</span> <span class="executetime">2024-11-02 22:06:08</span>
</div> </div>
<div class="folder_body"> <div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span> <span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 登录 UI_0010"> <div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span> <span class="label">测试步骤</span>
<div class="case_step"> <div class="case_step">
<span class="tag">步骤 #1</span> <span class="tag">步骤 #1</span>
<span>输入账号: admin@czj, 密码: Ubains@4321, 验证码: csba</span> <span>点击【新增】按钮</span>
</div> </div>
<div class="case_step"> <div class="info error-info">'WebDriver' object has no attribute 'find_element_by_xpath'
<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>
<div class="info error-info">
Traceback: 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 252, in teststeps
CHECK_POINT('弹出提示', notify_text == check_text)</div> wd.find_element_by_xpath('//*[@id=&quot;app&quot;]/div/div[2]/div[2]/div/div/div[2]/div[2]/button[2]/span').clck()
</div> AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'
<div class="case_teardown teardown case_st_lable" id="case_teardown teardown 登录 UI_0010"> </div>
<span class="label">用例清除</span>
<div class="case_step">
<span class="tag">步骤 #4</span>
<span>刷新页面</span>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -460,7 +461,7 @@ Traceback: ...@@ -460,7 +461,7 @@ Traceback:
<div class="folder_header"> <div class="folder_header">
<span class="label">套件清除</span> <span class="label">套件清除</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">清除浏览器</div> <div class="info">清除浏览器</div>
......
...@@ -309,15 +309,15 @@ function next_error(){ ...@@ -309,15 +309,15 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>开始时间</td> <td>开始时间</td>
<td>2024/11/02 16:25:16</td> <td>2024/11/02 22:08:06</td>
</tr> </tr>
<tr> <tr>
<td>结束时间</td> <td>结束时间</td>
<td>2024/11/02 16:25:47</td> <td>2024/11/02 22:08:16</td>
</tr> </tr>
<tr> <tr>
<td>耗时</td> <td>耗时</td>
<td>30.667</td> <td>9.684</td>
</tr> </tr>
<tr> <tr>
<td>预备执行用例数量</td> <td>预备执行用例数量</td>
...@@ -325,11 +325,11 @@ function next_error(){ ...@@ -325,11 +325,11 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>实际执用例行数量</td> <td>实际执用例行数量</td>
<td>1</td> <td>0</td>
</tr> </tr>
<tr> <tr>
<td>通过</td> <td>通过</td>
<td>1</td> <td>0</td>
</tr> </tr>
<tr> <tr>
<td>失败</td> <td>失败</td>
...@@ -341,11 +341,11 @@ function next_error(){ ...@@ -341,11 +341,11 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>阻塞</td> <td>阻塞</td>
<td style="">0</td> <td style="color:red">1</td>
</tr> </tr>
<tr> <tr>
<td>套件初始化失败</td> <td>套件初始化失败</td>
<td style="">0</td> <td style="color:red">1</td>
</tr> </tr>
<tr> <tr>
<td>套件清除 失败</td> <td>套件清除 失败</td>
...@@ -363,9 +363,9 @@ function next_error(){ ...@@ -363,9 +363,9 @@ function next_error(){
</table> </table>
<div class="result_barchart"> <div class="result_barchart">
<div class="barchar_item"> <div class="barchar_item">
<span>用例通过 100% : 1</span> <span>用例通过 0% : 0</span>
<div class="barchart_barbox"> <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> </div>
<div class="barchar_item"> <div class="barchar_item">
...@@ -381,9 +381,9 @@ function next_error(){ ...@@ -381,9 +381,9 @@ function next_error(){
</div> </div>
</div> </div>
<div class="barchar_item"> <div class="barchar_item">
<span>用例阻塞 0% : 0</span> <span>用例阻塞 100% : 1</span>
<div class="barchart_barbox"> <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> </div>
</div> </div>
...@@ -401,7 +401,7 @@ function next_error(){ ...@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label">套件初始化</span> <span class="label">套件初始化</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div> <div class="info">'----------' 正在初始化浏览器 '----------'</div>
...@@ -410,37 +410,36 @@ function next_error(){ ...@@ -410,37 +410,36 @@ function next_error(){
</div> </div>
</div> </div>
</div> </div>
<div class="suite_file" id="suite_file cases\设备管理\安卓信息上报.py"> <div class="suite_dir" id="suite_dir cases\账号管理\">
<div> <div>
<span class="label">进入文件</span> <span class="label">进入目录</span>
<span>cases\设备管理\安卓信息上报.py</span> <span>cases\账号管理\</span>
</div> </div>
<div class="case pass" id="case_00000001"> <div class="suite_setup setup fail" id="suite_setup setup cases\账号管理\">
<div class="folder_header"> <div class="folder_header">
<span class="label caselabel">用例 PASS</span> <span class="label">套件初始化</span>
<span class="casename">设备上报_0001</span> <span>cases\账号管理\</span>
<span class="executetime">2024-11-02 16:25:23</span> <span class="executetime">2024-11-02 22:08:13</span>
</div> </div>
<div class="folder_body"> <div class="folder_body">
<span class="case_class_path">cases\设备管理\安卓信息上报.py::Android_000x</span> <div class="info">输入用户名:admin@czj</div>
<div class="test_steps" id="test_steps 设备上报_0001"> <div class="info">输入密码:Ubains@4321</div>
<span class="label">测试步骤</span> <div class="info">输入验证码:csba</div>
<div class="case_step"> <div class="info">点击登录按钮</div>
<span class="tag">步骤 #1</span> <div class="info">进入后台</div>
<span>连接MQTT</span> <div class="info error-info">suite setup fail | 'WebDriver' object has no attribute 'find_element_by_link_text'
</div> Traceback:
<div class="case_step"> File &quot;D:\GithubData\自动化脚本-3\ubains-module-test\预定系统\cases\账号管理\__st__.py&quot;, line 21, in suite_setup
<span class="tag">步骤 #2</span> wd.find_element_by_link_text('账号管理').click()
<span>MQTT发送消息</span> AttributeError: 'WebDriver' object has no attribute 'find_element_by_link_text'
</div> </div>
</div>
</div> </div>
</div> </div>
<div class="suite_teardown teardown" id="suite_teardown teardown cases\"> <div class="suite_teardown teardown" id="suite_teardown teardown cases\">
<div class="folder_header"> <div class="folder_header">
<span class="label">套件清除</span> <span class="label">套件清除</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">清除浏览器</div> <div class="info">清除浏览器</div>
...@@ -453,7 +452,7 @@ function next_error(){ ...@@ -453,7 +452,7 @@ function next_error(){
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div> <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" 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="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="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div> <div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div> </div>
......
此差异已折叠。
...@@ -309,15 +309,15 @@ function next_error(){ ...@@ -309,15 +309,15 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>开始时间</td> <td>开始时间</td>
<td>2024/11/02 15:30:32</td> <td>2024/11/02 22:14:15</td>
</tr> </tr>
<tr> <tr>
<td>结束时间</td> <td>结束时间</td>
<td>2024/11/02 15:30:44</td> <td>2024/11/02 22:14:26</td>
</tr> </tr>
<tr> <tr>
<td>耗时</td> <td>耗时</td>
<td>12.032</td> <td>11.111</td>
</tr> </tr>
<tr> <tr>
<td>预备执行用例数量</td> <td>预备执行用例数量</td>
...@@ -329,7 +329,7 @@ function next_error(){ ...@@ -329,7 +329,7 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>通过</td> <td>通过</td>
<td>1</td> <td>0</td>
</tr> </tr>
<tr> <tr>
<td>失败</td> <td>失败</td>
...@@ -337,7 +337,7 @@ function next_error(){ ...@@ -337,7 +337,7 @@ function next_error(){
</tr> </tr>
<tr> <tr>
<td>异常</td> <td>异常</td>
<td style="">0</td> <td style="color:red">1</td>
</tr> </tr>
<tr> <tr>
<td>阻塞</td> <td>阻塞</td>
...@@ -363,9 +363,9 @@ function next_error(){ ...@@ -363,9 +363,9 @@ function next_error(){
</table> </table>
<div class="result_barchart"> <div class="result_barchart">
<div class="barchar_item"> <div class="barchar_item">
<span>用例通过 100% : 1</span> <span>用例通过 0% : 0</span>
<div class="barchart_barbox"> <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> </div>
<div class="barchar_item"> <div class="barchar_item">
...@@ -375,9 +375,9 @@ function next_error(){ ...@@ -375,9 +375,9 @@ function next_error(){
</div> </div>
</div> </div>
<div class="barchar_item"> <div class="barchar_item">
<span>用例异常 0% : 0</span> <span>用例异常 100% : 1</span>
<div class="barchart_barbox"> <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> </div>
<div class="barchar_item"> <div class="barchar_item">
...@@ -401,7 +401,7 @@ function next_error(){ ...@@ -401,7 +401,7 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label">套件初始化</span> <span class="label">套件初始化</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">'----------' 正在初始化浏览器 '----------'</div> <div class="info">'----------' 正在初始化浏览器 '----------'</div>
...@@ -410,45 +410,54 @@ function next_error(){ ...@@ -410,45 +410,54 @@ function next_error(){
</div> </div>
</div> </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:14:23</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> <div>
<span class="label">进入文件</span> <span class="label">进入文件</span>
<span>cases\登录模块\账号密码登录测试.py</span> <span>cases\账号管理\用户管理.py</span>
</div> </div>
<div class="case pass" id="case_00000001"> <div class="case abort" id="case_00000001">
<div class="folder_header"> <div class="folder_header">
<span class="label caselabel">用例 PASS</span> <span class="label caselabel">用例 ABORT</span>
<span class="casename">登录 UI_0001</span> <span class="casename">用户新增_001</span>
<span class="executetime">2024-11-02 15:30:39</span> <span class="executetime">2024-11-02 22:14:24</span>
</div> </div>
<div class="folder_body"> <div class="folder_body">
<span class="case_class_path">cases\登录模块\账号密码登录测试.py::UI_000x</span> <span class="case_class_path">cases\账号管理\用户管理.py::Add_User_00x</span>
<div class="test_steps" id="test_steps 登录 UI_0001"> <div class="test_steps" id="test_steps 用户新增_001">
<span class="label">测试步骤</span> <span class="label">测试步骤</span>
<div class="case_step"> <div class="case_step">
<span class="tag">步骤 #1</span> <span class="tag">步骤 #1</span>
<span>输入账号: None, 密码: Ubains@4321, 验证码: csba</span> <span>点击【新增】按钮</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_0001">
<span class="label">用例清除</span>
<div class="case_step">
<span class="tag">步骤 #4</span>
<span>刷新页面</span>
</div> </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> </div>
</div> </div>
...@@ -456,7 +465,7 @@ function next_error(){ ...@@ -456,7 +465,7 @@ function next_error(){
<div class="folder_header"> <div class="folder_header">
<span class="label">套件清除</span> <span class="label">套件清除</span>
<span>cases\</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>
<div class="folder_body"> <div class="folder_body">
<div class="info">清除浏览器</div> <div class="info">清除浏览器</div>
...@@ -469,7 +478,7 @@ function next_error(){ ...@@ -469,7 +478,7 @@ function next_error(){
<div class="menu-item" onclick="document.querySelector(&quot;body&quot;).scrollIntoView()">页首</div> <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" 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="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="previous_error()" title="上一个错误"></div>
<div class="menu-item" onclick="next_error()" title="下一个错误"></div> <div class="menu-item" onclick="next_error()" title="下一个错误"></div>
</div> </div>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
== cases\设备管理\安卓信息上报.py == cases\设备管理\安卓信息上报.py
** no cases in this file, skip it.
== cases\设备管理\毫米波雷达上报.py == cases\设备管理\毫米波雷达上报.py
...@@ -25,8 +27,6 @@ ...@@ -25,8 +27,6 @@
== cases\账号管理\用户管理.py == cases\账号管理\用户管理.py
** no cases in this file, skip it.
=== [ 执行测试用例 ] === === [ 执行测试用例 ] ===
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
========= 测试开始 : 20241102_162943 ========= ========= 测试开始 : 20241102_224704 =========
...@@ -46,43 +46,27 @@ ...@@ -46,43 +46,27 @@
'----------' SSL证书警告处理完成 '----------' '----------' SSL证书警告处理完成 '----------'
>>> cases\设备管理\安卓信息上报.py >>> cases\账号管理\
* 设备上报_0001 - 2024-11-02 16:29:49
[ case execution steps ]
-- 第 1 步 -- 连接MQTT
-- 第 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 ========= [ case execution steps ]
耗时 : 30.483 秒
预备执行用例数量 : 1
实际执行用例数量 : 1
通过 : 1
失败 : 0
异常 : 0
套件初始化失败 : 0 -- 第 1 步 -- 点击【新增】按钮
套件清除 失败 : 0
用例初始化失败 : 0 -- 第 2 步 -- 输入账号:None,用户名:admin,密码:Ubains@54321,确认密码: Ubains@54321,手机号:13724387311,邮箱:1064963571@qq.com
用例清除 失败 : 0
此差异已折叠。
此差异已折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论