简体   繁体   English

PySys的。 关于检索测试用例的执行信息以创建.CSV摘要文件(v 0.9.2)

[英]PySys. About retrieving testcases' execution info for creating a .CSV summary file (v 0.9.2)

I'd would like to create an output file (an .CSV file, as an example)on which store all the outcomes got from a testcase set execution, where I can specify things, besides the outcome itself, such us testcase title, description, execution date/time, testcase duration, etc... 我想创建一个输出文件(例如,.CSV文件),在该文件中存储从测试用例集执行获得的所有结果,除了结果本身,我还可以指定其他内容,例如测试用例标题,描述,执行日期/时间,测试用例持续时间等。

title, description, start datetime, duration (s), outcome
TC#1, My testcase #1, 2016/12/01 11:50:01, 64, BLOCKED 
TC#2, My testcase #2, 2016/12/01 11:52:23, 70, PASSED
TC#3, My testcase #3, 2016/12/01 11:53:45, 90, FAILED
...

Has anyone done this before? 有人做过吗?

Any feedback about it would be appreciated. 任何对此的反馈将不胜感激。

Regards 问候

You can run with the -r option to the run task, ie pysys.py run -r (to see a list of all options use pysys.py run -h). 您可以在运行任务中使用-r选项运行,即pysys.py run -r(要查看所有选项的列表,请使用pysys.py run -h)。 The -r option allows you to record the output of the tests, based on the writers defined in the pysysproject.xml file. -r选项可让您根据pysysproject.xml文件中定义的编写器记录测试的输出。 This file that comes with the example projects has the below defined; 示例项目随附的文件定义如下:

<writers>
    <writer classname="XMLResultsWriter" module="pysys.writer" file="testsummary-%Y%m%d%H%M%S.xml">
        <!--
        Set properties on the XML test output writer class. The available properties that 
        can be set are the stylesheet location, whether to use file URLs in all references 
        to resources on the local disk, and the directory to write the output file (defaults 
        to the current working directory). Note that Mozilla Firefox requires the stylesheet
        to be located next to the XML file when loading the file, and all references to local
        resources must be as file URLs. Internet Explorer and Chrome can load the stylesheet
        from any location on the local disk, but cannot load resources when referenced by a
        file URL. 

        <property name="outputDir" value="${rootdir}"/>
        <property name="stylesheet" value="./pysys-log.xsl"/>
        <property name="useFileURL" value="true"/>
        -->
    </writer>   

    <!--
    Add in the test results writer if straight text output is required 

    <writer classname="TextResultsWriter" module="pysys.writer" file="testsummary-%Y%m%d%H%M%S.log">
        <property name="outputDir" value="${rootdir}"/>
    </writer>
    -->

    <!--
    Add in the JUnit results writer if output in the Apache Ant JUnit XML format is required. Use the 
    outputDir property to define the output directory for the JUnit test summary files (the writer will 
    produce one file per test into this output directory). If not specified this defaults to the current 
    working directory.

    <writer classname="JUnitXMLResultsWriter" module="pysys.writer">
        <property name="outputDir" value="${rootdir}/target/pysys-reports"/>
    </writer>
    -->
</writers>      

So in the example above your test output would be in xml. 因此,在上面的示例中,您的测试输出将为xml。 You can have multiple writers, ie uncomment the TestResultsWriter and you will have both xml and log output summarizing the test results. 您可以有多个编写器,即取消对TestResultsWriter的注释,并且您将同时具有xml和日志输出来总结测试结果。 I don't have a CSV output writer at the moment, though you can write your own one and configure your pysysproject.xml file to point to that (also please put in a feature request if you want me to add to the core package). 我目前没有CSV输出编写器,尽管您可以编写自己的CSV输出编写器并配置pysysproject.xml文件以指向该文件(如果您希望我添加到核心软件包中,也请输入功能请求) 。 Have a look at the implementations in the pysys.writer package as examples. 以pysys.writer包中的实现为例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PySys的。 关于从pysystest.xml读取数据(在其上添加新属性)(v 0.9.2) - PySys. About reading data from pysystest.xml (+ adding new properties on it) (v 0.9.2) Pysys。 关于默认情况下修改日志级别 - Pysys. About modifying the log level by default PySys [0.9.2]。 关于运行测试用例时,其id为&#39;token1&#39;形式 <blank> token2 <blank> ......” - PySys [0.9.2]. About running testcases when their ids are of the form 'token1<blank>token2<blank>…' pysys。 由于 execute() 处发生错误而阻止执行 validate() 方法 - Pysys. Prevent execution of validate() method because of errors occured at execute() pysys。 在不同的模块上使用 Pysys 的日志 - Pysys. Using Pysys' log on different modules PySys的。 pysysproject.xml:如何构建 <path> 依赖属性值的节点 - PySys. pysysproject.xml: How to build <path> nodes relying on properties' values 将有关节点的信息写入控制器(本地)上的 CSV 文件 - Write info about nodes to a CSV file on the controller (the local) 在csv文件中打印信息 - print info in a csv file 从多个TXT文件中提取数据并在Python中创建摘要CSV文件 - Extracting Data from Multiple TXT Files and Creating a Summary CSV File in Python 为 python 计算器创建测试用例 - Creating Testcases for python Calculator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM