X2Case
X2Case ,
Xmind文件转jiraCSV 文件。 支持新版 xmind zen。
一、安装 Install
pip3 install x2case
二、使用方式 Usage
1. to jira csv
import json
import logging
from x2case.func import XmindZenParser
from x2case.jira import xmind_to_jira_csv_file
logging.basicConfig(level=logging.INFO)
xmind_file = 'docs/jira_demo.xmind'
print('Start to convert XMind file: %s' % xmind_file)
# 1、testcases import file
# (1) jira
csv_file = xmind_to_jira_csv_file(xmind_file)
print(f'Convert XMind file to zentao csv file successfully: {xmind_file}')
2. to testcases json file
parser = XmindZenParser(xmind_file)
# (1) testsuite
testsuite_json_file = parser.xmind_2_suite_json_file()
print('Convert XMind file to testsuite json file successfully: %s' % testsuite_json_file)
# (2) testcase
testcase_json_file = parser.xmind_2_case_json_file()
print('Convert XMind file to testcase json file successfully: %s' % testcase_json_file)
3、test dict/json data
# (1) testsuite
test_suite = parser.get_xmind_testsuite_list()
print('Convert XMind to test suits dict data:\n%s' %
json.dumps(test_suite, indent=2, separators=(',', ': '), ensure_ascii=False))
# (2) testcase
testcases = parser.get_xmind_testcase_list()
print('Convert Xmind to testcases dict data:\n%s' %
json.dumps(testcases, indent=4, separators=(',', ': '), ensure_ascii=False))
print('Finished conversion, Congratulations!')
三、致谢
X2Case 工具的产生,受益于以下两个开源项目,并在此基础上扩展、优化,受益匪浅,感恩!
- 1、XMindParser:Parse xmind file to programmable data type (e.g. json, xml). Python 3.x required. Now it supports XmindZen file type as well.
- 2、Xmind2Testcase:XMind2TestCase 工具,提供了一个高效测试用例设计的解决方案!
(如果本项目对你有帮助的话,也欢迎 star )
LICENSE
MIT License
Metadata
Release files for x2case 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| x2case-1.2.3.tar.gz | 19.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| x2case-1.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.7 kB
Release files / x2case-1.2.3.tar.gz
| Download URL | x2case-1.2.3.tar.gz |
|---|---|
| Size | 19.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e880c8eca5770794c4eb8c8e4df46ed6e5cc6d1b808d4768794c7f58ac44a5d
|
|
BLAKE2b-256 checksum How to use checksums |
0f026348615f5d394d09d9e99bf10738425e320f5e490bef3edb05830f8cf2b7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / x2case-1.2.3-py3-none-any.whl
| Download URL | x2case-1.2.3-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2ddeb46e352b3a371f02066083e79778cf1fe1a260248bbd5916b93de7ef8d05
|
|
BLAKE2b-256 checksum How to use checksums |
bc442593dfd0fb4eaed2fe7baa06f4b5858697b6296bc92ae2da232d59ad52d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|