Skip to content

Commit 53e0414

Browse files
committed
MQE-682: Copy documentation from devdocs to XSDs
- Creation of common atributes schema to keep schema dry as possible. - dataActions now fully documented and dry.
1 parent 96df99c commit 53e0414

File tree

12 files changed

+521
-445
lines changed

12 files changed

+521
-445
lines changed

src/Magento/FunctionalTestingFramework/Test/etc/Actions/assertActions.xsd

Lines changed: 106 additions & 105 deletions
Large diffs are not rendered by default.

src/Magento/FunctionalTestingFramework/Test/etc/Actions/clickActions.xsd

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
22

3+
<xs:include schemaLocation="commonAttributes.xsd"/>
34
<xs:group name="clickTags">
45
<xs:choice>
56
<xs:element type="clickType" name="click" minOccurs="0" maxOccurs="unbounded"/>
@@ -19,9 +20,9 @@
1920
<xs:attribute type="xs:string" name="selector"/>
2021
<xs:attribute type="xs:string" name="selectorArray"/>
2122
<xs:attribute type="xs:string" name="userInput"/>
22-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
23-
<xs:attribute type="xs:string" name="before"/>
24-
<xs:attribute type="xs:string" name="after"/>
23+
<xs:attribute ref="stepKey" use="required"/>
24+
<xs:attribute ref="before"/>
25+
<xs:attribute ref="after"/>
2526
</xs:extension>
2627
</xs:simpleContent>
2728
</xs:complexType>
@@ -32,9 +33,9 @@
3233
<xs:attribute type="xs:string" name="selectorArray"/>
3334
<xs:attribute type="xs:string" name="x"/>
3435
<xs:attribute type="xs:string" name="y"/>
35-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
36-
<xs:attribute type="xs:string" name="before"/>
37-
<xs:attribute type="xs:string" name="after"/>
36+
<xs:attribute ref="stepKey" use="required"/>
37+
<xs:attribute ref="before"/>
38+
<xs:attribute ref="after"/>
3839
</xs:extension>
3940
</xs:simpleContent>
4041
</xs:complexType>
@@ -45,9 +46,9 @@
4546
<xs:attribute type="xs:string" name="selectorArray"/>
4647
<xs:attribute type="xs:string" name="x"/>
4748
<xs:attribute type="xs:string" name="y"/>
48-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
49-
<xs:attribute type="xs:string" name="before"/>
50-
<xs:attribute type="xs:string" name="after"/>
49+
<xs:attribute ref="stepKey" use="required"/>
50+
<xs:attribute ref="before"/>
51+
<xs:attribute ref="after"/>
5152
</xs:extension>
5253
</xs:simpleContent>
5354
</xs:complexType>
@@ -57,19 +58,19 @@
5758
<xs:attribute type="xs:string" name="selector" use="required"/>
5859
<xs:attribute type="xs:string" name="dependentSelector" use="required"/>
5960
<xs:attribute type="xs:boolean" name="visible" use="required"/>
60-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
61-
<xs:attribute type="xs:string" name="before"/>
62-
<xs:attribute type="xs:string" name="after"/>
61+
<xs:attribute ref="stepKey" use="required"/>
62+
<xs:attribute ref="before"/>
63+
<xs:attribute ref="after"/>
6364
</xs:extension>
6465
</xs:simpleContent>
6566
</xs:complexType>
6667
<xs:complexType name="doubleClickType">
6768
<xs:simpleContent>
6869
<xs:extension base="xs:string">
6970
<xs:attribute type="xs:string" name="selector" use="required"/>
70-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
71-
<xs:attribute type="xs:string" name="before"/>
72-
<xs:attribute type="xs:string" name="after"/>
71+
<xs:attribute ref="stepKey" use="required"/>
72+
<xs:attribute ref="before"/>
73+
<xs:attribute ref="after"/>
7374
</xs:extension>
7475
</xs:simpleContent>
7576
</xs:complexType>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
2+
<xs:attribute type="xs:string" name="stepKey" id="stepKey">
3+
<xs:annotation>
4+
<xs:documentation>
5+
Test action's unique identifier.
6+
</xs:documentation>
7+
</xs:annotation>
8+
</xs:attribute>
9+
<xs:attribute type="xs:string" name="before" id="before">
10+
<xs:annotation>
11+
<xs:documentation>
12+
stepKey of action that must be executed next.
13+
</xs:documentation>
14+
</xs:annotation>
15+
</xs:attribute>
16+
<xs:attribute type="xs:string" name="after" id="after">
17+
<xs:annotation>
18+
<xs:documentation>
19+
stepKey of preceding action.
20+
</xs:documentation>
21+
</xs:annotation>
22+
</xs:attribute>
23+
</xs:schema>

