摘要:        
参考链接:https://www.byhy.net/auto/pyatframework/hytest-01/#jenkins pipeline { agent any stages { stage('Build') { steps { echo 'build release' } } stage(    阅读全文
        
            posted @ 2025-02-02 15:15
lzp123456
阅读(8)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
日志报告中加入了时间戳 增加了报告中加入图片的功能 可以使用hytest库中的SELENIUM_LOG_SCREEN函数进行截屏操作,第一个参数是driver对象,第二个参数可以指定宽的百分比 如果想在报告中直接插入已经产生的图片可以使用函数LOG_IMG,参数传入url,可以是网络url,也可以是    阅读全文
        
            posted @ 2025-02-02 15:12
lzp123456
阅读(9)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
点击扩展,搜索hytest安装,安装完成后右下角点击hytest启用插件助手 左侧目录支持: add case file add suite __str__ debug this suite run this suite Python文件中右键支持: add one case add suite_s    阅读全文
        
            posted @ 2025-02-02 14:43
lzp123456
阅读(7)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
在pycharm的Terminal输入hytest,其实是输入了python -m hytest.run,意思就是执行了hytest包里面的run.py文件 然后再点击debug按钮的时候就可以进行调试了,相当于执行了cd H:\my\autotest后 python.exe -m hytest.r    阅读全文
        
            posted @ 2025-02-02 12:33
lzp123456
阅读(16)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
根据用例名称挑选执行 hytest --test testA # 执行名为 testA 的用例 hytest --test testA --test testB # 执行名为 testA 和 testB 的用例 hytest --test test* # 执行名字以 test 开头的用例 hytes    阅读全文
        
            posted @ 2025-02-02 12:00
lzp123456
阅读(9)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
动态产生数据 1 from hytest import * 2 3 4 class UI_000x: 5 ddt_cases = [] 6 for i in range(10): 7 ddt_cases.append({ 8 'name': f'登录 UI_000{i + 1}', 9 'para'    阅读全文
        
            posted @ 2025-02-02 11:11
lzp123456
阅读(10)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
__str__.py 1 from lib.webui import * 2 3 4 def suite_setup(): 5 open_browser() 6 7 8 def suite_teardown(): 9 wd = GSTORE['wd'] 10 wd.quit() para为字典的管理    阅读全文
        
            posted @ 2025-02-02 10:48
lzp123456
阅读(5)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
__str__.py: 1 from lib.webui import * 2 3 4 def suite_setup(): 5 open_browser() 6 7 8 def suite_teardown(): 9 wd = GSTORE['wd'] 10 wd.quit() 管理员登录.py:    阅读全文
        
            posted @ 2025-02-02 10:38
lzp123456
阅读(6)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
初始化__str__.py 1 from lib.webui import * 2 3 4 def suite_setup(): 5 open_browser() 6 7 8 def suite_teardown(): 9 wd = GSTORE['wd'] 10 wd.quit() 管理员登录.p    阅读全文
        
            posted @ 2025-02-02 10:36
lzp123456
阅读(7)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
用例文件(也就是Python文件)除了支持suite_setup、suite_teardown 对整个套件进行初始化清除,还支持缺省初始化、清除 定义test_setup、test_teardown全局函数 如果文件中的某个用例本身没有初始化方法,执行自动化就会调用test_setup来初始化 如果    阅读全文
        
            posted @ 2025-02-02 09:35
lzp123456
阅读(6)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
如果一个用例目录下所有Python文件都需要相同的初始化、清除,就需要在该目录下创建一个__str__.py的文件 公共的代码提取到__str__.py文件中,函数名和单个Python文件初始化、清除时一致 __str__.py文件代码如下: 1 from lib.webui import * 2     阅读全文
        
            posted @ 2025-02-02 09:09
lzp123456
阅读(11)
评论(0)
推荐(0)
        
        
            
        
        
摘要:        
一个Python文件的初始化清除 1 from time import sleep 2 from lib.webui import * 3 4 5 def suite_setup(): 6 INFO('suite_setup') 7 open_browser() 8 mgr_login() 9 10    阅读全文
        
            posted @ 2025-02-02 08:54
lzp123456
阅读(12)
评论(0)
推荐(0)
        
        
 
                    
                 浙公网安备 33010602011771号
浙公网安备 33010602011771号