Skip to content

Commit

Permalink
magento#108: Clear Shopping Cart - Refactor MFTF and PHP files for PR…
Browse files Browse the repository at this point in the history
… changes requested
  • Loading branch information
John Carlo Octabio committed Jul 22, 2020
1 parent b65a287 commit 418c6e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<title value="Enable and Disable Clear Shopping Cart Configuration"/>
<description value="Verify that disabling the clear shopping cart store configuration will remove the clear shopping cart configuration button from the storefront's shopping cart page. Verify that enabling the configuration will add the button to the page and that the button functions as expected"/>
<group value="shoppingCart"/>
<severity value="MAJOR"/>
</annotations>
<before>
<!-- Create simple products and category -->
Expand Down Expand Up @@ -45,9 +46,6 @@
<!-- Enable clear shopping cart button -->
<actionGroup ref="AdminSelectClearShoppingCartConfigurationActionGroup" stepKey="enableClearShoppingCartButton"/>
<actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration1"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cliCacheClean1">
<argument name="tags" value=""/>
</actionGroup>

<!-- Open product 1 and add to cart -->
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct1Page1">
Expand All @@ -74,9 +72,6 @@
<argument name="value" value="{{DisableClearShoppingCart.textValue}}"/>
</actionGroup>
<actionGroup ref="SaveStoreConfigurationActionGroup" stepKey="saveStoreConfiguration2"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cliCacheClean2">
<argument name="tags" value=""/>
</actionGroup>

<!-- Open product 1 page and add to cart -->
<actionGroup ref="StorefrontOpenProductEntityPageActionGroup" stepKey="openProduct1Page2">
Expand Down
5 changes: 4 additions & 1 deletion app/code/Magento/Checkout/ViewModel/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
use Magento\Framework\View\Element\Context;
use Magento\Store\Model\ScopeInterface;

/**
* Cart form view model.
*/
class Cart implements ArgumentInterface
{
/**
* Config settings path to enable clear shopping cart button
*/
public const XPATH_CONFIG_ENABLE_CLEAR_SHOPPING_CART = 'checkout/cart/enable_clear_shopping_cart';
private const XPATH_CONFIG_ENABLE_CLEAR_SHOPPING_CART = 'checkout/cart/enable_clear_shopping_cart';

/**
* @var ScopeConfigInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
/**
* Test for clear shopping cart config
*
* @package Magento\Checkout\ViewModel
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class CartTest extends TestCase
Expand Down

0 comments on commit 418c6e8

Please sign in to comment.