Skip to content

Commit

Permalink
ENGCOM-7877: Added configuration to enable/disable Clear Shopping Car…
Browse files Browse the repository at this point in the history
…t action in storefront #28594
  • Loading branch information
joanhe authored Jul 24, 2020
2 parents eb98b71 + 4b54f3d commit c4c05eb
Show file tree
Hide file tree
Showing 74 changed files with 1,833 additions and 443 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
<!--Delete all created data during the test execution and assign Default Root Category to Store-->
<after>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin2"/>
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnPageAdminSystemStore"/>
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" />
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnPageAdminSystemStore"/>
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
<waitForPageLoad time="10" stepKey="waitForPageAdminStoresGridLoadAfterResetButton"/>
<fillField selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store" stepKey="fillFieldOnWebsiteStore"/>
Expand Down Expand Up @@ -58,8 +57,7 @@
<argument name="categoryEntity" value="SubCategoryWithParent"/>
</actionGroup>
<!--Assign new created root category to store-->
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnPageAdminSystemStore"/>
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" />
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnPageAdminSystemStore"/>
<click selector="{{AdminStoresGridSection.resetButton}}" stepKey="clickOnResetButton"/>
<waitForPageLoad time="10" stepKey="waitForPageAdminStoresGridLoadAfterResetButton"/>
<fillField selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store" stepKey="fillFieldOnWebsiteStore"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<!--Grab new store view code-->
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="navigateToNewWebsitePage"/>
<waitForPageLoad stepKey="waitForStoresPageLoad"/>
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="navigateToNewWebsitePage"/>
<fillField userInput="{{NewWebSiteData.name}}" selector="{{AdminStoresGridSection.websiteFilterTextField}}" stepKey="fillSearchWebsiteField"/>
<click selector="{{AdminStoresGridSection.searchButton}}" stepKey="clickSearchButton"/>
<click selector="{{AdminStoresGridSection.storeNameInFirstRow}}" stepKey="clickFirstRow"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
<waitForPageLoad stepKey="waitForSystemStorePage"/>
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnAdminSystemStorePage"/>
<click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/>
<fillField userInput="{{customStore.name}}" selector="{{AdminNewStoreGroupSection.storeGrpNameTextField}}" stepKey="fillStoreName"/>
<fillField userInput="{{customStore.code}}" selector="{{AdminNewStoreGroupSection.storeGrpCodeTextField}}" stepKey="fillStoreCode"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
</actionGroup>

<!--Create Store view -->
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
<waitForPageLoad stepKey="waitForSystemStorePage"/>
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnAdminSystemStorePage"/>
<click selector="{{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey="createStoreViewButton"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<waitForElementVisible selector="//legend[contains(., 'Store View Information')]" stepKey="waitForNewStorePageToOpen"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
</actionGroup>

<!--Create Store view -->
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
<waitForPageLoad stepKey="waitForSystemStorePage"/>
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnAdminSystemStorePage"/>
<click selector="{{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey="createStoreViewButton"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<waitForElementVisible selector="//legend[contains(., 'Store View Information')]" stepKey="waitForNewStorePageToOpen"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
</after>

<!--Open Store Page -->
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
<waitForPageLoad stepKey="waitForSystemStorePage"/>
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnAdminSystemStorePage"/>

<!--Create Custom Store -->
<click selector="{{AdminStoresMainActionsSection.createStoreButton}}" stepKey="selectCreateStore"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@
<argument name="parentCategory" value="$$createNewRootCategoryA.name$$"/>
</actionGroup>
<!-- Change root category for Main Website Store. -->
<amOnPage stepKey="s1" url="{{AdminSystemStorePage.url}}"/>
<waitForPageLoad stepKey="waitForPageAdminSystemStoreLoad" />
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="s1"/>
<click stepKey="s2" selector="{{AdminStoresGridSection.resetButton}}"/>
<waitForPageLoad stepKey="waitForPageAdminStoresGridLoadAfterResetButton" time="10"/>
<fillField stepKey="s4" selector="{{AdminStoresGridSection.storeGrpFilterTextField}}" userInput="Main Website Store"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@
</actionGroup>