src/Magento/FunctionalTestingFramework/Test/etc/Actions/customActions.xsd

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
22

3+
<xs:include schemaLocation="commonAttributes.xsd"/>
34
<xs:group name="customTags">
45
<xs:choice>
56
<xs:element type="magentoCLIType" name="magentoCLI" minOccurs="0" maxOccurs="unbounded"/>
@@ -23,18 +24,18 @@
2324
<xs:simpleContent>
2425
<xs:extension base="xs:string">
2526
<xs:attribute type="xs:string" name="command"/>
26-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
27-
<xs:attribute type="xs:string" name="before"/>
28-
<xs:attribute type="xs:string" name="after"/>
27+
<xs:attribute ref="stepKey" use="required"/>
28+
<xs:attribute ref="before"/>
29+
<xs:attribute ref="after"/>
2930
</xs:extension>
3031
</xs:simpleContent>
3132
</xs:complexType>
3233
<xs:complexType name="closeAdminNotificationType">
3334
<xs:simpleContent>
3435
<xs:extension base="xs:string">
35-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
36-
<xs:attribute type="xs:string" name="before"/>
37-
<xs:attribute type="xs:string" name="after"/>
36+
<xs:attribute ref="stepKey" use="required"/>
37+
<xs:attribute ref="before"/>
38+
<xs:attribute ref="after"/>
3839
</xs:extension>
3940
</xs:simpleContent>
4041
</xs:complexType>
@@ -44,9 +45,9 @@
4445
<xs:attribute type="xs:string" name="selector" use="required"/>
4546
<xs:attribute type="xs:string" name="parameterArray" use="required"/>
4647
<xs:attribute type="xs:string" name="requiredAction"/>
47-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
48-
<xs:attribute type="xs:string" name="before"/>
49-
<xs:attribute type="xs:string" name="after"/>
48+
<xs:attribute ref="stepKey" use="required"/>
49+
<xs:attribute ref="before"/>
50+
<xs:attribute ref="after"/>
5051
</xs:extension>
5152
</xs:simpleContent>
5253
</xs:complexType>
@@ -55,19 +56,19 @@
5556
<xs:extension base="xs:string">
5657
<xs:attribute type="xs:string" name="userInput"/>
5758
<xs:attribute type="xs:string" name="locale"/>
58-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
59-
<xs:attribute type="xs:string" name="before"/>
60-
<xs:attribute type="xs:string" name="after"/>
59+
<xs:attribute ref="stepKey" use="required"/>
60+
<xs:attribute ref="before"/>
61+
<xs:attribute ref="after"/>
6162
</xs:extension>
6263
</xs:simpleContent>
6364
</xs:complexType>
6465
<xs:complexType name="parseFloatType">
6566
<xs:simpleContent>
6667
<xs:extension base="xs:string">
6768
<xs:attribute type="xs:string" name="userInput"/>
68-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
69-
<xs:attribute type="xs:string" name="before"/>
70-
<xs:attribute type="xs:string" name="after"/>
69+
<xs:attribute ref="stepKey" use="required"/>
70+
<xs:attribute ref="before"/>
71+
<xs:attribute ref="after"/>
7172
</xs:extension>
7273
</xs:simpleContent>
7374
</xs:complexType>
@@ -76,37 +77,37 @@
7677
<xs:extension base="xs:string">
7778
<xs:attribute type="xs:string" name="userInput"/>
7879
<xs:attribute type="xs:string" name="locale" use="required"/>
79-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
80-
<xs:attribute type="xs:string" name="before"/>
81-
<xs:attribute type="xs:string" name="after"/>
80+
<xs:attribute ref="stepKey" use="required"/>
81+
<xs:attribute ref="before"/>
82+
<xs:attribute ref="after"/>
8283
</xs:extension>
8384
</xs:simpleContent>
8485
</xs:complexType>
8586
<xs:complexType name="mResetLocaleType">
8687
<xs:simpleContent>
8788
<xs:extension base="xs:string">
88-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
89-
<xs:attribute type="xs:string" name="before"/>
90-
<xs:attribute type="xs:string" name="after"/>
89+
<xs:attribute ref="stepKey" use="required"/>
90+
<xs:attribute ref="before"/>
91+
<xs:attribute ref="after"/>
9192
</xs:extension>
9293
</xs:simpleContent>
9394
</xs:complexType>
9495
<xs:complexType name="scrollToTopOfPageType">
9596
<xs:simpleContent>
9697
<xs:extension base="xs:string">
97-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
98-
<xs:attribute type="xs:string" name="before"/>
99-
<xs:attribute type="xs:string" name="after"/>
98+
<xs:attribute ref="stepKey" use="required"/>
99+
<xs:attribute ref="before"/>
100+
<xs:attribute ref="after"/>
100101
</xs:extension>
101102
</xs:simpleContent>
102103
</xs:complexType>
103104
<xs:complexType name="clearFieldType">
104105
<xs:simpleContent>
105106
<xs:extension base="xs:string">
106107
<xs:attribute type="xs:string" name="selector" use="required"/>
107-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
108-
<xs:attribute type="xs:string" name="before"/>
109-
<xs:attribute type="xs:string" name="after"/>
108+
<xs:attribute ref="stepKey" use="required"/>
109+
<xs:attribute ref="before"/>
110+
<xs:attribute ref="after"/>
110111
</xs:extension>
111112
</xs:simpleContent>
112113
</xs:complexType>

