User:Rhe/Nitrate Migration Script

From FedoraProject

Jump to: navigation, search



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://

After modification, checkin the code by:

git add <file>
git commit -m '<comment>'
git push fedorapeople


author name
In the script, the author name of each test case is '', change it to your own need in the real case.

The main input parameter is the wiki page title, and the output is a output.xml file under current ./ path which can be imported to Nitrate tcms system. The usage is as below:

[root@repo]# ./ --help
Usage: [options] <action> [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::
                       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

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:

#./ migration -t QA:Testcase_Boot_Methods_Boot_Iso

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

<?xml version="1.0" ?>
<testopia version="1.1">
        <testcase author="" automated="" priority="P1" status="PROPOSED">
                        <p>This tests starting the anaconda installation program using <code>boot.iso</code> or <code>netinst.iso</code> </p>
                <testplan_reference type="xml_description">
                        Fedora 15 Install Test Plan
                        <ol><li> Insert the optical (or USB) media into the appropriate device (optical drive or USB drive), and boot the system under test. </li></ol>
                        <ol><li> 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 </li><li> Installer boots into <a href="; class=quot;external text">loader</a> and prompts for language, keymap </li><li> Installer transitions to <a href="; class="external text">anaconda</a> without error </li></ol>
                        <ol><li> Prepare your system for booting a <code>boot.iso</code&gt:/<code>netinst.iso</code> image. This may involve writing the image to a USB key, or using <code>cdrecord</code> to write to an optical disk. </li><li> Check your system boot order preferences to ensure that the optical CD drive (or USB drive) boot target is enabled. </li></ol>

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:

#./ -c Category:Installation_Repository_DVD categorymembers
QA:Testcase install repository DVD default
QA:Testcase install repository DVD graphical
QA:Testcase install repository DVD variation

Then, its three test cases will be transferred to nitrate xml format included in the output.xml 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 output.xml file containing all the test cases. For example:

#./ pagelinks -p Test_Results:Fedora_16_Alpha_RC2_Base 
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

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