<!--Create Store view -->
<amOnPage url="{{AdminSystemStorePage.url}}" stepKey="amOnAdminSystemStorePage"/>
<waitForPageLoad stepKey="waitForAdminSystemStorePage"/>
<actionGroup ref="AdminSystemStoreOpenPageActionGroup" stepKey="amOnAdminSystemStorePage"/>
<click selector="{{AdminStoresMainActionsSection.createStoreViewButton}}" stepKey="createStoreViewButton"/>
<waitForPageLoad stepKey="waitForProductPageLoad"/>
<selectOption userInput="Second Store" selector="{{AdminNewStoreSection.storeGrpDropdown}}" stepKey="selectStoreGroup"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<deleteData createDataKey="createSimpleProductTwo" stepKey="deleteSimpleProductTwo"/>

<!-- Delete the catalog price rule -->
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid">
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand All @@ -46,8 +46,7 @@
</after>

<!-- 1. Begin creating a new catalog price rule -->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/>
<waitForPageLoad stepKey="waitForPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<click selector="{{AdminGridMainControls.add}}" stepKey="addNewRule"/>
<waitForPageLoad stepKey="waitForIndividualRulePage"/>
<fillField selector="{{AdminNewCatalogPriceRule.ruleName}}" userInput="{{_defaultCatalogRule.name}}" stepKey="fillName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@
</after>

<!-- Delete the simple product and catalog price rule -->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/>
<waitForPageLoad stepKey="waitForPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage1"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule1">
<argument name="name" value="{{DeleteActiveCatalogPriceRuleWithConditions.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@
</after>

<!-- Delete the simple product and catalog price rule -->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/>
<waitForPageLoad stepKey="waitForPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage1"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule1">
<argument name="name" value="{{DeleteActiveCatalogPriceRuleWithConditions.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$0.90" stepKey="seeCorrectPrice2"/>

<!-- Delete the rule -->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<after>

<!--Delete created data-->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToCatalogPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToCatalogPriceRulePage"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
<argument name="name" value="{{CatalogRuleWithAllCustomerGroups.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand All @@ -68,8 +68,7 @@
</after>

<!--Create catalog price rule-->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage"/>
<waitForPageLoad stepKey="waitForPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup ref="CreateCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule">
<argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/>
</actionGroup>
Expand Down Expand Up @@ -104,7 +103,7 @@

<!--Delete previous attribute and Catalog Price Rule-->
<deleteData createDataKey="createProductAttribute" stepKey="deleteProductAttribute"/>
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToCatalogPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToCatalogPriceRulePage"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
<argument name="name" value="{{CatalogRuleWithAllCustomerGroups.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand All @@ -116,8 +115,7 @@
</createData>

<!--Create new Catalog Price Rule-->
<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToPriceRulePage1"/>
<waitForPageLoad stepKey="waitForPriceRulePage1"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage1"/>
<actionGroup ref="CreateCatalogPriceRuleActionGroup" stepKey="createCatalogPriceRule1">
<argument name="catalogRule" value="CatalogRuleWithAllCustomerGroups"/>
</actionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteConfigChildProduct2"/>
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteConfigProductAttribute"/>

<amOnPage url="{{CatalogRulePage.url}}" stepKey="goToCatalogPriceRulePage"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToCatalogPriceRulePage"/>
<actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule">
<argument name="name" value="{{SimpleCatalogPriceRule.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</before>
<after>
<!-- Delete the catalog price rule -->
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid">
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>

<!-- Delete the catalog price rule -->
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid">
<argument name="name" value="{{CatalogRuleByFixed.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<deleteData createDataKey="customerGroup" stepKey="deleteCustomerGroup"/>

<!-- Delete the catalog price rule -->
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid">
<argument name="name" value="{{CatalogRuleByFixed.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>

