这几天搞了一个XMind转换案例的py脚本,可以一键将XMind测试大纲转为测试案例,有测试场景,测试步骤,预期结果。节省了很多时间。今天分享给大家,用得着的人可以节约很多很多时间。

上图d0fcae43aa6d4a6a9c944df8d981dbff.jpg

 

 需要的小伙伴可以试试

部分代码

    # 写入场景
    row = 1
    for path in scenarios:
        sheet.write(row, 0, path, style)
        row += 1

    # 写入步骤
    row = 1
    for path in steps:
        path_parts = path.split('-')
        modified_path = "\n".join(path_parts[:-1])  # 将 '-' 替换为换行符
        sheet.write(row, 1, modified_path, style)
        row += 1

    # 写入预期结果
    row = 1
    for last_node in last_nodes:
        sheet.write(row, 2, last_node["title"], style)
        row += 1

    workbook.save(excel_path)

def choose_xmind_file():
    file_path = filedialog.askopenfilename(filetypes=[("XMind Files", "*.xmind")])
    if file_path:
        xmind_path.set(file_path)
 

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