Skip to content

Commit 331b78c

Browse files
committed
Convert CreateCustomVariableEntityTest to MFTF
1 parent d7fc607 commit 331b78c

10 files changed

+182
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminAssertSuccessMessageActionGroup" >
11+
<see userInput="You saved the custom variable." selector="{{AdminVariableMessagesSection.successMessage}}" stepKey="seeMessage"/>
12+
</actionGroup>
13+
<actionGroup name="AdminSeeVariableInGridActionGroup">
14+
<see selector="{{AdminVariablesGridSection.rowByValue(customVariable.code)}}" userInput="{{customVariable.code}}" stepKey="seeVariableCodeInGrid"/>
15+
</actionGroup>
16+
</actionGroups>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="FilterVariablesGridActionGroup">
12+
<arguments>
13+
<argument name="field" type="string"/>
14+
<argument name="value" type="string"/>
15+
</arguments>
16+
<fillField selector="{{field}}" userInput="{{value}}" stepKey="fillVariableAttributeInFilter"/>
17+
<click selector="{{AdminVariablesFilterSection.searchButton}}" stepKey="clickSearchButton"/>
18+
</actionGroup>
19+
<actionGroup name="ResetFilterVariablesGridActionGroup">
20+
<click selector="{{AdminVariablesFilterSection.resetFilterButton}}" stepKey="clickResetButton"/>
21+
</actionGroup>
22+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="NavigateToNewVariablePageActionGroup">
12+
<amOnPage url="{{AdminNewVariablePage.url}}" stepKey="openNewVariablePage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="NavigateToVariablesPage">
12+
<amOnPage url="{{AdminVariablesPage.url}}" stepKey="openVariablesGridPage"/>
13+
<waitForPageLoad stepKey="waitForPageLoad"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminNewVariablePage" url="/admin/system_variable/new/" area="admin" module="Magento_Variable">
12+
<section name="AdminNewVariableSection"/>
13+
</page>
14+
</pages>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminVariablesPage" url="/admin/system_variable/index/" area="admin" module="Magento_Variable">
12+
<section name="AdminVariableMessagesSection"/>
13+
<section name="AdminVariablesFilterSection"/>
14+
<section name="AdminVariablesGridSection"/>
15+
</page>
16+
</pages>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminVariableMessagesSection">
12+
<element name="successMessage" type="text" selector=".message-success"/>
13+
<element name="errorMessage" type="text" selector=".message.message-error.error"/>
14+
</section>
15+
</sections>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminVariablesFilterSection">
12+
<element name="searchButton" type="button" selector="button.action-default[title='Search']"/>
13+
<element name="resetFilterButton" type="button" selector="button.action-reset[title='Reset Filter']"/>
14+
<element name="codeFilter" type="input" selector="input.admin__control-text[name='code']"/>
15+
<element name="nameFilter" type="input" selector="input.admin__control-text[name='name']"/>
16+
</section>
17+
</sections>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminVariablesGridSection">
12+
<element name="variablesGrid" type="text" selector="table[data-role='grid']"/>
13+
<element name="rowByValue" type="text" selector="//td[text()[contains(.,'{{var}}')]]" parameterized="true" timeout="30"/>
14+
</section>
15+
</sections>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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="CreateCustomVariableEntityTest">
12+
<annotations>
13+
<features value="Variable"/>
14+
<stories value="Create Custom Variable."/>
15+
<title value="Create Custom Variable."/>
16+
<description value="Test for creating 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+
</before>
24+
<actionGroup ref="CreateCustomVariableActionGroup" stepKey="createCustomVariable"/>
25+
<waitForPageLoad stepKey="waitForPageLoad"/>
26+
<actionGroup ref="AdminAssertSuccessMessageActionGroup" stepKey="seeSuccessMessage"/>
27+
<actionGroup ref="FilterVariablesGridActionGroup" stepKey="filterVariablesGridByNewVariableCode" >
28+
<argument name="field" value="{{AdminVariablesFilterSection.codeFilter}}"/>
29+
<argument name="value" value="{{customVariable.code}}"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminSeeVariableInGridActionGroup" stepKey="seeNewVariableInGrid"/>
32+
<after>
33+
<actionGroup ref="ResetFilterVariablesGridActionGroup" stepKey="resetVariablesGrid"/>
34+
<actionGroup ref="logout" stepKey="logout"/>
35+
</after>
36+
</test>
37+
</tests>

0 commit comments

Comments
 (0)