Xmind用例導(dǎo)入到TAPD的解決方案
概述
本方案使用的是,參考開(kāi)源項(xiàng)目XMind2TestCase的實(shí)現(xiàn)邏輯,按照TAPD導(dǎo)入的格式,把XMind2TestCase項(xiàng)目的表頭以及數(shù)據(jù)做一定修改,使生成的數(shù)據(jù)符合tapd的導(dǎo)入要求。
XMind2TestCase項(xiàng)目介紹
XMind2TestCase ,該工具基于 Python 實(shí)現(xiàn),通過(guò)制定測(cè)試用例通用模板,
然后使用 XMind 這款廣為流傳且開(kāi)源的思維導(dǎo)圖工具進(jìn)行用例設(shè)計(jì)。
其中制定測(cè)試用例通用模板是一個(gè)非常核心的步驟(具體請(qǐng)看(附件包里面doc/readme)),有了通用的測(cè)試用例模板,我們就可以在 XMind 文件上解析并提取出測(cè)試用例所需的基本信息,
然后合成常見(jiàn)測(cè)試用例管理系統(tǒng)所需的用例導(dǎo)入文件。這樣就將 XMind 設(shè)計(jì)測(cè)試用例的便利與常見(jiàn)測(cè)試用例系統(tǒng)的高效管理結(jié)合起來(lái)了!
當(dāng)前 XMind2TestCase 已實(shí)現(xiàn)從 XMind 文件到 TestLink 和 Zentao(禪道) 兩大常見(jiàn)用例管理系統(tǒng)的測(cè)試用例轉(zhuǎn)換,同時(shí)也提供 XMind 文件解析后的兩種數(shù)據(jù)接口
(TestSuites、TestCases兩種級(jí)別的JSON數(shù)據(jù)),方便快速與其他測(cè)試用例管理系統(tǒng)打通。
項(xiàng)目地址:XMind2TestCase
項(xiàng)目介紹及使用(網(wǎng)盤包里面):xmind2testcase-master\README.md(這個(gè)必看,不然不知知道怎么實(shí)現(xiàn)喔?。。。?/p>
百度網(wǎng)盤鏈接
鏈接: https://pan.baidu.com/s/1VDTyBd5_QDPc7kfgjuvWHw?pwd=e15m 提取碼: e15m
具體修改點(diǎn)
#修改表頭 def xmind_to_zentao_csv_file(xmind_file): """Convert XMind file to a zentao csv file""" xmind_file = get_absolute_path(xmind_file) #路徑處理 logging.info('Start converting XMind file(%s) to zentao file...', xmind_file) testcases = get_xmind_testcase_list(xmind_file) #解析xmind文檔,得到原始數(shù)據(jù) # print("testcases",testcases) #fileheader = ["所屬模塊","用例標(biāo)題","前置條件","步驟", "預(yù)期", "關(guān)鍵詞>用例狀態(tài)", "優(yōu)先級(jí)", "用例類型", "適用階段?"] fileheader_tapd = ["用例目錄","用例名稱","需求ID","前置條件","用例步驟","預(yù)期結(jié)果","用例類型","用例狀態(tài)","用例等級(jí)","創(chuàng)建人","測(cè)試結(jié)果","備注說(shuō)明"] zentao_testcase_rows = [fileheader_tapd] for testcase in testcases: #row = gen_a_testcase_row(testcase) row = gen_a_testcase_row_tapd(testcase) zentao_testcase_rows.append(row) zentao_file = xmind_file[:-6] + '.csv' if os.path.exists(zentao_file): #判斷括號(hào)里的文件是否存在 os.remove(zentao_file) # logging.info('The zentao csv file already exists, return it directly: %s', zentao_file) # return zentao_file with open(zentao_file, 'w', encoding='utf8') as f: writer = csv.writer(f) writer.writerows(zentao_testcase_rows) logging.info('Convert XMind file(%s) to a zentao csv file(%s) successfully!', xmind_file, zentao_file) return zentao_file #修改為tapd的數(shù)據(jù)格式、增加獲取需求ID def gen_a_testcase_row_tapd(testcase_dict): #用例標(biāo)題 case_title = testcase_dict['name'] #需求ID 產(chǎn)品名稱里的目錄獲取 requirement_id, product_catalog = gen_requirement_id(testcase_dict['product']) # 所屬模塊 case_module =product_catalog +"-" + gen_case_module(testcase_dict['suite']) #前置條件 case_precontion = testcase_dict['preconditions'] #步驟 預(yù)期結(jié)果 case_step, case_expected_result = gen_case_step_and_expected_result(testcase_dict['steps']) #用例類型 case_type = gen_case_type(testcase_dict['execution_type']) # case_type = "功能測(cè)試" #用例狀態(tài) case_status = "正常" #用例等級(jí) case_priority = gen_case_priority(testcase_dict['importance']) #創(chuàng)建人 case_created_by = "" #測(cè)試結(jié)果 case_actual_result= "" row = [case_module,case_title,requirement_id,case_precontion,case_step,case_expected_result,case_type,case_status,case_priority,case_created_by,case_actual_result] return row #修改用例類型 def get_execution_type(topics): labels = [topic.get('label', '') for topic in topics] labels = filter_empty_or_ignore_element(labels) exe_type = 1 for item in labels[::-1]: if item.lower() in ['性能測(cè)試', '性能']: exe_type = 2 break if item.lower() in ['功能測(cè)試', '功能']: exe_type = 1 break if item.lower() in ['安全測(cè)試', '安全','安全性測(cè)試']: exe_type = 3 break if item.lower() in ['其他']: exe_type = 4 break return exe_type
使用方法
1、安裝庫(kù):pip3 install xmind2testcase
2、xmind模板及說(shuō)明(格式要求里面描述很清晰了):xmind2testcase-master\docs\zentao_testcase_template.xmind
3、運(yùn)行方式:①運(yùn)行zentao.py ②使用webtool工具(可放再服務(wù)器上多人使用)
其他:
使用案例,好久之前寫的,基本能用,最終沒(méi)有在項(xiàng)目推行,這里共享給大家。
鏈接: https://pan.baidu.com/s/1VDTyBd5_QDPc7kfgjuvWHw?pwd=e15m 提取碼: e15m
特別說(shuō)明:
1、標(biāo)簽的測(cè)試方式已改成:功能測(cè)試、性能測(cè)試、安全測(cè)試、其他
2、根名稱做了適用tapd的處理,如下圖結(jié)構(gòu):【ID1016373】SIT-V2.6.3 - 2021春節(jié)活動(dòng)二-
【ID1016373】是需求ID,要需求ID則必須要帶【】,且放在前面,沒(méi)有需求ID則不寫這個(gè)【】,則結(jié)果為空
SIT-V2.6.3 - 2021春節(jié)活動(dòng)二:是在TAPD的目錄路徑
到此這篇關(guān)于Xmind用例導(dǎo)入到TAPD的方案的文章就介紹到這了,更多相關(guān)Xmind導(dǎo)入到TAPD內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
基于Token的身份驗(yàn)證之JWT基礎(chǔ)教程
JWT(json web token)是為了在網(wǎng)絡(luò)應(yīng)用環(huán)境間傳遞聲明而執(zhí)行的一種基于JSON的開(kāi)放標(biāo)準(zhǔn)。下面這篇文章主要給大家介紹了關(guān)于基于Token的身份驗(yàn)證之JWT的基礎(chǔ)相關(guān)資料,文中通過(guò)示例代碼的非常詳細(xì),需要的朋友可以參考下2018-09-09K8ssandra入門教程之Linux上部署K8ssandra到Kubernetes的過(guò)程
K8ssandra不僅幫助我們可以快速可靠地在Kubernetes上部署Cassandra,同時(shí)提供了許多組件,如監(jiān)控、備份、同步、訪問(wèn)等,這篇文章給大家介紹K8ssandra入門教程之Linux上部署K8ssandra到Kubernetes的過(guò)程,一起看看吧2021-10-10flask+layui+echarts實(shí)現(xiàn)前端動(dòng)態(tài)圖展示數(shù)據(jù)效果
這篇文章主要介紹了flask+layui+echarts實(shí)現(xiàn)前端動(dòng)態(tài)圖展示數(shù)據(jù)效果,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-09-09VSCode遠(yuǎn)程連接其他主機(jī)的WSL2的問(wèn)題
這篇文章主要介紹了VSCode遠(yuǎn)程連接其他主機(jī)的WSL2的問(wèn)題,在 Windows 10 上開(kāi)啟 SSH Server 服務(wù),設(shè)置 SSH 連接使用的默認(rèn) Shell,本文給大家介紹的非常詳細(xì),需要的朋友參考下吧2021-07-07使用Visual Studio進(jìn)行文件差異比較的問(wèn)題小結(jié)
這篇文章主要介紹了使用Visual Studio進(jìn)行文件差異比較,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2021-07-07分別使用vue和Android實(shí)現(xiàn)長(zhǎng)按券碼復(fù)制功能
最近分別用vue和Android實(shí)現(xiàn)了一個(gè)券碼復(fù)制功能,長(zhǎng)按券碼會(huì)在上方彈出一個(gè)拷貝的icon提示,點(diǎn)擊icon將券碼內(nèi)容復(fù)制到剪貼板。下面小編給大家?guī)?lái)實(shí)現(xiàn)代碼,需要的朋友參考下吧2019-10-10