提效工具

您所在的位置:网站首页 xmind怎么查看总数 提效工具

提效工具

#提效工具| 来源: 网络整理| 查看: 265

现状

每个公司都有一个维护测试case的系统,有自研的也有买的,比如QC, 禅道等等,QA往往习惯使用xmind等思维导图工具来编写测试用例,因为思路清晰,编写方便,那么这就有一个问题,大多公司要求所有的case都要导入到系统统一维护,然而系统对xmind的支持并不友好,或者根本不支持,就我们目前的情况来说,系统支持导入xmind文件导入,但是导入后所有的用例都是乱的,而且没有测试步骤,没有预期结果等等问题,因此针对这一痛点,便诞生了今天的小工具,虽然这个工具只能解决我的问题,但是里面有大家可以学习参考的地方,希望对你有帮助,那么我的目的就达到了

1 """ 2 ------------------------------------ 3 @Time : 2020/9/24 3:21 PM 4 @Auth : linux超 5 @File : handleXmind.py 6 @IDE : PyCharm 7 @Motto: ABC(Always Be Coding) 8 ------------------------------------ 9 """ 10 import tkinter as tk 11 from tkinter import filedialog, messagebox 12 import xmind 13 import os 14 from xmindparser import xmind_to_dict 15 16 17 class ParseXmind(object): 18 19 def __init__(self, root): 20 self.count = 0 21 self.case_fail = 0 22 self.case_success = 0 23 self.case_block = 0 24 self.case_priority = 0 25 # total汇总用 26 self.total_cases = 0 27 self.total_success = 0 28 self.total_fail = 0 29 self.total_block = 0 30 self.toal_case_priority = 0 31 # GUI 32 root.title('Xmind用例个数统计及文件解析') 33 width = 760 34 height = 600 35 xscreen = root.winfo_screenwidth() 36 yscreen = root.winfo_screenheight() 37 xmiddle = (xscreen - width) / 2 38 ymiddle = (yscreen - height) / 2 39 root.geometry('%dx%d+%d+%d' % (width, height, xmiddle, ymiddle)) # 窗口默认大小 40 41 # 3个frame 42 self.frm1 = tk.Frame(root) 43 self.frm2 = tk.Frame(root) 44 self.frm3 = tk.Frame(root) 45 # 布局 46 self.frm1.grid(row = 1, padx = '20', pady = '20') 47 self.frm2.grid(row = 2, padx = '30', pady = '30') 48 self.frm3.grid(row = 0, padx = '40', pady = '40') 49 50 self.lable = tk.Label(self.frm3, text = "Xmind文件完整路径") 51 self.lable.grid(row = 0, column = 0, pady = '5') 52 self.file_path = tk.Entry(self.frm3, bd = 2) 53 self.file_path.grid(row = 0, column = 1, pady = '5') 54 55 def get_full_file_path_text(): 56 """ 57 获取xmind文件完整路径 58 :return: 59 """ 60 full_xmind_path = self.file_path.get() # 获取文本框内容 61 # 简单对输入内容做一个校验 62 if full_xmind_path == "" or "xmind" not in full_xmind_path: 63 messagebox.showinfo(title = "warning", message = "xmind文件路径错误!") 64 try: 65 self.create_new_xmind(full_xmind_path) 66 except FileNotFoundError: 67 pass 68 else: 69 xmind_file = full_xmind_path[:-6].split("/")[-1] # xmind文件名,不带后缀 70 path_list = full_xmind_path[:-6].split("/") # xmind文件用/分割后的一个列表 71 path_list.pop(0) 72 path_list.pop(-1) 73 path_full = "/" + "/".join(path_list) # xmind文件的目录 74 new_xmind_file = "{}/{}_new.xmind".format(path_full, xmind_file) # 新的xmind文件完整路径 75 messagebox.showinfo(title = "success", message = "已生成新的xmin


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3