2016-05-13 4 views
0

それぞれのテストケースにあるpysystest.xmlファイルのすべてのデータセットを読みたいと思います。以下は、このようなファイルの例です。PySys。 pysystest.xmlからのデータの読み込みについて(+ 0.9.2)

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    <pysystest state="runnable" type="auto"> 
     <description> 
      <title>My testcase title</title> 
      <purpose><![CDATA[My testcase description is this]]> 
      </purpose> 
     </description> 
     <classification> 
      <groups> 
       <group>UAT</group> 
      </groups> 
     </classification> 
     <data> 
      <class module="run" name="PySysTest"></class> 
     </data> 
     <traceability> 
      <requirements> 
       <requirement></requirement> 
      </requirements> 
     </traceability> 
    </pysystest> 

は、簡単にこの読書をしたり、私は全体のXMLファイルを解析しなければならないのためのフレームワークからのAPIはありますか?

私はまた、実行時にいくつかのテストケース固有の詳細を提供するためにカスタムプロパティを追加することに興味があります...フレームワークは、そのようなファイルのプロパティー追加機能をサポートしていますか?

ご協力いただきありがとうございます。

答えて

1

pysys.pyランチャーの印刷ヘルパーを使用すると、詳細を印刷できます。

C:\pysys.py print -h 

PySys System Test Framework (version 1.1.0): Console print test helper 

Usage: pysys.py print [option]* [tests]* 
    where options include; 
     -h | --help     print this message 
     -f | --full     print full information 
     -g | --groups    print test groups defined 
     -d | --modes    print test modes defined 
     -r | --requirements   print test requirements covered 
     -m | --mode  STRING  print tests that run in user defined mode 
     -a | --type  STRING  print tests of supplied type (auto or manual, default all) 
     -t | --trace  STRING  print tests which cover requirement id 
     -i | --include STRING  print tests in included group (can be specified multiple times) 
     -e | --exclude STRING  do not print tests in excluded group (can be specified multiple times) 

    and where [tests] describes a set of tests to be printed to the console. Note that multiple test 
    sets can be specified, and where none are given all available tests will be run. If an include 
    group is given, only tests that belong to that group will be printed. If an exclude group is given, 
    tests in the group will not be run. The following syntax is used to select a test set; 

     test1 - a single testcase with id test1 
     :test2 - upto testcase with id test2 
     test1: - from testcase with id test1 onwards 
     id1:id2 - all tests between tests with ids test1 and test2 

    e.g. 
     pysys.py -i group1 -e group2 --full test1:test3 

したがって、pysys.pyの印刷-fを実行すると、完全な情報がstdoutに出力されます。また、範囲内、またはグループ内で定義されたテスト、または特定の要件をカバーするテストなども出力できます。プログラマチックに記述子を解析する場合は、pysys.xmlパッケージでXMLDescriptorParserクラスを使用できます。ファイル名を使用して作成し、そのクラスにアクセサを置いて値を取得します。

+0

ありがとうございます、もう一度、あなたの助けになりました! – ESRISM

関連する問題