1 Star 1 Fork 4

yitliu/xmind2testcase_import2zentao

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
samples.py 2.11 KB
一键复制 编辑 原始数据 按行查看 历史
没有素质 提交于 2022-07-06 18:22 . add import2zentao
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import json
import xmind
import logging
from xmind2testcase.zentao import xmind_to_zentao_csv_file
from xmind2testcase.testlink import xmind_to_testlink_xml_file
from xmind2testcase.utils import xmind_testcase_to_json_file
from xmind2testcase.utils import xmind_testsuite_to_json_file
from xmind2testcase.utils import get_xmind_testcase_list
from xmind2testcase.utils import get_xmind_testsuite_list
logging.basicConfig(level=logging.INFO)
def main():
xmind_file = 'docs/xmind_testcase_template_v1.1.xmind'
print('Start to convert XMind file: %s' % xmind_file)
"""
# 1、testcases import file
# (1) zentao
zentao_csv_file = xmind_to_zentao_csv_file(xmind_file)
print('Convert XMind file to zentao csv file successfully: %s' % zentao_csv_file)
# (2) testlink
testlink_xml_file = xmind_to_testlink_xml_file(xmind_file)
print('Convert XMind file to testlink xml file successfully: %s' % testlink_xml_file)
# 2、 testcases json file
# (1) testsuite
testsuite_json_file = xmind_testsuite_to_json_file(xmind_file)
print('Convert XMind file to testsuite json file successfully: %s' % testsuite_json_file)
# (2) testcase
"""
testcase_json_file = xmind_testcase_to_json_file(xmind_file)
print('Convert XMind file to testcase json file successfully: %s' % testcase_json_file)
"""
# 3、test dict/json data
# (1) testsuite
testsuites = get_xmind_testsuite_list(xmind_file)
print('Convert XMind to testsuits dict data:\n%s' %
json.dumps(testsuites, indent=2, separators=(',', ': '), ensure_ascii=False))
# (2) testcase
testcases = get_xmind_testcase_list(xmind_file)
print('Convert Xmind to testcases dict data:\n%s' %
json.dumps(testcases, indent=4, separators=(',', ': '), ensure_ascii=False))
# (3) xmind file
workbook = xmind.load(xmind_file)
print('Convert XMind to Json data:\n%s' %
json.dumps(workbook.getData(), indent=2, separators=(',', ': '), ensure_ascii=False))
print('Finished conversion, Congratulations!')
"""
if __name__ == '__main__':
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yitliu/xmind2testcase_zentao.git
git@gitee.com:yitliu/xmind2testcase_zentao.git
yitliu
xmind2testcase_zentao
xmind2testcase_import2zentao
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385