Skip to content

Commit

Permalink
#580 Convert DeleteSystemCustomerGroupTest to MFTF
Browse files Browse the repository at this point in the history
  • Loading branch information
vovsky committed May 21, 2019
1 parent 211dd25 commit d1cfc96
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenCustomerGroupEditPageFromGridActionGroup">
<arguments>
<argument name="groupName" type="string"/>
</arguments>
<conditionalClick selector="{{AdminCustomerGroupMainSection.selectFirstRow}}" dependentSelector="{{AdminCustomerGroupMainSection.selectFirstRow}}" visible="true" stepKey="clickSelectButton"/>
<click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(groupName)}}" stepKey="clickOnEditCustomerGroup" />
<waitForPageLoad stepKey="waitForCustomerGroupEditPage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminOpenCustomerGroupsGridPageActionGroup">
<amOnPage url="{{AdminCustomerGroupsIndexPage.url}}" stepKey="goToAdminCustomerGroupIndexPage"/>
<waitForPageLoad time="30" stepKey="waitForCustomerGroupIndexPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertDeleteCustomerGroupButtonMissingActionGroup">
<dontSeeElement selector="AdminEditCustomerGroupSection.deleteButton" stepKey="dontSeeDeleteButton"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminEditCustomerGroupSection">
<element name="deleteButton" type="button" selector="#delete"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminCustomersDeleteSystemCustomerGroupTest">
<annotations>
<features value="Customer"/>
<title value="System Customer Groups"/>
<description value="Admin should not be able to delete system customer groups"/>
<group value="customers"/>
<group value="mtf_migrated"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="logout" stepKey="logout"/>
</after>

<!--Verify Not Logged In customer group-->
<!--Go to Customer Group grid page-->
<actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPageToCheckNotLoggedInGroup"/>
<actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByNotLoggedInGroupName">
<argument name="customerGroupName" value="{{NotLoggedInCustomerGroup.code}}"/>
</actionGroup>
<actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openNotLoggedInCustomerGroupEditPage">
<argument name="groupName" value="{{NotLoggedInCustomerGroup.code}}"/>
</actionGroup>
<actionGroup ref="AssertDeleteCustomerGroupButtonMissingActionGroup" stepKey="verifyThereIsNoDeleteButtonForNotLoggedInGroup"/>

<!--Verify General customer group-->
<!--Go to Customer Group grid page-->
<actionGroup ref="AdminOpenCustomerGroupsGridPageActionGroup" stepKey="openCustomerGroupGridPageToCheckGeneralGroup"/>
<actionGroup ref="AdminFilterCustomerGroupByNameActionGroup" stepKey="filterCustomerGroupsByGeneralGroupName">
<argument name="customerGroupName" value="{{GeneralCustomerGroup.code}}"/>
</actionGroup>
<actionGroup ref="AdminOpenCustomerGroupEditPageFromGridActionGroup" stepKey="openGeneralCustomerGroupEditPage">
<argument name="groupName" value="{{GeneralCustomerGroup.code}}"/>
</actionGroup>
<actionGroup ref="AssertDeleteCustomerGroupButtonMissingActionGroup" stepKey="verifyThereIsNoDeleteButtonForGeneralGroup"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<variation name="DeleteSystemCustomerGroup1" summary="Checks that NOT LOGGED IN Customer Group cannot be deleted">
<data name="customerGroup/dataset" xsi:type="string">NOT_LOGGED_IN</data>
<constraint name="Magento\Customer\Test\Constraint\AssertNoDeleteForSystemCustomerGroup" />
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
</variation>
<variation name="DeleteSystemCustomerGroup2" summary="Checks that General Customer Group cannot be deleted">
<data name="customerGroup/dataset" xsi:type="string">General</data>
<constraint name="Magento\Customer\Test\Constraint\AssertNoDeleteForSystemCustomerGroup" />
<data name="tag" xsi:type="string">mftf_migrated:yes</data>
</variation>
</testCase>
</config>

0 comments on commit d1cfc96

Please sign in to comment.