User:Rhe/Nitrate Migration Script

Introduction
This page shows the usage of the migration script which is used to transfer the test case from wiki page to Nitrate tcms system.

Source Code
You can get the script named from the repo: git clone git://fedorapeople.org/~rhe/repo.git

After modification, checkin the code by: git add git commit -m ' ' git push fedorapeople

Usage
The main input parameter is the wiki page title, and the output is a  file under current ./ path which can be imported to Nitrate tcms system. The usage is as below: [root@repo]# ./wiki_to_nitrate_xml.py --help Usage: wiki_to_nitrate_xml.py [options] [options] Options: -h, --help           show this help message and exit -v, --verbose        Enable more verbose output -d, --debug          Enable debugging output --url=URL            API URL General options: -l LIMIT, --limit=LIMIT Limit recursion depth (5) Options for 'categorymembers' command:: -c CATEGORIES, --category=CATEGORIES Wiki category name to covert all its members(test                       cases) to Nitrate xml file Options for 'migration':: -t TITLE, --title=TITLE Page title to convert this test case to Nitrate xml file Options for 'pagelinks':: -p PAGE, --page=PAGE Page name to convert all its links(test cases) to                       Nitrate xml file

Transfer one test case from wiki page to a xml file
For example, run the following command:
 * 1) ./wiki_to_nitrate_xml.py migration -t QA:Testcase_Boot_Methods_Boot_Iso

Then a will be generated under its ./ path with the content:

   QA:Testcase_Boot_Methods_Boot_Iso --default-- &lt;p&gt;This tests starting the anaconda installation program using &lt;code&gt;boot.iso&lt;/code&gt; or &lt;code&gt;netinst.iso&lt;/code&gt; &lt;/p&gt;  Fedora 15 Install Test Plan  &lt;ol&gt;&lt;li&gt; Insert the optical (or USB) media into the appropriate device (optical drive or USB drive), and boot the system under test. &lt;/li&gt;&lt;/ol&gt; &lt;ol&gt;&lt;li&gt; Graphical boot menu is displayed for users to select install options. Navigating the menu and selecting entries must work. If no option is selected, the installer should load after a reasonable timeout &lt;/li&gt;&lt;li&gt; Installer boots into &lt;a href=&quot;http://fedoraproject.org/wiki/Anaconda/Stage&quot; class=quot;external text&quot;&gt;loader&lt;/a&gt; and prompts for language, keymap &lt;/li&gt;&lt;li&gt; Installer transitions to &lt;a href=&quot;http://fedoraproject.org/wiki/Anaconda/Stage&quot; class=&quot;external text&quot;&gt;anaconda&lt;/a&gt; without error &lt;/li&gt;&lt;/ol&gt; &lt;ol&gt;&lt;li&gt; Prepare your system for booting a &lt;code&gt;boot.iso&lt;/code&gt:/&lt;code&gt;netinst.iso&lt;/code&gt; image. This may involve writing the image to a USB key, or using &lt;code&gt;cdrecord&lt;/code&gt; to write to an optical disk. &lt;/li&gt;&lt;li&gt; Check your system boot order preferences to ensure that the optical CD drive (or USB drive) boot target is enabled. &lt;/li&gt;&lt;/ol&gt; Installer_Boot_Methods UEFI_Test_Cases

This file can be imported directly to Nitrate system to generate a test case.

Transfer a category which has its own test case members to a xml file
Input a test case category page name to transfer all its members, for example: QA:Testcase install repository DVD default QA:Testcase install repository DVD graphical QA:Testcase install repository DVD variation
 * 1) ./wiki_to_nitrate_xml.py -c Category:Installation_Repository_DVD categorymembers

Then, its three test cases will be transferred to nitrate xml format included in the file.

Transfer a test run page which has test cases to a xml file.
Input a page(eg. test result/test run page) which has test cases links, the output will be the file containing all the test cases. For example: The page 'QA:Base validation results template' is not a test case The page 'QA:Base validation testing' is not a test case The page 'QA:SOP blocker bug process' is not a test case
 * 1) ./wiki_to_nitrate_xml.py pagelinks -p Test_Results:Fedora_16_Alpha_RC2_Base

As a result, it judged all its links and only convert test cases to the xml file.