Test Space XML Schema
Jump to navigation
Jump to search
Example of Minimal XML to be Uploaded
The following shows a more-or-less minimum required xml document that can be uploaded to Test Space.
Additional test_suite and test_case attributes can be added as desired.
<?xml version="1.0" encoding="UTF-8" ?> <reporter product_version="external" schema_version="1.0"> <test_suite name="MyTestSuite" start_time="0"> <test_case name="MyTest" status="passed"> </test_case> <test_case name="MyTest1" status="failed"> </test_case> </test_suite> </reporter>
Test Space XSD
The following xsd describes the schema accepted by the Test Space uploader.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="reporter"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" ref="test_suite"/> </xs:sequence> <xs:attribute name="product_version" default="external_tool" type="xs:NMTOKEN"/> <xs:attribute name="schema_version" fixed="1.0" type="xs:decimal"/> </xs:complexType> </xs:element> <xs:element name="test_suite"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="test_suite"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="test_case"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="annotation"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="custom_data"/> </xs:sequence> <xs:attribute name="description" use="optional"/> <xs:attribute name="failed" use="optional" type="xs:integer"/> <xs:attribute name="in_progress" use="optional" type="xs:integer"/> <xs:attribute name="linked" use="optional" type="xs:boolean"/> <xs:attribute name="name" use="required" type="xs:NCName"/> <xs:attribute name="not_applicable" use="optional" type="xs:integer"/> <xs:attribute name="passed" use="optional" type="xs:integer"/> <xs:attribute name="start_time" default="0" type="xs:dateTime"/> <xs:attribute name="unknown" use="optional" type="xs:integer"/> </xs:complexType> </xs:element> <xs:element name="test_case"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="annotation"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="custom_data"/> </xs:sequence> <xs:attribute name="description" use="optional"/> <xs:attribute name="duration" use="optional" type="xs:decimal"/> <xs:attribute name="explicit_duration" use="optional" type="xs:boolean"/> <xs:attribute name="metric" use="optional" type="xs:decimal"/> <xs:attribute name="metric_units" use="optional"/> <xs:attribute name="name" use="required" type="xs:NCName"/> <xs:attribute name="start_time" use="optional" type="xs:dateTime"/> <xs:attribute name="status" use="required"/> <xs:restriction base="xs:string"> <xs:enumeration value="passed"/> <xs:enumeration value="failed"/> <xs:enumeration value="in_progress"/> <xs:enumeration value="not_applicable"/> </xs:restriction> </xs:attribute> </xs:complexType> </xs:element> <xs:element name="custom_data"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="name" use="required" type="xs:NCName"/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name="annotation"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="comment"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="custom_data"/> </xs:sequence> <xs:attribute name="default_file_name" use="required" type="xs:boolean"/> <xs:attribute name="description" use="optional"/> <xs:attribute name="file" use="optional"/> <xs:attribute name="file_name" use="optional"/> <xs:attribute name="level" use="required"> <xs:restriction base="xs:string"> <xs:enumeration value="info"/> <xs:enumeration value="error"/> <xs:enumeration value="warning"/> </xs:restriction> </xs:attribute> <xs:attribute name="link_file" use="optional" type="xs:boolean"/> <xs:attribute name="mime_type" use="optional"/> <xs:attribute name="name" use="required" type="xs:NCName"/> </xs:complexType> </xs:element> <xs:element name="comment"> <xs:complexType mixed="true"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="custom_data"/> </xs:sequence> <xs:attribute name="label" use="required" type="xs:NCName"/> <xs:attribute name="priority" use="required" type="xs:NCName"/> </xs:complexType> </xs:element> </xs:schema>