Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mtf-eol' into MC-4789
Browse files Browse the repository at this point in the history
  • Loading branch information
tomreece committed Apr 11, 2019
2 parents 683d881 + b63827b commit 2ecc0ee
Show file tree
Hide file tree
Showing 105 changed files with 1,986 additions and 3,131 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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="SetWebsiteCountryOptionsToDefaultActionGroup">
<conditionalClick selector="{{CountryOptionsSection.countryOptions}}" dependentSelector="{{CountryOptionsSection.countryOptionsOpen}}" visible="false" stepKey="clickOnStoreInformation3"/>
<waitForElementVisible selector="{{CountryOptionsSection.topDestinations}}" stepKey="waitCheckboxToBeVisible3"/>
<checkOption selector="{{CountryOptionsSection.generalCountryAllowInherit}}" stepKey="setToDefault1"/>
<checkOption selector="{{CountryOptionsSection.generalCountryDefaultInherit}}" stepKey="setToDefault2"/>
<click selector="{{ContentManagementSection.Save}}" stepKey="saveDefaultConfig"/>
<waitForPageLoad stepKey="waitForSavingSystemConfiguration"/>
<see userInput="You saved the configuration." stepKey="seeSuccessMessage"/>
</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.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="CountryOptionsSection">
<element name="allowedCountries" type="select" selector="#general_country_allow"/>
<element name="notAllowedCountry" type="button" selector="#general_country_allow option:not([selected])"/>
<element name="generalCountryAllowInherit" type="checkbox" selector="#general_country_allow_inherit"/>
<element name="generalCountryDefaultInherit" type="checkbox" selector="#general_country_default_inherit"/>
<element name="generalCountryDefault" type="select" selector="#general_country_default"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*
* @deprecated
* @see \Magento\Catalog\Model\Product\Type\Price
*/
class FrontSpecialPrice extends Price
{
Expand Down Expand Up @@ -66,6 +69,8 @@ public function __construct(

/**
* @inheritdoc
*
* @deprecated
*/
protected function _applySpecialPrice($product, $finalPrice)
{
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="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
Expand Up @@ -289,4 +289,13 @@
<waitForPageLoad stepKey="waitForProductToLoad"/>
<waitForElementVisible selector="{{AdminHeaderSection.pageTitle}}" stepKey="waitForProductTitle"/>
</actionGroup>

<actionGroup name="deleteProductsIfTheyExist">
<conditionalClick selector="{{AdminProductGridSection.multicheckDropdown}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="openMulticheckDropdown"/>
<conditionalClick selector="{{AdminProductGridSection.multicheckOption('Select All')}}" dependentSelector="{{AdminProductGridSection.firstProductRow}}" visible="true" stepKey="selectAllProductInFilteredGrid"/>
<click selector="{{AdminProductGridSection.bulkActionDropdown}}" stepKey="clickActionDropdown"/>
<click selector="{{AdminProductGridSection.bulkActionOption('Delete')}}" stepKey="clickDeleteAction"/>
<waitForElementVisible selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="waitForModalPopUp"/>
<click selector="{{AdminProductGridConfirmActionSection.ok}}" stepKey="confirmProductDelete"/>
</actionGroup>
</actionGroups>
26 changes: 26 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,28 @@
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
</entity>
<entity name="SimpleProductDisabled" type="product">
<data key="sku" unique="suffix">simple_product_disabled</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="name" unique="suffix">Simple Product Disabled</data>
<data key="price">123.00</data>
<data key="visibility">4</data>
<data key="status">2</data>
<data key="quantity">1001</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
</entity>
<entity name="SimpleProductNotVisibleIndividually" type="product">
<data key="sku" unique="suffix">simple_product_not_visible_individually</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="name" unique="suffix">Simple Product Not Visible Individually</data>
<data key="price">123.00</data>
<data key="visibility">1</data>
<data key="status">1</data>
<data key="quantity">1000</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
</entity>
<entity name="NewSimpleProduct" type="product">
<data key="price">321.00</data>
</entity>
Expand Down Expand Up @@ -446,6 +468,10 @@
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
</entity>
<entity name="productWithDropdownOption" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionValueDropdown</requiredEntity>
</entity>
<entity name="ProductWithTextFieldAndAreaOptions" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionField</requiredEntity>
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductGridData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
<data key="from">10</data>
<data key="to">100</data>
</entity>
<entity name="ProductPerPage">
<data key="productCount">1</data>
</entity>
</entities>
9 changes: 9 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductOptionData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@
<requiredEntity type="product_option_value">ProductOptionValueDropdownLongTitle1</requiredEntity>
<requiredEntity type="product_option_value">ProductOptionValueDropdownLongTitle2</requiredEntity>
</entity>
<entity name="ProductOptionValueDropdown" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionDropDown</data>
<data key="type">drop_down</data>
<data key="sort_order">4</data>
<data key="is_require">true</data>
<requiredEntity type="product_option_value">ProductOptionValueWithSkuDropdown1</requiredEntity>
<requiredEntity type="product_option_value">ProductOptionValueWithSkuDropdown2</requiredEntity>
</entity>
<entity name="ProductOptionRadiobutton" type="product_option">
<var key="product_sku" entityType="product" entityKey="sku" />
<data key="title">OptionRadioButtons</data>
Expand Down
14 changes: 14 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductOptionValueData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,18 @@
<data key="price_type">percent</data>
<data key="sku">sku_drop_down_row_1</data>
</entity>
<entity name="ProductOptionValueWithSkuDropdown1" type="product_option_value">
<data key="title">ProductOptionValueWithSkuDropdown1</data>
<data key="sort_order">1</data>
<data key="price">10</data>
<data key="price_type">fixed</data>
<data key="sku">product_option_value_sku_dropdown_1_</data>
</entity>
<entity name="ProductOptionValueWithSkuDropdown2" type="product_option_value">
<data key="title">ProductOptionValueWithSkuDropdown2</data>
<data key="sort_order">1</data>
<data key="price">10</data>
<data key="price_type">fixed</data>
<data key="sku">product_option_value_sku_dropdown_2_</data>
</entity>
</entities>
8 changes: 8 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,12 @@
<data key="quantity">2</data>
<var key="sku" entityType="product2" entityKey="sku" />
</entity>
<entity name="tierProductPriceDefault" type="catalogTierPrice">
<data key="price">90.00</data>
<data key="price_type">fixed</data>
<data key="website_id">0</data>
<data key="customer_group">ALL GROUPS</data>
<data key="quantity">30</data>
<var key="sku" entityType="product" entityKey="sku" />
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<element name="specialPrice" type="input" selector="input[name='product[special_price]']"/>
<element name="doneButton" type="button" selector=".product_form_product_form_advanced_pricing_modal button.action-primary" timeout="5"/>
<element name="msrp" type="input" selector="//input[@name='product[msrp]']" timeout="30"/>
<element name="msrpType" type="select" selector="//select[@name='product[msrp_display_actual_price_type]']" timeout="30"/>
<element name="save" type="button" selector="#save-button"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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="AdminGridPageNumberAfterSaveAndCloseActionTest">
<annotations>
<features value="Catalog"/>
<title value="Checking Catalog grid page number after Save and Close action"/>
<description value="Checking Catalog grid page number after Save and Close action"/>
<severity value="MAJOR"/>
<testCaseId value="MAGETWO-96164"/>
<useCaseId value="MAGETWO-96127"/>
<group value="Catalog"/>
</annotations>
<before>
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
<!--Clear product grid-->
<comment userInput="Clear product grid" stepKey="commentClearProductGrid"/>
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/>
<waitForPageLoad stepKey="waitForProductIndexPage"/>
<conditionalClick selector="{{AdminProductGridFilterSection.clearFilters}}"
dependentSelector="{{AdminProductGridFilterSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<waitForLoadingMaskToDisappear stepKey="waitForGridLoad"/>
<actionGroup ref="deleteProductsIfTheyExist" stepKey="deleteProductIfTheyExist"/>
<createData stepKey="category1" entity="SimpleSubCategory"/>
<createData stepKey="product1" entity="SimpleProduct">
<requiredEntity createDataKey="category1"/>
</createData>
<createData stepKey="category2" entity="SimpleSubCategory"/>
<createData stepKey="product2" entity="SimpleProduct">
<requiredEntity createDataKey="category2"/>
</createData>
</before>
<after>
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/>
<waitForPageLoad stepKey="waitForProductIndexPage"/>
<click selector="{{AdminDataGridPaginationSection.previousPage}}" stepKey="clickPrevPageOrderGrid"/>
<actionGroup ref="adminDataGridDeleteCustomPerPage" stepKey="deleteCustomAddedPerPage">
<argument name="perPage" value="ProductPerPage.productCount"/>
</actionGroup>
<deleteData stepKey="deleteCategory1" createDataKey="category1"/>
<deleteData stepKey="deleteProduct1" createDataKey="product1"/>
<deleteData stepKey="deleteCategory2" createDataKey="category2"/>
<deleteData stepKey="deleteProduct2" createDataKey="product2"/>
<actionGroup ref="logout" stepKey="logout"/>
</after>
<amOnPage url="{{ProductCatalogPage.url}}" stepKey="goToProductCatalog"/>
<waitForPageLoad stepKey="waitForProductIndexPage"/>
<actionGroup ref="adminDataGridSelectCustomPerPage" stepKey="select1OrderPerPage">
<argument name="perPage" value="ProductPerPage.productCount"/>
</actionGroup>
<!--Go to the next page and edit the product-->
<comment userInput="Go to the next page and edit the product" stepKey="commentEdiProduct"/>
<click selector="{{AdminDataGridPaginationSection.nextPage}}" stepKey="clickNextPageOrderGrid"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct2">
<argument name="product" value="$$product2$$"/>
</actionGroup>
<actionGroup ref="AdminFormSaveAndClose" stepKey="saveAndCloseProduct"/>
<waitForPageLoad stepKey="waitForPageLoad1"/>
<seeInField selector="{{AdminDataGridPaginationSection.currentPage}}" userInput="2" stepKey="seeOnSecondPageOrderGrid"/>
</test>
</tests>
1 change: 0 additions & 1 deletion app/code/Magento/Catalog/etc/frontend/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,4 @@
<plugin name="catalog_app_action_dispatch_controller_context_plugin"
type="Magento\Catalog\Plugin\Framework\App\Action\ContextPlugin" />
</type>
<preference for="Magento\Catalog\Model\Product\Type\Price" type="Magento\Catalog\Model\Product\Type\FrontSpecialPrice" />
</config>
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">
<!-- Open the Minicart and check Summary -->
<actionGroup name="StorefrontCheckCartDiscountAndSummaryActionGroup">
<arguments>
<argument name="total" type="string"/>
<argument name="discount" type="string"/>
</arguments>
<waitForPageLoad stepKey="waitForPageLoad"/>
<waitForLoadingMaskToDisappear stepKey="waitForPrices"/>
<see selector="{{CheckoutCartSummarySection.discountAmount}}" userInput="-${{discount}}" stepKey="assertDiscount"/>
<wait time="10" stepKey="waitForTotalPrice"/>
<see selector="{{CheckoutCartSummarySection.total}}" userInput="${{total}}" stepKey="assertTotal"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@
<element name="productOptionLabel" type="text" selector="//dl[@class='item-options']"/>
<element name="checkoutCartProductPrice" type="text" selector="//td[@class='col price']//span[@class='price']"/>
<element name="checkoutCartSubtotal" type="text" selector="//td[@class='col subtotal']//span[@class='price']"/>
<element name="emptyCart" selector=".cart-empty" type="text"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<element name="shippingMethodForm" type="text" selector="#co-shipping-method-form"/>
<element name="shippingMethod" type="text" selector="//*[@id='cart-totals']//tr[@class='totals shipping excl']//th//span[@class='value']"/>
<element name="shipping" type="text" selector="//*[@id='cart-totals']//tr[@class='totals shipping excl']//td//span[@class='price']"/>
<element name="total" type="text" selector="//*[@id='cart-totals']//tr[@class='grand totals']//td//span[@class='price']"/>
<element name="total" type="text" selector="//*[@id='cart-totals']//tr[@class='grand totals']//td//span[@class='price']" timeout="10"/>
<element name="proceedToCheckout" type="button" selector=".action.primary.checkout span" timeout="30"/>
<element name="discountAmount" type="text" selector="td[data-th='Discount']"/>
<element name="shippingHeading" type="button" selector="#block-shipping-heading"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ public function process($path, $value, $scope, $scopeCode)
}

try {
$config = $this->configFactory->create([
$config = $this->configFactory->create(['data' => [
'scope' => $scope,
'scope_code' => $scopeCode,
]);
]]);
$config->setDataByPath($path, $value);
$config->save();
} catch (\Exception $exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testProcess($path, $value, $scope, $scopeCode)
$config = $this->createMock(Config::class);
$this->configFactory->expects($this->once())
->method('create')
->with(['scope' => $scope, 'scope_code' => $scopeCode])
->with(['data' => ['scope' => $scope, 'scope_code' => $scopeCode]])
->willReturn($config);
$config->expects($this->once())
->method('setDataByPath')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,11 @@
<entity name="GlobalCustomerAccountSharing" type="account_share_scope_value">
<data key="value">0</data>
</entity>

<entity name="CustomerAccountSharingSystemValue" type="customer_account_sharing_config_inherit">
<requiredEntity type="account_share_scope_inherit">CustomerAccountSharingInherit</requiredEntity>
</entity>
<entity name="CustomerAccountSharingInherit" type="account_share_scope_inherit">
<data key="inherit">true</data>
</entity>
</entities>
13 changes: 13 additions & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/CustomerData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,17 @@
<data key="store_id">0</data>
<data key="website_id">0</data>
</entity>
<entity name="Retailer_Customer" type="customer">
<data key="group_id">3</data>
<data key="default_billing">true</data>
<data key="default_shipping">true</data>
<data key="email" unique="prefix">John.Doe@example.com</data>
<data key="firstname">John</data>
<data key="lastname">Doe</data>
<data key="fullname">John Doe</data>
<data key="password">pwdTest123!</data>
<data key="store_id">0</data>
<data key="website_id">0</data>
<requiredEntity type="address">US_Address_CA</requiredEntity>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,16 @@
</object>
</object>
</operation>
<operation name="CustomerAccountShareConfigInherit" dataType="customer_account_sharing_config_inherit" type="create" auth="adminFormKey" url="/admin/system_config/save/section/customer/"
method="POST">
<object key="groups" dataType="customer_account_sharing_config_inherit">
<object key="account_share" dataType="customer_account_sharing_config_inherit">
<object key="fields" dataType="customer_account_sharing_config_inherit">
<object key="scope" dataType="account_share_scope_inherit">
<field key="inherit">boolean</field>
</object>
</object>
</object>
</object>
</operation>
</operations>
Loading

0 comments on commit 2ecc0ee

Please sign in to comment.