<!-- Delete the catalog price rule -->
<amOnPage stepKey="goToPriceRulePage" url="{{CatalogRulePage.url}}"/>
<actionGroup ref="AdminOpenCatalogPriceRulePageActionGroup" stepKey="goToPriceRulePage"/>
<actionGroup stepKey="deletePriceRule" ref="deleteEntitySecondaryGrid">
<argument name="name" value="{{_defaultCatalogRule.name}}"/>
<argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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="AdminOpenSalesCheckoutConfigPageActionGroup">
<annotations>
<description>Goes to the Store Configuration > Sales > Checkout configuration page in admin.</description>
</annotations>
<arguments>
<argument name="tabGroupAnchor" type="string" defaultValue=""/>
</arguments>
<amOnPage url="{{AdminCheckoutConfigPage.url(tabGroupAnchor)}}" stepKey="openCheckoutConfigPage"/>
<waitForPageLoad stepKey="waitForCheckoutConfigPageLoad"/>
</actionGroup>
</actionGroups>

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="AdminSelectClearShoppingCartConfigurationActionGroup">
<annotations>
<description>Enable/Disable clear shopping cart store configuration using UI.</description>
</annotations>
<arguments>
<argument name="value" type="string" defaultValue="{{EnableClearShoppingCart.textValue}}"/>
</arguments>
<waitForElementVisible selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabledInherit}}" stepKey="waitForClearShoppingCartEnabledInherit" />
<uncheckOption selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabledInherit}}" stepKey="uncheckUseSystem" />
<waitForElementVisible selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabled}}" stepKey="waitForClearShoppingCartEnabled" />
<selectOption selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabled}}" userInput="{{value}}" stepKey="fillClearShoppingCartEnabled" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?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="StorefrontClearShoppingCartActionGroup">
<annotations>
<description>Clicks the Clear Shopping Cart button on the storefront on the shopping cart page and verifies shopping cart gets emptied.</description>
</annotations>

<waitForElementVisible selector="{{CheckoutCartProductSection.emptyCartButton}}" stepKey="waitForEmptyCartButton"/>
<click selector="{{CheckoutCartProductSection.emptyCartButton}}" stepKey="clickEmptyCartButton"/>
<waitForElementVisible selector="{{CheckoutCartProductSection.modalMessage}}" stepKey="waitForModalMessage"/>
<waitForText selector="{{CheckoutCartProductSection.modalMessage}}" userInput="Are you sure you want to remove all items from your shopping cart?" stepKey="waitForTextModalMessage"/>
<waitForElementVisible selector="{{CheckoutCartProductSection.modalConfirmButton}}" stepKey="waitForModalConfirmButton"/>
<click selector="{{CheckoutCartProductSection.modalConfirmButton}}" stepKey="clickModalConfirmButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<seeCurrentUrlEquals url="{{_ENV.MAGENTO_BASE_URL}}checkout/cart" stepKey="seeCurrentUrlEqualsCartPage"/>
<waitForText selector="{{CheckoutCartMessageSection.emptyCartMessage}}" userInput="You have no items in your shopping cart." stepKey="waitForEmptyCartMessage"/>

</actionGroup>
</actionGroups>
13 changes: 13 additions & 0 deletions app/code/Magento/Checkout/Test/Mftf/Data/ConfigData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,17 @@
<data key="label">Display number of items in cart</data>
<data key="value">0</data>
</entity>

<entity name="EnableClearShoppingCart">
<data key="path">checkout/cart/enable_clear_shopping_cart</data>
<data key="label">Display clear shopping cart button on the cart page</data>
<data key="value">1</data>
<data key="textValue">Yes</data>
</entity>
<entity name="DisableClearShoppingCart">
<data key="path">checkout/cart/enable_clear_shopping_cart</data>
<data key="label">Do not display clear shopping cart button on the cart page</data>
<data key="value">0</data>
<data key="textValue">No</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminCheckoutConfigPage" url="admin/system_config/edit/section/checkout/{{tabLink}}" area="admin" parameterized="true" module="Magento_Checkout">
<section name="AdminCheckoutConfigSection"/>
</page>
</pages>
Loading

0 comments on commit c4c05eb

Please sign in to comment.