Skip to content

Commit d8202e8

Browse files
committed
MQE-145 XML Parser should be able to remove nodes
1 parent 73f7c7d commit d8202e8

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

src/Magento/AcceptanceTestFramework/Config/Converter.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ protected function convertXml($elements)
7979

8080
foreach ($elements as $element) {
8181
if ($element instanceof \DOMElement) {
82+
if ($element->getAttribute('remove') == 'true') {
83+
// Remove element
84+
continue;
85+
}
8286
if ($element->hasAttribute('xsi:type')) {
8387
if ($element->hasAttribute('path')) {
8488
$elementData = $this->getAttributes($element);

src/Magento/AcceptanceTestFramework/DataGenerator/etc/DataProfileSchema.xsd

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,14 @@
9494
</xs:extension>
9595
</xs:simpleContent>
9696
</xs:complexType>
97-
</xs:schema>
97+
98+
<xs:attributeGroup name="removeAttribute">
99+
<xs:attribute type="xs:boolean" name="remove" use="optional" default="false">
100+
<xs:annotation>
101+
<xs:documentation>
102+
Set to true to remove this element during parsing.
103+
</xs:documentation>
104+
</xs:annotation>
105+
</xs:attribute>
106+
</xs:attributeGroup>
107+
</xs:schema>

src/Magento/AcceptanceTestFramework/Page/etc/blockObject.xsd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,14 @@
125125
<xs:minLength value="1" />
126126
</xs:restriction>
127127
</xs:simpleType>
128+
129+
<xs:attributeGroup name="removeAttribute">
130+
<xs:attribute type="xs:boolean" name="remove" use="optional" default="false">
131+
<xs:annotation>
132+
<xs:documentation>
133+
Set to true to remove this element during parsing.
134+
</xs:documentation>
135+
</xs:annotation>
136+
</xs:attribute>
137+
</xs:attributeGroup>
128138
</xs:schema>

src/Magento/AcceptanceTestFramework/Page/etc/pageObject.xsd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,14 @@
9090
<xs:minLength value="1" />
9191
</xs:restriction>
9292
</xs:simpleType>
93+
94+
<xs:attributeGroup name="removeAttribute">
95+
<xs:attribute type="xs:boolean" name="remove" use="optional" default="false">
96+
<xs:annotation>
97+
<xs:documentation>
98+
Set to true to remove this element during parsing.
99+
</xs:documentation>
100+
</xs:annotation>
101+
</xs:attribute>
102+
</xs:attributeGroup>
93103
</xs:schema>

0 commit comments

Comments
 (0)