Half Automate Generate Test Script Model

本文介绍了半自动化生成测试脚本模型,可使用Python工具根据TestRail描述转换测试脚本。该模型有诸多好处,如无需手动创建文件、自动处理平台信息和测试步骤等。还给出了实现步骤,最后提到未来可结合机器学习,有望实现更高自动化,且该模型对测试团队有价值。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 Half Automate Generate Test Script Model

What I think is that we can write a tool to convert the test script according to the description above testrail. using python tools automatic write python test cases

The benefits are as follows:

1: You do not need to manually create two files c0000_uefi_test.xml and c0000_uefi_test.py

2: Automatically put the platform information in testrail directly in case.xml, and then set some other parameters by default.

3: Automatically decompose the test steps in testrail directly into the case.py file. The steps are clear and clear. Leave two lines for each step and one line for one line. These codes are generated by the tool.

4: If the amount of the case is large, the development time will be saved.

5: The more perfect testrail is, the higher the degree of automation ,If the testrail is perfect enough, it can be written manually without any need.

Implementation

for example case C167

The following data is what I got from the testrail

{u’type_id’: 6, u’refs’: None, u’priority_id’: 4, u’custom_ffvpqaid’: u’MS-2351’, u’created_on’: 1432048007, u’custom_ffvplatform’: [1, 2, 3, 4, 5, 10, 12, 13, 14, 15, 16, 17, 18], u’milestone_id’: 22, u’title’: u’Firmware downgrade to last released firmware set’, u’custom_ffv_automatable’: None, u’created_by’: 36, u’id’: 167, u’custom_fw_srs’: None, u’custom_ffv_need_physical_access’: 2, u’custom_ffvsystype’: [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], u’custom_ffv_cpu_specific’: [2], u’updated_by’: 388, u’custom_steps_separated’: [{u’content’: u’Enter POST diagnostic menu.\n 1.Press Crtl+C when booting POST to enter POST Login interface.\n 2. Press GO_sox to login.’, u’expected’: u’System should enter POST root menu without any Warning message and Error message.’}, {u’content’: u’Active POST TFTP sevice\n 1. Select “Image Sub-Menu” --> “TFTP Download”’, u’expected’: u’Tip message "TFTP ready to receive image " apeared.’}, {u’content’: u’Upload bin file by POST TFTP Function.\n 1. Run “CMD> TFTP -i IPaddress put bin file” in Dos.’, u’expected’: u’BIOS, POST, BMC and all devices Firmwares be uploaded without any unexpected problem.\n 1. Bin files should be uploaded without any unexpected problem.\n 2.The upload bin files should be older than all system original devices Firmwares.’}, {u’content’: u’Downgrade all firmwares by POST\n 1). Select “Image Sub-Menu” -->“Set Firmware Match Rev.” to force system will update to target version.\n 2). Reset SP and boot to POST.\n 3). Repeat step 2-3.\n 4). Select “System Test Sub-Menu” --> “Autoflash” to start updating firmware. Input “y” when original firmware version is same as the upload firmware version.’, u’expected’: u’Downgrade process should complete without any problem.’}, {u’content’: u’Reboot system and guarantee all updated firmware take effect.\n 1.Select “Reset Controller” to reboot system.\n 2. Press Crtl+C when booting POST to enter POST Login interface.\n 2. Press GO_sox to login.’, u’expected’: u’need to check if two reset happened during force flash FW:\nthe first time is the warm reset, after that it will start flashing BIOS…\nonce done the SP will reset again.’}, {u’content’: u’Check all updated firmware be updated successful.\n 1. Select “Information display” --> “Firmware Inventory” to check the Firmware version\n 2. Select “Resume” --> “Display Resume” to check the Firmware version\n 3. Select “System Test Sub-Menu” --> “Firmware Revision Validate” to check the firmware version.’, u’expected’: u’Verify all firmware elements(BIOS, POST, BMC, SSP, CMD, PLX, BCM, etc) are upgraded to latest revision successfully. Any workaround or warning/fault must be noted.’}, {u’content’: u’Flash all firmware to original version to restore.’, u’expected’: u’’}, {u’content’: u’Repeat step 1-7 to ensure the firmware downgrade under all POR system type can work as expected.’, u’expected’: u’’}], u’custom_ffv_overview’: None, u’section_id’: 3422, u’custom_preconds’: u’Should be able to downgrade firmware set to last released firmware set.\r\nBefore downgrading, make sure there is no known blocking issue on the previous released firmware set to avoid bricking hardware.\r\n\r\n\r\nTest Methodology:\r\n Downgrade to last released firmware set using “Firmware match Rev” and “Autoflash”;\r\n Autoflash from last released firmware set to target firmware set.\r\n Make sure all flashing are done without any error/warning/rev mismatch.’, u’suite_id’: 9, u’estimate_forecast’: u’2h 18m 42s’, u’estimate’: None, u’custom_ffvorigin’: u’TU-8’, u’custom_ffv_target_test_plan’: [3, 4, 7, 8, 9, 10, 14, 15, 16, 17, 18, 19, 21, 22, 25, 27, 32], u’updated_on’: 1558689347, u’template_id’: 1}

