Skip to content

Commit

Permalink
Merge branch '2.3-develop' into 622-customizable-options-update-cart
Browse files Browse the repository at this point in the history
  • Loading branch information
rogyar committed May 8, 2019
2 parents 62e0530 + c56341c commit 9787c95
Show file tree
Hide file tree
Showing 305 changed files with 10,371 additions and 557 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="StorefrontSelectBundleProductDropDownOptionActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<click selector="{{StorefrontBundleProductActionSection.dropdownSelectOption}}" stepKey="clickOnSelectOption"/>
<click selector="{{StorefrontBundleProductActionSection.dropdownProductSelection(productName)}}" stepKey="selectProduct"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup">
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="waitForCustomizeAndAddToCartButton"/>
<click selector="{{StorefrontBundleProductActionSection.customizeAndAddToCartButton}}" stepKey="clickOnCustomizeAndAddToCartButton"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
16 changes: 16 additions & 0 deletions app/code/Magento/Bundle/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,20 @@
<requiredEntity type="custom_attribute">CustomAttributeFixPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceView</requiredEntity>
</entity>
<entity name="BundleProductPriceViewRange" type="product2">
<data key="name" unique="suffix">BundleProduct</data>
<data key="sku" unique="suffix">bundle-product</data>
<data key="type_id">bundle</data>
<data key="attribute_set_id">4</data>
<data key="visibility">4</data>
<data key="status">1</data>
<data key="urlKey" unique="suffix">bundle-product</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeCategoryIds</requiredEntity>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">ApiProductDescription</requiredEntity>
<requiredEntity type="custom_attribute">ApiProductShortDescription</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeDynamicPrice</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributePriceViewRange</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
<element name="multiselectOptionFourProducts" type="multiselect" selector="//label//span[contains(text(), '{{productName}}')]/../..//select[@multiple='multiple']" parameterized="true"/>
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
<element name="currency" type="select" selector="//a[text()='{{arg}}']" parameterized="true"/>
<element name="multiSelectOption" type="select" selector="//div[@class='field option required']//select"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontBundleProductActionSection">
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide"/>
<element name="customizeAndAddToCartButton" type="button" selector="#bundle-slide" timeout="30"/>
<element name="quantityField" type="input" selector="#qty"/>
<element name="addToCartButton" type="button" selector="#product-addtocart-button"/>
<element name="addToCartButton" type="button" selector="#product-addtocart-button" timeout="30"/>
<element name="dropdownSelectOption" type="select" selector="//div[@class='control']/select"/>
<element name="dropdownProductSelection" type="select" selector="//div[@class='control']/select/option[contains(.,'{{productName}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
<features value="Bundle"/>
<stories value="View bundle products"/>
<title value="Check tier prices for bundle options"/>
<description value="Check tier prices for bundle options"/>
<testCaseId value="MAGETWO-98968"/>
<useCaseId value="MAGETWO-98603"/>
<severity value="AVERAGE"/>
<group value="catalog"/>
<group value="bundle"/>
</annotations>
Expand Down
9 changes: 3 additions & 6 deletions app/code/Magento/Catalog/Block/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ public function getAddToCartUrl($product, $additional = [])
}

/**
* Get JSON encoded configuration array which can be used for JS dynamic
* price calculation depending on product options
* Get JSON encoded configuration which can be used for JS dynamic price calculation depending on product options
*
* @return string
*/
Expand Down Expand Up @@ -262,6 +261,7 @@ public function isStartCustomization()