src/Magento/FunctionalTestingFramework/Test/etc/Actions/dataActions.xsd

Lines changed: 70 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
22

3+
<xs:include schemaLocation="commonAttributes.xsd"/>
34
<xs:group name="dataOperationTags">
45
<xs:choice>
56
<xs:element type="createDataType" name="createData" minOccurs="0" maxOccurs="unbounded"/>
@@ -9,57 +10,100 @@
910
</xs:choice>
1011
</xs:group>
1112

12-
<!-- Complex Types -->
13+
<!-- Data Attributes -->
14+
<xs:attribute type="xs:string" name="createDataKey">
15+
<xs:annotation>
16+
<xs:documentation>
17+
Reference to the stepKey of a previously executed createData test action.
18+
</xs:documentation>
19+
</xs:annotation>
20+
</xs:attribute>
21+
<xs:attribute type="xs:string" name="entity">
22+
<xs:annotation>
23+
<xs:documentation>
24+
Name of entity to be used in data operation.
25+
</xs:documentation>
26+
</xs:annotation>
27+
</xs:attribute>
28+
<xs:attribute type="xs:string" name="storeCode">
29+
<xs:annotation>
30+
<xs:documentation>
31+
Store code that you wish to perform data operation against.
32+
</xs:documentation>
33+
</xs:annotation>
34+
</xs:attribute>
1335

