Skip to content

Commit c02e4ac

Browse files
committed
Adding Delete Custom Variable Test
1 parent dfd785f commit c02e4ac

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

app/code/Magento/Variable/Test/Mftf/Data/VariableData.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@
1717
<data key="html"> Sample Variable </data>
1818
<data key="plain">variable-plain-</data>
1919
</entity>
20+
<entity name="customVariableV2" type="system_variable" extends="customVariable">
21+
<data key="code" unique="suffix">variable-code-</data>
22+
</entity>
2023
</entities>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<operations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataOperation.xsd">
11+
<operation name="CreateCustomVariable" dataType="system_variable" type="create" auth="adminFormKey"
12+
url="/admin/system_variable/save" method="POST" successRegex="/messages-message-success/">
13+
<contentType>application/x-www-form-urlencoded</contentType>
14+
<object dataType="system_variable" key="variable">
15+
<field key="code">string</field>
16+
<field key="name">string</field>
17+
<field key="html">string</field>
18+
<field key="plain">string</field>
19+
</object>
20+
</operation>
21+
</operations>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="DeleteCustomVariableEntityTest">
12+
<annotations>
13+
<features value="Variable"/>
14+
<stories value="Delete Custom Variable."/>
15+
<title value="Delete Custom Variable."/>
16+
<description value="Test for deleting a custom variable."/>
17+
<severity value="MAJOR"/>
18+
<group value="variable"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
23+
<createData entity="customVariableV2" stepKey="createCustomVariable"/>
24+
</before>
25+
<after>
26+
<actionGroup ref="logout" stepKey="logout"/>
27+
</after>
28+
<actionGroup ref="AdminNavigateToVariablesGridPageActionGroup" stepKey="goToVariablesGridAdminPage"/>
29+
<actionGroup ref="AdminFilterGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" >
30+
<argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/>
31+
<argument name="value" value="$$customVariableV2.code$$"/>
32+
</actionGroup>
33+
<actionGroup ref="AdminNavigateToVariablePageActionGroup" stepKey="openCustomVariablePage">
34+
<argument name="code" value="$$customVariableV2.code$$"/>
35+
</actionGroup>
36+
<actionGroup ref="AdminClickDeleteMainButtonWithConfirmationActionGroup" stepKey="clickDeleteVariable"/>
37+
<actionGroup ref="AssertMessageActionGroup" stepKey="seeSuccessMessage">
38+
<argument name="message" value="You deleted the custom variable."/>
39+
</actionGroup>
40+
</test>
41+
</tests>

0 commit comments

Comments
 (0)