/**
* Get default qty - either as preconfigured, or as 1.
*
* Also restricts it by minimal qty.
*
* @param null|\Magento\Catalog\Model\Product $product
Expand Down Expand Up @@ -323,10 +323,7 @@ public function getQuantityValidators()
public function getIdentities()
{
$identities = $this->getProduct()->getIdentities();
$category = $this->_coreRegistry->registry('current_category');
if ($category) {
$identities[] = Category::CACHE_TAG . '_' . $category->getId();
}

return $identities;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Magento\Framework\DB\Select;
use Magento\Framework\EntityManager\MetadataPool;
use Magento\Framework\Indexer\DimensionFactory;
use Magento\Framework\Model\ResourceModel\ResourceModelPoolInterface;
use Magento\Store\Model\Indexer\WebsiteDimensionProvider;
use Magento\Store\Model\Store;

Expand Down
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="AddWebsiteToProductActionGroup">
<arguments>
<argument name="website" type="string"/>
</arguments>
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="scrollToProductInWebsiteSectionHeader"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="clickProductInWebsiteSectionHeader"/>
<checkOption selector="{{ProductInWebsitesSection.website(website)}}" stepKey="checkWebsite"/>
<scrollToTopOfPage stepKey="scrollToTopOfAdminProductFormSection"/>
<click selector="{{AdminProductFormSection.save}}" stepKey="clickSaveButton"/>
<waitForPageLoad stepKey="waitForSimpleProductSaved"/>
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertProductSaveSuccessMessage"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?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">
<!-- You must already be on the product form > Advanced Inventory;
Action group can be used for customer group price and tier price -->
<actionGroup name="AdminAddAdvancedPricingToTheProductActionGroup">
<arguments>
<argument name="index" type="string"/>
<argument name="groupPrice" type="entity"/>
</arguments>
<waitForPageLoad stepKey="waitForPageLoad"/>
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
<click selector="{{AdminProductFormAdvancedPricingSection.addCustomerGroupPrice}}" stepKey="clickCustomerGroupPriceAddButton"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(index)}}" userInput="{{groupPrice.website_id}}" stepKey="selectProductTierPriceWebsiteInput"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" userInput="{{groupPrice.customer_group}}" stepKey="selectProductTierPriceCustomerGroupInput"/>
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(index)}}" userInput="{{groupPrice.quantity}}" stepKey="fillProductTierPriceQuantityInput"/>
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput(index)}}" userInput="{{groupPrice.price}}" stepKey="selectProductTierPriceFixedPrice"/>
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
</actionGroup>

<!-- Customer group is selected in different way for B2B -->
<actionGroup name="AdminAddAdvancedPricingToTheProductExtendedActionGroup" extends="AdminAddAdvancedPricingToTheProductActionGroup">
<remove keyForRemoval="selectProductTierPriceCustomerGroupInput"/>
<click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(index)}}" stepKey="clickProductTierPriceCustGroupSelect" after="selectProductTierPriceWebsiteInput"/>
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" time="30" stepKey="waitProductTierPriceGroupOrCatalogOption" after="clickProductTierPriceCustGroupSelect"/>
<click selector="{{AdminProductFormAdvancedPricingSection.productTierPriceGroupOrCatalogOption(groupPrice.customer_group)}}" stepKey="clickAllGroupsOption" after="waitProductTierPriceGroupOrCatalogOption"/>
</actionGroup>
</actionGroups>
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="AdminAddMinimumAdvertisedPriceActionGroup">
<arguments>
<argument name="msrpData" type="entity"/>
</arguments>
<waitForPageLoad stepKey="waitForPageLoad"/>
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitSpecialPrice"/>
<fillField selector="{{AdminProductFormAdvancedPricingSection.msrp}}" userInput="{{msrpData.msrp}}" stepKey="fillMinimumAdvertisedPrice"/>
<selectOption selector="{{AdminProductFormAdvancedPricingSection.msrpType}}" userInput="{{msrpData.msrp_display_actual_price_type}}" stepKey="selectPriceType"/>
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/>
<waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.msrp}}" stepKey="waitForCloseModalWindow"/>
</actionGroup>
</actionGroups>
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">
<!-- Add custom option, title and type -->
<actionGroup name="AdminAddProductCustomOptionActionGroup">
<arguments>
<argument name="customOptionTitle" type="string"/>
<argument name="customOptionType" type="string"/>
</arguments>
<scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToCustomizableOptionsSection"/>
<waitForPageLoad stepKey="waitForScrolling"/>
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>
<fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionTitle}}"/>
<click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/>
<waitForPageLoad stepKey="waitForDropdownOpen"/>
<click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType(customOptionType)}}"/>
</actionGroup>
</actionGroups>
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">
<!-- Add value, value title and value price to custom options (type: drop-down, checkbox, multiple select, radio buttons) -->
<actionGroup name="AdminAddTitleAndPriceValueToCustomOptionActionGroup">
<arguments>
<argument name="optionValue" type="entity"/>
</arguments>
<click stepKey="clickAddValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/>
<fillField stepKey="fillInValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{optionValue.title}}"/>
<fillField stepKey="fillInValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{optionValue.price}}"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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 click on Advanced Inventory in product form;
You must already be on the product form page -->
<actionGroup name="AdminClickOnAdvancedInventoryLinkActionGroup">
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
<waitForPageLoad stepKey="waitForAdvancedInventoryPageToLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?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="AdminCreateCustomDropDownOptionsActionGroup">
<!-- ActionGroup will add a single custom option to a product
You must already be on the product creation page -->
<arguments>
<argument name="customOptionName" type="string"/>
<argument name="firstOption" type="entity"/>
<argument name="secondOption" type="entity"/>
</arguments>
<click stepKey="clickAddOptions" selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}"/>
<waitForPageLoad stepKey="waitForAddProductPageLoad"/>
<!-- Fill in the option and select the type of drop down -->
<fillField stepKey="fillInOptionTitle" selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{customOptionName}}"/>
<click stepKey="clickOptionTypeParent" selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}"/>
<waitForPageLoad stepKey="waitForDropdownOpen"/>
<click stepKey="clickOptionType" selector="{{AdminProductCustomizableOptionsSection.optionType('Drop-down')}}"/>
<!-- Add option based on the parameter -->
<click stepKey="clickAddFirstValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/>
<fillField stepKey="fillInFirstOptionValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{firstOption.title}}"/>
<fillField stepKey="fillInFirstOptionValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{firstOption.price}}"/>
<click stepKey="clickAddSecondValue" selector="{{AdminProductCustomizableOptionsSection.addValue}}"/>
<fillField stepKey="fillInSecondOptionValueTitle" selector="{{AdminProductCustomizableOptionsSection.valueTitle}}" userInput="{{secondOption.title}}"/>
<fillField stepKey="fillInSecondOptionValuePrice" selector="{{AdminProductCustomizableOptionsSection.valuePrice}}" userInput="{{secondOption.price}}"/>
</actionGroup>
</actionGroups>
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">
<!-- You must already be on the product form > Advanced Inventory -->
<actionGroup name="AdminFillAdvancedInventoryOutOfStockThresholdActionGroup">
<arguments>
<argument name="qty" type="string"/>
</arguments>
<uncheckOption selector="{{AdminProductFormAdvancedInventorySection.minQtyConfigSetting}}" stepKey="uncheckMiniQtyCheckBox"/>
<fillField selector="{{AdminProductFormAdvancedInventorySection.outOfStockThreshold}}" userInput="{{qty}}" stepKey="fillMiniAllowedQty"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?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">
<!-- You must already be on the product form > Advanced Inventory -->
<actionGroup name="AdminFillAdvancedInventoryQtyActionGroup">
<arguments>
<argument name="qty" type="string"/>
</arguments>
<fillField selector="{{AdminProductFormAdvancedInventorySection.advancedInventoryQty}}" userInput="{{qty}}" stepKey="fillQty"/>
</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">
<!-- Click done button;
You must already be on the product form > Advanced Inventory -->
<actionGroup name="AdminSubmitAdvancedInventoryFormActionGroup">
<click stepKey="clickOnDoneButton" selector="{{AdminProductFormAdvancedInventorySection.doneButton}}"/>
</actionGroup>
</actionGroups>
Loading

0 comments on commit 9787c95

Please sign in to comment.