Skip to content

Commit 01c96b8

Browse files
committed
Refactoring the Action Groups and the overall implementation
1 parent f7bc566 commit 01c96b8

16 files changed

+114
-81
lines changed

app/code/Magento/Variable/Test/Mftf/ActionGroup/FilterVariablesGridActionGroup.xml renamed to app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminFilterGridActionGroup.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88

99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11-
<actionGroup name="FilterVariablesGridActionGroup">
11+
<actionGroup name="AdminFilterGridActionGroup">
1212
<arguments>
1313
<argument name="field" type="string"/>
1414
<argument name="value" type="string"/>
15+
<argument name="button" type="string" defaultValue="{{AdminSecondaryGridSection.searchButton}}"/>
1516
</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"/>
17+
<fillField selector="{{field}}" userInput="{{value}}" stepKey="fillFieldInFilter"/>
18+
<click selector="{{button}}" stepKey="clickSearchButton"/>
2119
</actionGroup>
2220
</actionGroups>
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminResetFilterActionGroup">
12+
<arguments>
13+
<argument name="selector" type="string" defaultValue="{{AdminSecondaryGridSection.resetFilters}}"/>
14+
</arguments>
15+
<click selector="{{selector}}" stepKey="clickResetButton"/>
16+
</actionGroup>
17+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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="AssertMessageActionGroup">
12+
<arguments>
13+
<argument name="message" type="string" />
14+
<argument name="messageType" type="string" defaultValue="success" />
15+
</arguments>
16+
<see userInput="{{message}}" selector=".messages .message-{{messageType}}" stepKey="verifyMessage" />
17+
</actionGroup>
18+
</actionGroups>
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="AssertValueInGridActionGroup">
11+
<arguments>
12+
<argument name="value" type="string" />
13+
</arguments>
14+
<see selector="{{AdminGridTableSection.rowByValue(value)}}" userInput="{{value}}" stepKey="seeValueInGrid"/>
15+
</actionGroup>
16+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Section/AdminGridTableSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminGridTableSection">
1212
<element name="row" type="text" selector="table.data-grid tbody tr[data-role=row]:nth-of-type({{row}})" parameterized="true"/>
13+
<element name="rowByValue" type="text" selector="//tr[@data-role='row'] //td[contains(., '{{var}}')]" parameterized="true" timeout="30"/>
1314
</section>
1415
</sections>

app/code/Magento/Variable/Test/Mftf/ActionGroup/AdminAssertSuccessAddedActionGroup.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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="AdminCreateCustomVariableActionGroup">
11+
<amOnPage url="admin/admin/system_variable/new/" stepKey="goToNewCustomVariablePage"/>
12+
<waitForPageLoad stepKey="waitForPageLoad"/>
13+
<fillField selector="{{CustomVariableSection.variableCode}}" userInput="{{customVariable.code}}" stepKey="fillVariableCode"/>
14+
<fillField selector="{{CustomVariableSection.variableName}}" userInput="{{customVariable.name}}" stepKey="fillVariableName"/>
15+
<fillField selector="{{CustomVariableSection.variableHTML}}" userInput="{{customVariable.html}}" stepKey="fillVariableHtml"/>
16+
<fillField selector="{{CustomVariableSection.variablePlain}}" userInput="{{customVariable.plain}}" stepKey="fillVariablePlain"/>
17+
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveVariable"/>
18+
<waitForPageLoad stepKey="waitForPageLoad2"/>
19+
</actionGroup>
20+
</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="AdminDeleteCustomVariableActionGroup">
12+
<amOnPage url="admin/admin/system_variable/" stepKey="goToVariableGrid"/>
13+
<waitForPageLoad stepKey="waitForPageLoad1"/>
14+
<click selector="{{CustomVariableSection.GridCustomVariableCode(customVariable.code)}}" stepKey="goToCustomVariableEditPage"/>
15+
<waitForPageLoad stepKey="waitForPageLoad2"/>
16+
<waitForElementVisible selector="{{CustomVariableSection.delete}}" stepKey="waitForDeleteBtn"/>
17+
<click selector="{{CustomVariableSection.delete}}" stepKey="deleteCustomVariable"/>
18+
<waitForText userInput="Are you sure you want to do this?" stepKey="waitForText"/>
19+
<click selector="{{CustomVariableSection.confirmDelete}}" stepKey="confirmDelete"/>
20+
<waitForPageLoad stepKey="waitForPageLoad3"/>
21+
</actionGroup>
22+
</actionGroups>

app/code/Magento/Variable/Test/Mftf/ActionGroup/CreateCustomVariableActionGroup.xml

Lines changed: 0 additions & 31 deletions
This file was deleted.

app/code/Magento/Variable/Test/Mftf/Page/AdminNewVariablePage.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
1111
<page name="AdminNewVariablePage" url="/admin/system_variable/new/" area="admin" module="Magento_Variable">
12-
<section name="AdminNewVariableSection"/>
12+
<section name="AdminMessagesSection"/>
1313
</page>
1414
</pages>

0 commit comments

Comments
 (0)