![](https://img.shields.io/github/license/wh1isper/km2testcase)
![](https://img.shields.io/github/v/release/wh1isper/km2testcase)
![](https://img.shields.io/pypi/dm/km2testcase)
![](https://img.shields.io/github/last-commit/wh1isper/km2testcase)
![](https://img.shields.io/pypi/pyversions/km2testcase)
# Install
`pip install km2testcase`
# Usage
`km2testcase --help`
```
Usage: km2testcase [OPTIONS] MARKDOWN_FILE_PATH
Options:
--output TEXT Output path of converted csv file.
--details BOOLEAN Print details when converting model
--help Show this message and exit.
```
## Hello world
Using [EXAMPLE.km](EXAMPLE.km)
![1678242422431](image/README/1678242422431.png)
```
$ km2testcase EXAMPLE.km --details true
Parsing km file EXAMPLE.km
Collect case: project_name='产品名称' model_name='模块1' case_name='测试用例1' priority=1 prepare='前置步骤' steps=[Step(step='步骤1', expect='期望1')]
Found subcase: 测试用例2-子用例1
Collect case: project_name='产品名称' model_name='模块1' case_name='测试用例2-子用例1' priority=2 prepare='前置步骤\n-----------------------------\n子用例前置条件1' steps=[Step(step='步骤1', e
xpect='期望1'), Step(step='步骤2', expect='期望2')]
Found subcase: 测试用例2-子用例2
Collect case: project_name='产品名称' model_name='模块1' case_name='测试用例2-子用例2' priority=1 prepare='前置步骤' steps=[Step(step='步骤1', expect='期望1')]
Collect case: project_name='产品名称' model_name='模块1' case_name='测试用例3' priority=3 prepare='前置步骤' steps=[Step(step='步骤1', expect='期望1')]
Collect case: project_name='产品名称' model_name='模块1' case_name='测试用例4' priority=2 prepare=None steps=[Step(step='步骤1', expect='期望1')]
Collect case: project_name='产品名称' model_name='模块1' case_name='测试用例5' priority=2 prepare=None steps=[Step(step='步骤1', expect='期望1')]
6 testcases parsed.
Converted project_name='产品名称' model_name='模块1' case_name='测试用例1' priority=1 prepare='前置步骤' steps=[Step(step='步骤1', expect='期望1')] -> model_name='模块1' case_name='测试用例1'
priority='高' prepare='前置步骤' step='1. 步骤1' expect='1. 期望1' case_type='功能测试' stage='功能测试阶段'
Converted project_name='产品名称' model_name='模块1' case_name='测试用例2-子用例1' priority=2 prepare='前置步骤\n-----------------------------\n子用例前置条件1' steps=[Step(step='步骤1', expec
t='期望1'), Step(step='步骤2', expect='期望2')] -> model_name='模块1' case_name='测试用例2-子用例1' priority='中' prepare='前置步骤\n-----------------------------\n子用例前置条件1' step='1. 步
骤1\n2. 步骤2' expect='1. 期望1\n2. 期望2' case_type='功能测试' stage='功能测试阶段'
Converted project_name='产品名称' model_name='模块1' case_name='测试用例2-子用例2' priority=1 prepare='前置步骤' steps=[Step(step='步骤1', expect='期望1')] -> model_name='模块1' case_name='测
试用例2-子用例2' priority='高' prepare='前置步骤' step='1. 步骤1' expect='1. 期望1' case_type='功能测试' stage='功能测试阶段'
Converted project_name='产品名称' model_name='模块1' case_name='测试用例3' priority=3 prepare='前置步骤' steps=[Step(step='步骤1', expect='期望1')] -> model_name='模块1' case_name='测试用例3'
priority='低' prepare='前置步骤' step='1. 步骤1' expect='1. 期望1' case_type='功能测试' stage='功能测试阶段'
Converted project_name='产品名称' model_name='模块1' case_name='测试用例4' priority=2 prepare=None steps=[Step(step='步骤1', expect='期望1')] -> model_name='模块1' case_name='测试用例4' priori
ty='中' prepare='' step='1. 步骤1' expect='1. 期望1' case_type='功能测试' stage='功能测试阶段'
Converted project_name='产品名称' model_name='模块1' case_name='测试用例5' priority=2 prepare=None steps=[Step(step='步骤1', expect='期望1')] -> model_name='模块1' case_name='测试用例5' priori
ty='中' prepare='' step='1. 步骤1' expect='1. 期望1' case_type='功能测试' stage='功能测试阶段'
Writing testcases to EXAMPLE.csv
All testcases written
```
## Advance config
### Zentao
Given that kity minder does not provide more labels, the type and stage of the use case use environment
variables `ZENTAO_CASE_TYPE` and `ZENTAO_STAGE`
# Develop
Install pre-commit before commit
```
pip install pre-commit
pre-commit install
```
Install package locally
```
pip install -e .[test]
```
Run unit-test before PR, **ensure that new features are covered by unit tests**
```
pytest -v
```
# Practice
Using [vscode-mindmap extension](https://marketplace.visualstudio.com/items?itemName=Souche.vscode-mindmap) on vscode
or Using [DesktopNaotu](https://github.com/NaoTu/DesktopNaotu) locally
or Using Web: https://naotu.baidu.com/
# Why Kity Minder(Why not XMind)
- XMind is commercial software, [Kity Minder](https://github.com/fex-team/kityminder) is open-resource
- XMind's performance is poor when there are many cases
- Difficulty in versioning binary files using XMind
# Thanks
Inspired by:
- [xmind2testcase](https://github.com/zhuifengshen/xmind2testcase)
Based on:
- [Kity Minder](https://github.com/fex-team/kityminder)
Raw data
{
"_id": null,
"home_page": "",
"name": "km2testcase",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "km2testcase,testcase,zentao",
"author": "",
"author_email": "Wh1isper <9573586@qq.com>",
"download_url": "https://files.pythonhosted.org/packages/57/85/3e97214d6341d1507ebf967cde15c98c71912b10437c0b32f35542327ebf/km2testcase-0.1.5.tar.gz",
"platform": null,
"description": "![](https://img.shields.io/github/license/wh1isper/km2testcase)\n![](https://img.shields.io/github/v/release/wh1isper/km2testcase)\n![](https://img.shields.io/pypi/dm/km2testcase)\n![](https://img.shields.io/github/last-commit/wh1isper/km2testcase)\n![](https://img.shields.io/pypi/pyversions/km2testcase)\n\n# Install\n\n`pip install km2testcase`\n\n# Usage\n\n`km2testcase --help`\n\n```\nUsage: km2testcase [OPTIONS] MARKDOWN_FILE_PATH\n\nOptions:\n --output TEXT Output path of converted csv file.\n --details BOOLEAN Print details when converting model\n --help Show this message and exit.\n```\n\n## Hello world\n\nUsing [EXAMPLE.km](EXAMPLE.km)\n\n![1678242422431](image/README/1678242422431.png)\n\n```\n$ km2testcase EXAMPLE.km --details true\n\nParsing km file EXAMPLE.km\nCollect case: project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b1' priority=1 prepare='\u524d\u7f6e\u6b65\u9aa4' steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')]\nFound subcase: \u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b1\nCollect case: project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b1' priority=2 prepare='\u524d\u7f6e\u6b65\u9aa4\\n-----------------------------\\n\u5b50\u7528\u4f8b\u524d\u7f6e\u6761\u4ef61' steps=[Step(step='\u6b65\u9aa41', e\nxpect='\u671f\u671b1'), Step(step='\u6b65\u9aa42', expect='\u671f\u671b2')]\nFound subcase: \u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b2\nCollect case: project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b2' priority=1 prepare='\u524d\u7f6e\u6b65\u9aa4' steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')]\nCollect case: project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b3' priority=3 prepare='\u524d\u7f6e\u6b65\u9aa4' steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')]\nCollect case: project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b4' priority=2 prepare=None steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')]\nCollect case: project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b5' priority=2 prepare=None steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')]\n6 testcases parsed.\nConverted project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b1' priority=1 prepare='\u524d\u7f6e\u6b65\u9aa4' steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')] -> model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b1'\npriority='\u9ad8' prepare='\u524d\u7f6e\u6b65\u9aa4' step='1. \u6b65\u9aa41' expect='1. \u671f\u671b1' case_type='\u529f\u80fd\u6d4b\u8bd5' stage='\u529f\u80fd\u6d4b\u8bd5\u9636\u6bb5'\nConverted project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b1' priority=2 prepare='\u524d\u7f6e\u6b65\u9aa4\\n-----------------------------\\n\u5b50\u7528\u4f8b\u524d\u7f6e\u6761\u4ef61' steps=[Step(step='\u6b65\u9aa41', expec\nt='\u671f\u671b1'), Step(step='\u6b65\u9aa42', expect='\u671f\u671b2')] -> model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b1' priority='\u4e2d' prepare='\u524d\u7f6e\u6b65\u9aa4\\n-----------------------------\\n\u5b50\u7528\u4f8b\u524d\u7f6e\u6761\u4ef61' step='1. \u6b65\n\u9aa41\\n2. \u6b65\u9aa42' expect='1. \u671f\u671b1\\n2. \u671f\u671b2' case_type='\u529f\u80fd\u6d4b\u8bd5' stage='\u529f\u80fd\u6d4b\u8bd5\u9636\u6bb5'\nConverted project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b2' priority=1 prepare='\u524d\u7f6e\u6b65\u9aa4' steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')] -> model_name='\u6a21\u57571' case_name='\u6d4b\n\u8bd5\u7528\u4f8b2-\u5b50\u7528\u4f8b2' priority='\u9ad8' prepare='\u524d\u7f6e\u6b65\u9aa4' step='1. \u6b65\u9aa41' expect='1. \u671f\u671b1' case_type='\u529f\u80fd\u6d4b\u8bd5' stage='\u529f\u80fd\u6d4b\u8bd5\u9636\u6bb5'\nConverted project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b3' priority=3 prepare='\u524d\u7f6e\u6b65\u9aa4' steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')] -> model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b3'\npriority='\u4f4e' prepare='\u524d\u7f6e\u6b65\u9aa4' step='1. \u6b65\u9aa41' expect='1. \u671f\u671b1' case_type='\u529f\u80fd\u6d4b\u8bd5' stage='\u529f\u80fd\u6d4b\u8bd5\u9636\u6bb5'\nConverted project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b4' priority=2 prepare=None steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')] -> model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b4' priori\nty='\u4e2d' prepare='' step='1. \u6b65\u9aa41' expect='1. \u671f\u671b1' case_type='\u529f\u80fd\u6d4b\u8bd5' stage='\u529f\u80fd\u6d4b\u8bd5\u9636\u6bb5'\nConverted project_name='\u4ea7\u54c1\u540d\u79f0' model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b5' priority=2 prepare=None steps=[Step(step='\u6b65\u9aa41', expect='\u671f\u671b1')] -> model_name='\u6a21\u57571' case_name='\u6d4b\u8bd5\u7528\u4f8b5' priori\nty='\u4e2d' prepare='' step='1. \u6b65\u9aa41' expect='1. \u671f\u671b1' case_type='\u529f\u80fd\u6d4b\u8bd5' stage='\u529f\u80fd\u6d4b\u8bd5\u9636\u6bb5'\nWriting testcases to EXAMPLE.csv\nAll testcases written\n```\n\n## Advance config\n\n### Zentao\n\nGiven that kity minder does not provide more labels, the type and stage of the use case use environment\nvariables `ZENTAO_CASE_TYPE` and `ZENTAO_STAGE`\n\n# Develop\n\nInstall pre-commit before commit\n\n```\npip install pre-commit\npre-commit install\n```\n\nInstall package locally\n\n```\npip install -e .[test]\n```\n\nRun unit-test before PR, **ensure that new features are covered by unit tests**\n\n```\npytest -v\n```\n\n# Practice\n\nUsing [vscode-mindmap extension](https://marketplace.visualstudio.com/items?itemName=Souche.vscode-mindmap) on vscode\n\nor Using [DesktopNaotu](https://github.com/NaoTu/DesktopNaotu) locally\n\nor Using Web: https://naotu.baidu.com/\n\n# Why Kity Minder(Why not XMind)\n\n- XMind is commercial software, [Kity Minder](https://github.com/fex-team/kityminder) is open-resource\n- XMind's performance is poor when there are many cases\n- Difficulty in versioning binary files using XMind\n\n# Thanks\n\nInspired by:\n\n- [xmind2testcase](https://github.com/zhuifengshen/xmind2testcase)\n\nBased on:\n\n- [Kity Minder](https://github.com/fex-team/kityminder)\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "km to testcase!",
"version": "0.1.5",
"project_urls": {
"Source": "https://github.com/wh1isper/km2testcase"
},
"split_keywords": [
"km2testcase",
"testcase",
"zentao"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6579ace5be9a84a7332effd1dc1b948ac16bde3f6b5a4a14cd0aa216b7e2f5aa",
"md5": "313866446d4bb5a704efe0ecf19659f9",
"sha256": "09a88e12ad09cd0deb681a36c892803f5128ddf107ccb2ff203504d189deca3e"
},
"downloads": -1,
"filename": "km2testcase-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "313866446d4bb5a704efe0ecf19659f9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8075,
"upload_time": "2023-10-24T01:42:11",
"upload_time_iso_8601": "2023-10-24T01:42:11.601527Z",
"url": "https://files.pythonhosted.org/packages/65/79/ace5be9a84a7332effd1dc1b948ac16bde3f6b5a4a14cd0aa216b7e2f5aa/km2testcase-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "57853e97214d6341d1507ebf967cde15c98c71912b10437c0b32f35542327ebf",
"md5": "489e80b81181fdbad70a65c60eaf9e1f",
"sha256": "461b5d9970df952c208ec5b4d69b5b622368450ab22e8d4cf4f775f563660aae"
},
"downloads": -1,
"filename": "km2testcase-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "489e80b81181fdbad70a65c60eaf9e1f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 94782,
"upload_time": "2023-10-24T01:42:12",
"upload_time_iso_8601": "2023-10-24T01:42:12.925495Z",
"url": "https://files.pythonhosted.org/packages/57/85/3e97214d6341d1507ebf967cde15c98c71912b10437c0b32f35542327ebf/km2testcase-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-24 01:42:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wh1isper",
"github_project": "km2testcase",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "km2testcase"
}