Revert "Added attributes to match TestCaseTemplate (except TC_Id, since it duplicates...
[qa-tools:test-definition.git] / data / testdefinition-syntax.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  
5   This file is part of test-definition
6  
7   Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
8  
9   Contact: Riku Halonen <riku.halonen@nokia.com>
10  
11   This package is free software; you can redistribute it and/or
12   modify it under the terms of the GNU Lesser General Public License
13   version 2.1 as published by the Free Software Foundation.
14  
15   This package is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19  
20   You should have received a copy of the GNU Lesser General Public
21   License along with this library; if not, write to the Free Software
22   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23   02110-1301 USA
24  
25 -->
26
27 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
28
29 <xs:attributeGroup name="general_attributes">
30   <xs:attribute name="name" use="required">
31     <xs:simpleType>
32       <xs:restriction base="xs:anyURI"/>
33     </xs:simpleType>
34   </xs:attribute>
35   <xs:attribute name="description"/>
36
37   <xs:attribute name="requirement"/>
38
39   <xs:attribute name="timeout" default="90" type="xs:positiveInteger"/>
40
41   <xs:attribute name="type" default="unknown"/>
42
43   <xs:attribute name="level" default="unknown"/>
44
45   <xs:attribute name="manual" default="false" type="xs:boolean" />
46   <xs:attribute name="insignificant" default="false" type="xs:boolean" />
47 </xs:attributeGroup>
48
49 <xs:element name="testdefinition">
50   <xs:complexType>
51     <xs:sequence>
52       <xs:element name="description" minOccurs="0" maxOccurs="1" />
53       <xs:element ref="suite" minOccurs="1" maxOccurs="unbounded" />
54     </xs:sequence>
55     <xs:attribute name="version" use="required" type="xs:string" />
56   </xs:complexType>
57   <xs:unique name="uniqueSuiteName">
58     <xs:selector xpath=".//suite"/>
59     <xs:field xpath="@name"/>
60   </xs:unique>
61 </xs:element>
62
63 <xs:element name="suite">
64   <xs:complexType>
65     <xs:sequence>
66       <xs:element name="description" minOccurs="0" maxOccurs="1" />
67       <xs:element ref="set" minOccurs="0" maxOccurs="unbounded" />
68     </xs:sequence>
69     <xs:attributeGroup ref="general_attributes"/>
70     <xs:attribute name="domain"/>  <!-- is this needed? -->
71   </xs:complexType>
72   <xs:unique name="uniqueSetName">
73     <xs:selector xpath=".//set"/>
74     <xs:field xpath="@name"/>
75   </xs:unique>
76
77 </xs:element>
78
79 <xs:element name="set">
80   <xs:complexType>
81     <xs:sequence minOccurs="0" maxOccurs="unbounded">
82       <xs:choice>
83         <xs:element name="description" minOccurs="0" maxOccurs="1" />
84         <xs:element name="pre_steps" minOccurs="0" maxOccurs="1">
85           <xs:complexType>
86             <xs:sequence>
87               <xs:element ref="step" maxOccurs="unbounded" />
88             </xs:sequence>
89             <xs:attribute name="timeout" type="xs:positiveInteger"/>
90           </xs:complexType>
91         </xs:element>
92       <xs:element name="post_steps" minOccurs="0" maxOccurs="1">
93         <xs:complexType>
94           <xs:sequence>
95             <xs:element ref="step" maxOccurs="unbounded" />
96           </xs:sequence>
97           <xs:attribute name="timeout" type="xs:positiveInteger"/>
98         </xs:complexType>
99       </xs:element>
100       <xs:element name="case" minOccurs="0" maxOccurs="unbounded">
101         <xs:complexType>
102           <xs:sequence>
103             <xs:element name="description" minOccurs="0" maxOccurs="1" />
104             <xs:element ref="step" minOccurs="0" maxOccurs="unbounded" />
105           </xs:sequence>
106           <xs:attributeGroup ref="general_attributes"/>
107           <xs:attribute name="subfeature"/>
108         </xs:complexType>
109       </xs:element>
110       <xs:element name="environments" minOccurs="0" maxOccurs="1" />
111       <xs:element name="get" minOccurs="0" maxOccurs="1">
112         <xs:complexType>
113           <xs:sequence>
114             <xs:element name="file" minOccurs="1" maxOccurs="unbounded">
115               <xs:complexType>
116                 <xs:simpleContent>
117                   <xs:extension base="xs:string">
118                     <xs:attribute name="delete_after" type="xs:boolean" default="false" />
119                   </xs:extension>
120                 </xs:simpleContent>
121               </xs:complexType>
122             </xs:element>
123           </xs:sequence>
124         </xs:complexType>
125       </xs:element>
126       </xs:choice>
127     </xs:sequence>
128
129     <xs:attribute name="feature"/>
130     <xs:attributeGroup ref="general_attributes"/>
131   </xs:complexType>
132     <xs:unique name="uniqueCaseName">
133       <xs:selector xpath=".//case"/>
134       <xs:field xpath="@name"/>
135     </xs:unique>
136
137 </xs:element>
138
139 <xs:element name="step">
140   <xs:complexType>
141     <xs:simpleContent>
142       <xs:extension base="xs:string">
143         <xs:attribute name="expected_result" type="xs:unsignedShort" default="0" />
144         <xs:attribute name="manual" default="false" type="xs:boolean" />
145       </xs:extension>
146     </xs:simpleContent>
147   </xs:complexType>
148 </xs:element>
149
150 </xs:schema>
151
152 <!--
153     vim:ts=2:sw=2:et
154   -->