36+
<!-- Complex Types -->
1437
<xs:complexType name="createDataType">
38+
<xs:annotation>
39+
<xs:documentation>Create an entity (e.g. a category or product). In other words, make a POST request to the Magento API according to the data and metadata of the entity to be created.</xs:documentation>
40+
</xs:annotation>
1541
<xs:choice minOccurs="0" maxOccurs="unbounded">
1642
<xs:element type="requiredEntityType" name="requiredEntity" minOccurs="0" maxOccurs="unbounded"/>
1743
</xs:choice>
18-
<xs:attribute type="xs:string" name="entity" use="required"/>
19-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
20-
<xs:attribute type="xs:string" name="before"/>
21-
<xs:attribute type="xs:string" name="after"/>
22-
<xs:attribute type="xs:string" name="storeCode"/>
44+
<xs:attribute ref="entity" use="required"/>
45+
<xs:attribute ref="stepKey" use="required"/>
46+
<xs:attribute ref="before"/>
47+
<xs:attribute ref="after"/>
48+
<xs:attribute ref="storeCode"/>
2349
</xs:complexType>
2450
<xs:complexType name="updateDataType">
51+
<xs:annotation>
52+
<xs:documentation>Updates a previously created entity (via createData).</xs:documentation>
53+
</xs:annotation>
2554
<xs:choice minOccurs="0" maxOccurs="unbounded">
2655
<xs:element type="requiredEntityType" name="requiredEntity" minOccurs="0" maxOccurs="unbounded"/>
2756
</xs:choice>
28-
<xs:attribute type="xs:string" name="entity" use="required"/>
29-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
30-
<xs:attribute type="xs:string" name="createDataKey" use="required"/>
31-
<xs:attribute type="xs:string" name="before"/>
32-
<xs:attribute type="xs:string" name="after"/>
33-
<xs:attribute type="xs:string" name="storeCode"/>
57+
<xs:attribute ref="entity" use="required"/>
58+
<xs:attribute ref="stepKey" use="required"/>
59+
<xs:attribute ref="createDataKey" use="required"/>
60+
<xs:attribute ref="before"/>
61+
<xs:attribute ref="after"/>
62+
<xs:attribute ref="storeCode"/>
3463
</xs:complexType>
3564
<xs:complexType name="deleteDataType">
65+
<xs:annotation>
66+
<xs:documentation>Deletes a previously created entity (via createData).</xs:documentation>
67+
</xs:annotation>
3668
<xs:simpleContent>
3769
<xs:extension base="xs:string">
38-
<xs:attribute type="xs:string" name="createDataKey" use="required"/>
39-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
40-
<xs:attribute type="xs:string" name="before"/>
41-
<xs:attribute type="xs:string" name="after"/>
42-
<xs:attribute type="xs:string" name="storeCode"/>
70+
<xs:attribute ref="createDataKey" use="required"/>
71+
<xs:attribute ref="stepKey" use="required"/>
72+
<xs:attribute ref="before"/>
73+
<xs:attribute ref="after"/>
74+
<xs:attribute ref="storeCode"/>
4375
</xs:extension>
4476
</xs:simpleContent>
4577
</xs:complexType>
4678
<xs:complexType name="getDataType">
79+
<xs:annotation>
80+
<xs:documentation>Retrieves an entity. In other words, makes a GET request to the Magento API according to the data and metadata of the entity type that is requested.</xs:documentation>
81+
</xs:annotation>
4782
<xs:choice minOccurs="0" maxOccurs="unbounded">
4883
<xs:element type="requiredEntityType" name="requiredEntity" minOccurs="0" maxOccurs="unbounded"/>
4984
</xs:choice>
50-
<xs:attribute type="xs:string" name="entity" use="required"/>
51-
<xs:attribute type="xs:string" name="stepKey" use="required"/>
52-
<xs:attribute type="xs:integer" name="index"/>
53-
<xs:attribute type="xs:string" name="before"/>
54-
<xs:attribute type="xs:string" name="after"/>
55-
<xs:attribute type="xs:string" name="storeCode"/>
85+
<xs:attribute ref="entity" use="required"/>
86+
<xs:attribute ref="stepKey" use="required"/>
87+
<xs:attribute type="xs:integer" name="index">
88+
<xs:annotation>
89+
<xs:documentation>
90+
If getData is supposed to return an array of objects, grab only index instead.
91+
</xs:documentation>
92+
</xs:annotation>
93+
</xs:attribute>
94+
<xs:attribute ref="before"/>
95+
<xs:attribute ref="after"/>
96+
<xs:attribute ref="storeCode"/>
5697
</xs:complexType>
5798
<xs:complexType name="requiredEntityType">
99+
<xs:annotation>
100+
<xs:documentation>Previously created entities that this operation requires (via createData)</xs:documentation>
101+
</xs:annotation>
58102
<xs:simpleContent>
59103
<xs:extension base="xs:string">
60-
<xs:attribute type="xs:string" name="createDataKey" use="required"/>
61-
<xs:attribute type="xs:string" name="before"/>
62-
<xs:attribute type="xs:string" name="after"/>
104+
<xs:attribute ref="createDataKey" use="required"/>
105+
<xs:attribute ref="before"/>
106+
<xs:attribute ref="after"/>
63107
</xs:extension>
64108
</xs:simpleContent>
65109
</xs:complexType>

0 commit comments

Comments
 (0)