Giter VIP home page Giter VIP logo

xmind2testlink's Introduction

xmind2testlink

Test Package PyPI

With xmind2testlink, you will be able to convert xmind tests to testlink tests xml files. You should have python installed before running it. See also xmindparser.

Requirement: python 2.7 or 3.4 +

中文说明:xmind2testlink - 快速设计测试案例并导入TestLink,如果你的xmind中包含中文或者unicode,请使用Python 3.4+,谢谢。

Installation and quick start

The most easy to install xmind2testlink is using pip command:

pip install xmind2testlink -U

Now you are ready to convert an xmind to TestLink xml:

xmind2testlink /path/to/testcase.xmind
Generated: testcase.xml

# output json is also supported
xmind2testlink /path/to/testcase.xmind -json
Generated: testcase.json

To build your tools with this package, do it like this:

from xmind2testlink.xmind_parser import *
from xmind2testlink.testlink_parser import *

# do your stuff

Conversion Rules

Now xmind2testlink has been upgraded to v2, it supports 2 kinds of conversion.

v1 rules

For old users (xmind2testlink v1), your xmind looks like below structure.

xmind2testlink_v1

The output:

xmind2testlink_v1_out

Generally to say:

  1. The first sub topic => suite
  2. The sub topic of suite => test case title
  3. The sub topic of test case => test step
  4. The sub topic of test step => expected result

v2 rules

Latest update: xmind2testlink will auto detect v1 and v2 rules by checking if descendants of testcase node (3rd level nodes) still have priority maker. If yes, this file will be processed by v2 rule, else by v1 rule.

V2 xmind looks like this:

xmind2testlink_v2

The output:

xmind2testlink_v2_out

Rules:

  1. Mark root topic with a star marker, this means v2 xmind file. (no matter what color of star maker, optional)
  2. First sub topic => it is still converted to suite
  3. Test case title will be combined by sub topics, until:
    1. Child topic is marked with priority
    2. Current topic is end topic

By default, the title parts are connected by blank space, you can define the connector by last char of root topic, like this.

xmind2testlink_v2_sep

Then the output will be changed to:

xmind2testlink_v2_sep_out

Note: only valid chars can be used as a connector.

More detail

  1. Notes for a test suite => details in TestLink.
  2. Notes for a test case => summary in TestLink.
  3. Comments for a test case => preconditions in TestLink.
  4. Priority maker for a test case => importance in TestLink.
  5. flag-green maker for a test case => execution type in TestLink.
  6. Sub topics for a test case will be treated as test steps.
    • It is okay to design test step with action but without expected results.
  7. Use ! to ignore any test suite / test case / test step that you don't want to convert.
  8. Root topic will not be converted, just treat it as target suite node in TestLink.
  9. Free topic and notes will not be converted.
  10. Only the first sheet in xmind will be converted.

XmindZen Update

Now xmind2testlink support xmind zen files, remember one thing, you cannot add comments for a topic in xmind zen, so we cannot create preconditions for ZEN!

Download the sample xmind files:

Guide: Import into TestLink

Go to your TestLink website, import the xml into your target test suite step by step.

testlink_import_1

To avoid duplicates, you might want to Update date on Latest version.

testlink_import_2

Once you click on the Upload file button, all the tests will be imported as they listed in xmind.

testlink_import_3

The field mapping looks like below figure.

testlink_import_4

Advanced usage

1. Use from browser

A simple web page to host this feature also has been built in web folder. To start the website, here is the command:

# clone this git repo ahead
cd /path/to/xmind2testlink/web
pip install -r requirements.txt -U
python application.py

* Running on http://127.0.0.1:5001/ (Press CTRL+C to quit)
* Restarting with stat

Start a browser, then you will be able to convert xmind to TestLink via http://127.0.0.1:5001. I am not good at web design, but I am trying my best to provide a friendly interface :-)

xmind2testlink_web

If you wan to deploy this application to a web server, please checkout Flask Deployment.

3. Run in Docker

If you have docker installed, you just need 1 line code to run xmind2testlink.

docker run -d --name xmind2testlink --restart always -p 3000:5001 tobyqin/xmind2testlink

Now go to http://localhost:3000 you will able to use xmind2testlink in browser.

Build and run your docker engine:

cd web
docker build -t xmind2testlink:latest .
docker run -d --name xmind2testlink --restart always -p 3000:5001 tobyqin/xmind2testlink

3. Batch on Windows

It is okay to batch convert all xmind files in a folder, copy the xmind2testlink_all.bat to your folder, then you will be able to convert all files by double clicking on it.

@echo off
@echo off
echo Batch xmind to testlink...

python -m pip install xmind2testlink -U >NUL
python -c "import glob, os;[os.system('xmind2testlink ""{}""'.format(f)) for f in glob.glob('*.xmind')]"

echo OK!

xmind2testlink's People

Contributors

pyup-bot avatar tobyqin avatar winterding avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xmind2testlink's Issues

导入到testlink时如何生成目录?

testsuite 如果不是 testcase 而是还有多个目录 在解析的时候如何才能将这些目录 不按字符串连接 而是 要让最后解析出来的xml导入到testlink时 可以自动生成目录呢?

2.0.6版本,默认测试方式错误

测试方式 : Unknown execution type code: 0,我查看了xml,你这里是
<execution_type>


</execution_type>

应该是
<execution_type></execution_type>

这样
image

after installation, open the web occured error

error log
@cicaday , Thanks.

ValueError
ValueError: zero length field name in format

Traceback (most recent call last)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1994, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1985, in wsgi_app
response = self.handle_exception(e)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1540, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python2.6/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/opt/xmind2testlink/web/application.py", line 158, in index
return render_template('index.html', download_xml=download_xml, records=list(get_records()))
File "/opt/xmind2testlink/web/application.py", line 92, in get_records
sql = "select * from records where is_deleted<>1 order by id desc limit {}".format(int(limit))
ValueError: zero length field name in format
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object

How to install the web?

@cicaday

I installed it as follows

  1. git clone https://github.com/tobyqin/xmind2testlink.git /opt/xmind2testlink
  2. cd /opt/xmind2testlink
  3. python application.py

occured error

Traceback (most recent call last):
  File "application.py", line 7, in <module>
    from flask import Flask, request, redirect, url_for, send_from_directory, g
ImportError: No module named flask

How to config it? Anythig I have missed?
Thanks!!

xmind2testlink是否支持中文呢

首先非常感谢您的贡献,我在测试工具时发现不支持中文,请问如需要支持将xmind的中文文档转换为xml,我可以做些什么呢?

中文文件名的xmind转化为xml,只有后缀xml

原因:因为使用的是werkzeug.utils import secure_filename,而secure_filename:The filename returned is an ASCII only string for maximum portability.这就导致了中文名字会忽略掉,
建议:增加对中文文件名字的判断处理

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.