we can see it’s a dictionary, so work is easy now.

step1: get data from testrail

step2: check it is uefi or bmc , and get case title , creat file C167_uefi_Firmwaredowngradetolastreleasedfirmwareset.xml C167_uefi_Firmwaredowngradetolastreleasedfirmwareset.py

step3: put default message in C167_uefi_Firmwaredowngradetolastreleasedfirmwareset.xml, get platform message and replace platform in C167_uefi_Firmwaredowngradetolastreleasedfirmwareset.xml

step4: Define the following in the test script:

1: Required import such as:

from case.CBaseCase import CBaseCase

from pub.Const import FAIL, PASS, INFO, BLOCK, DONE, ERROR

2: common interface

class C167_uefi_DowngradeFirmwarelastRelease(CBaseCase):

def __init__(self):
    super(C167_uefi_DowngradeFirmwarelastRelease, self).__init__(self.__class__.__name__)
 
def config(self)
    PASS
 
def test(self)
    pass
 
def deconfig(self)
    pass

3: step messages

we can also get step messages from testrail, Disassemble each step, then leave three lines in the middle of each step, one line is executed as code, one line is checked, one line is blank.

in test function , we will collect some common functions or Modular codes in a library , like this “”“enter post “”” go_to_post() , fuzzy matching Highest score wins, if some steps similar with common function’s description, call it under steps, if can not find , do not call , and check next step , every step there will be a log trackback. the log is useful for automate analysis

def test(self):

# step1: Enter POST diagnostic menu
self.log(INFO, 'Enter POST diagnostic menu')
ret = sp.go_to_post()
    if ret:
        self.result(FAIL, step 1 messages)
 
# step2 :xxxxxxxxxxxxxx
self.log(INFO, 'xxxxxxxxxxxxxx')
ret = xxxxxxxxx
    if ret:
        xxxxxxxxxx

4: autopep8 formats Python code

5: step 1-4 above all automate tools do what he can , next people join it , and do some check and modify and tests

Supplementary explanation:

future maybe could done , it from step 4 , automate run this case if which step is failed, rewrite it from step by select second scores, record failed and pass history for next case’s development. search similar cases (from title and steps), config deconfig do the same

If there is such coding logic in the future machine learning, I am afraid that the last step does not require human beings. It is a bit scary to think about it, but it will come.

Expand thinking

I think this model is useful for every test teams. we can provide a public solution for test teams. Maybe we can still write a patent. if step 3, we add machine learning to do that , it will be better

 

 

基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型,个人经导师指导并认可通过的高分设计项目,评审分99分,代码完整确保可以运行,小白也可以亲自搞定,主要针对计算机相关专业的正在做大作业的学生和需要项目实战练习的学习者,可作为毕业设计、课程设计、期末大作业,代码资料完整,下载可用。 基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现
内容概要:本文深入介绍了HarmonyOS文件系统及其在万物互联时代的重要性。HarmonyOS自2019年发布以来,逐步覆盖多种智能设备,构建了庞大的鸿蒙生态。文件系统作为其中的“数字管家”,不仅管理存储资源,还实现多设备间的数据协同。文章详细介绍了常见的文件系统类型,如FAT、NTFS、UFS、EXT3和ReiserFS,各自特点和适用场景。特别强调了HarmonyOS的分布式文件系统(hmdfs),它通过分布式软总线技术,打破了设备界限,实现了跨设备文件的无缝访问。此外,文章对比了HarmonyOS与Android、iOS文件系统的差异,突出了其在架构、跨设备能力和安全性方面的优势。最后,从开发者视角讲解了开发工具、关键API及注意事项,并展望了未来的技术发展趋势和对鸿蒙生态的影响。 适合人群:对操作系统底层技术感兴趣的开发者和技术爱好者,尤其是关注物联网和多设备协同的用户。 使用场景及目标:①理解HarmonyOS文件系统的工作原理及其在多设备协同中的作用;②掌握不同文件系统的特性和应用场景;③学习如何利用HarmonyOS文件系统进行应用开发,提升跨设备协同和数据安全。 阅读建议:本文内容详实,涵盖了从基础概念到高级开发技巧的多个层次,建议读者结合自身需求,重点关注感兴趣的部分,并通过实践加深理解。特别是开发者可参考提供的API示例和开发技巧,尝试构建基于HarmonyOS的应用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值