forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pull-27917' into 108_clear-shopping-cart-button-configu…
…ration
- Loading branch information
Showing
8 changed files
with
185 additions
and
15 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
...gento/Checkout/Test/Mftf/ActionGroup/AdminCheckoutClearShoppingCartEnabledActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?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="AdminCheckoutClearShoppingCartEnabledActionGroup"> | ||
<annotations> | ||
<description>Enable/disable display of clear shopping cart button on the cart page via checkout cart configuration.</description> | ||
</annotations> | ||
<arguments> | ||
<argument name="value" type="string" defaultValue="Yes"/> | ||
</arguments> | ||
<scrollTo selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabled}}" x="0" y="-100" stepKey="scrollToClearShoppingCartEnabled"/> | ||
<uncheckOption selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabledInherit}}" stepKey="uncheckUseSystem"/> | ||
<selectOption selector="{{AdminCheckoutConfigSection.clearShoppingCartEnabled}}" userInput="{{value}}" stepKey="fillClearShoppingCartEnabled"/> | ||
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/> | ||
<seeElement selector="{{AdminMessagesSection.success}}" stepKey="seeSuccessMessage"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
...de/Magento/Checkout/Test/Mftf/ActionGroup/AdminOpenSalesCheckoutConfigPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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="AdminOpenSalesCheckoutConfigPageActionGroup"> | ||
<arguments> | ||
<argument name="tabGroupAnchor" type="string" defaultValue=""/> | ||
</arguments> | ||
<amOnPage url="{{AdminCheckoutConfigPage.url(tabGroupAnchor)}}" stepKey="openCheckoutConfigPage"/> | ||
<waitForPageLoad stepKey="waitForCheckoutConfigPageLoad"/> | ||
</actionGroup> | ||
</actionGroups> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/code/Magento/Checkout/Test/Mftf/Page/AdminCheckoutConfigPage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
13 changes: 13 additions & 0 deletions
13
app/code/Magento/Checkout/Test/Mftf/Section/AdminCheckoutConfigSection.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?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="AdminCheckoutConfigSection"> | ||
<element name="clearShoppingCartEnabled" type="select" selector="#checkout_cart_enable_clear_shopping_cart"/> | ||
<element name="clearShoppingCartEnabledInherit" type="select" selector="#checkout_cart_enable_clear_shopping_cart_inherit"/> | ||
</section> | ||
</sections> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...st/StorefrontCheckRenderingClearCartButtonOnTheCartPageBasedOnStoresConfigurationTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?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="StorefrontCheckRenderingClearShoppingCartButtonOnTheCartPageBasedOnStoresConfigurationTest"> | ||
<annotations> | ||
<features value="Checkout"/> | ||
<stories value="Shopping Cart"/> | ||
<title value="Check display render of clear shopping cart button on the cart page based on checkout cart stores configuration"/> | ||
<description value="Check display render of clear shopping cart button on the cart page based on checkout cart stores configuration"/> | ||
<severity value="MAJOR"/> | ||
<group value="shoppingCart"/> | ||
</annotations> | ||
|
||
<before> | ||
<!-- Create simple product --> | ||
<createData entity="SimpleProduct2" stepKey="createProduct"/> | ||
</before> | ||
<after> | ||
<!-- Delete simple product --> | ||
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/> | ||
|
||
<!-- Disable rendering of clear shopping cart button on the cart page --> | ||
<magentoCLI command="config:set {{DisableClearShoppingCartButtonOnTheCartPage.path}} {{DisableClearShoppingCartButtonOnTheCartPage.value}}" stepKey="disableClearShoppingCart"/> | ||
|
||
<!-- Log out --> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> | ||
</after> | ||
<!-- Add product to cart --> | ||
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> | ||
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/> | ||
</actionGroup> | ||
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart"> | ||
<argument name="product" value="$$createProduct$$"/> | ||
<argument name="productCount" value="1"/> | ||
</actionGroup> | ||
|
||
<!-- Navigate to cart page --> | ||
<actionGroup ref="StorefrontOpenCartFromMinicartActionGroup" stepKey="openShoppingCart"/> | ||
<waitForPageLoad stepKey="waitForShoppingCartLoad" /> | ||
|
||
<!-- Assert that empty cart button is not rendered on the cart page --> | ||
<dontSeeElement selector="{{CheckoutCartProductSection.emptyCartButton}}" stepKey="dontSeeClearShoppingCartButton"/> | ||
|
||
<!-- Open new browser's window and login as Admin --> | ||
<openNewTab stepKey="openNewTab"/> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> | ||
|
||
<!-- Navigate to checkout cart configuration --> | ||
<actionGroup ref="AdminOpenSalesCheckoutConfigPageActionGroup" stepKey="openCheckoutCartConfig"> | ||
<argument name="tabGroupAnchor" value="#checkout_cart-link"/> | ||
</actionGroup> | ||
|
||
<!-- Enable clear shopping cart button --> | ||
<actionGroup ref="AdminCheckoutClearShoppingCartEnabledActionGroup" stepKey="enableClearShoppingCartButton"/> | ||
|
||
<!-- Flush cache --> | ||
<magentoCLI command="cache:flush" stepKey="cacheFlush"/> | ||
|
||
<!-- Back to the Cart page and refresh the page --> | ||
<switchToPreviousTab stepKey="switchToPreviousTab"/> | ||
<reloadPage stepKey="refreshPage"/> | ||
<waitForPageLoad stepKey="waitPageReload"/> | ||
|
||
<!-- Assert that empty cart button is rendered on the cart page --> | ||
<seeElement selector="{{CheckoutCartProductSection.emptyCartButton}}" stepKey="SeeClearShoppingCartButton"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters