工具使用说明
1、xmind文件中使用下列图标进行分类标识:
标记表示p0级别case:数字1
标记表示执行通过case:绿色√
标记表示执行失败case:红色×
标记表示执行阻塞case:橙色!
2、执行代码
3、在弹框内【上传xmind文件】按钮
4、在弹框内【开始统计】按钮
5、支持统计多个文件,多个sheet
————————————————
在以下原文链接修改了点:https://blog.csdn.net/weixin_43214644/article/details/127333745
__author__ = 'zhongxintao'
import tkinter as tk
from tkinter import filedialog, messagebox
from xmindparser import xmind_to_dict
import xmind
class ParseXmind:
def __init__(self, root):
# self.count = 0
# self.case_fail = 0
# self.case_success = 0
# self.case_block = 0
# self.case_priority = 0
self.data = []
# total汇总用
self.total_cases = 0
self.total_success = 0
self.total_fail = 0
self.total_block = 0
self.toal_case_priority = 0
# 设置弹框标题、初始位置、默认大小
root.title(u'xmind文件解析及用例统计工具')
width = 760
height = 600
xscreen = root.winfo_screenwidth()
yscreen = root.winfo_screenheight()
xmiddle = (xscreen - width) / 2
ymiddle = (yscreen - height) / 2
root.geometry('%dx%d+%d+%d' % (width, height, xmiddle, ymiddle))
# 设置2个Frame
self.frm1 = tk.Frame(root)
self.frm2 = tk.Frame(root)
# 设置弹框布局
self.frm1.grid(row=1, padx='20', pady='20')
self.frm2.grid(row=2, padx='30', pady='30')
self.but_upload = tk.Button(self.frm1, text=u'上传xmind文件', command=self.upload_files, bg='#dfdfdf')
self.but_upload.grid(row=0, column=0, pady='10')
self.text = tk.Text(self.frm1, width=55, height=10, bg='#f0f0f0')
self.text.grid(row=1, column=0)
self.but2 = tk.Button(self.frm2, text=u"开始统计", command=s