Xmind用例導入到TAPD的解決方案
概述
本方案使用的是,參考開源項目XMind2TestCase的實現(xiàn)邏輯,按照TAPD導入的格式,把XMind2TestCase項目的表頭以及數(shù)據(jù)做一定修改,使生成的數(shù)據(jù)符合tapd的導入要求。
XMind2TestCase項目介紹
XMind2TestCase ,該工具基于 Python 實現(xiàn),通過制定測試用例通用模板,
然后使用 XMind 這款廣為流傳且開源的思維導圖工具進行用例設計。
其中制定測試用例通用模板是一個非常核心的步驟(具體請看(附件包里面doc/readme)),有了通用的測試用例模板,我們就可以在 XMind 文件上解析并提取出測試用例所需的基本信息,
然后合成常見測試用例管理系統(tǒng)所需的用例導入文件。這樣就將 XMind 設計測試用例的便利與常見測試用例系統(tǒng)的高效管理結合起來了!
當前 XMind2TestCase 已實現(xiàn)從 XMind 文件到 TestLink 和 Zentao(禪道) 兩大常見用例管理系統(tǒng)的測試用例轉換,同時也提供 XMind 文件解析后的兩種數(shù)據(jù)接口
(TestSuites、TestCases兩種級別的JSON數(shù)據(jù)),方便快速與其他測試用例管理系統(tǒng)打通。
項目地址:XMind2TestCase
項目介紹及使用(網(wǎng)盤包里面):xmind2testcase-master\README.md(這個必看,不然不知知道怎么實現(xiàn)喔?。。。?/p>
百度網(wǎng)盤鏈接
鏈接: https://pan.baidu.com/s/1VDTyBd5_QDPc7kfgjuvWHw?pwd=e15m 提取碼: e15m
具體修改點
#修改表頭 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 = ["所屬模塊","用例標題","前置條件","步驟", "預期", "關鍵詞>用例狀態(tài)", "優(yōu)先級", "用例類型", "適用階段?"] fileheader_tapd = ["用例目錄","用例名稱","需求ID","前置條件","用例步驟","預期結果","用例類型","用例狀態(tài)","用例等級","創(chuàng)建人","測試結果","備注說明"] 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): #判斷括號里的文件是否存在 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): #用例標題 case_title = testcase_dict['name'] #需求ID 產品名稱里的目錄獲取 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'] #步驟 預期結果 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 = "功能測試" #用例狀態(tài) case_status = "正常" #用例等級 case_priority = gen_case_priority(testcase_dict['importance']) #創(chuàng)建人 case_created_by = "" #測試結果 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 ['性能測試', '性能']: exe_type = 2 break if item.lower() in ['功能測試', '功能']: exe_type = 1 break if item.lower() in ['安全測試', '安全','安全性測試']: exe_type = 3 break if item.lower() in ['其他']: exe_type = 4 break return exe_type
使用方法
1、安裝庫:pip3 install xmind2testcase
2、xmind模板及說明(格式要求里面描述很清晰了):xmind2testcase-master\docs\zentao_testcase_template.xmind
3、運行方式:①運行zentao.py ②使用webtool工具(可放再服務器上多人使用)
其他:
使用案例,好久之前寫的,基本能用,最終沒有在項目推行,這里共享給大家。
鏈接: https://pan.baidu.com/s/1VDTyBd5_QDPc7kfgjuvWHw?pwd=e15m 提取碼: e15m
特別說明:
1、標簽的測試方式已改成:功能測試、性能測試、安全測試、其他
2、根名稱做了適用tapd的處理,如下圖結構:【ID1016373】SIT-V2.6.3 - 2021春節(jié)活動二-
【ID1016373】是需求ID,要需求ID則必須要帶【】,且放在前面,沒有需求ID則不寫這個【】,則結果為空
SIT-V2.6.3 - 2021春節(jié)活動二:是在TAPD的目錄路徑
到此這篇關于Xmind用例導入到TAPD的方案的文章就介紹到這了,更多相關Xmind導入到TAPD內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
K8ssandra入門教程之Linux上部署K8ssandra到Kubernetes的過程
K8ssandra不僅幫助我們可以快速可靠地在Kubernetes上部署Cassandra,同時提供了許多組件,如監(jiān)控、備份、同步、訪問等,這篇文章給大家介紹K8ssandra入門教程之Linux上部署K8ssandra到Kubernetes的過程,一起看看吧2021-10-10flask+layui+echarts實現(xiàn)前端動態(tài)圖展示數(shù)據(jù)效果
這篇文章主要介紹了flask+layui+echarts實現(xiàn)前端動態(tài)圖展示數(shù)據(jù)效果,本文通過實例代碼給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下2019-09-09分別使用vue和Android實現(xiàn)長按券碼復制功能
最近分別用vue和Android實現(xiàn)了一個券碼復制功能,長按券碼會在上方彈出一個拷貝的icon提示,點擊icon將券碼內容復制到剪貼板。下面小編給大家?guī)韺崿F(xiàn)代碼,需要的朋友參考下吧2019-10-10